-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add API to retrive all topic related data from the change
Also adds change status to the change based events.
- Loading branch information
Showing
8 changed files
with
396 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/main/java/com/sonymobile/tools/gerrit/gerritevents/dto/GerritChangeStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.sonymobile.tools.gerrit.gerritevents.dto; | ||
|
||
/** | ||
Contains constants that represent the status of changes. | ||
*/ | ||
public enum GerritChangeStatus { | ||
/** | ||
* Change is open. | ||
*/ | ||
NEW("NEW"), | ||
/** | ||
* Change was merged. | ||
*/ | ||
MERGED("MERGED"), | ||
/** | ||
* Change was abandoned. | ||
*/ | ||
ABANDONED("ABANDONED"), | ||
/** | ||
* Catch-all type if Gerrit adds a new ChangeStatus we don't know about. | ||
*/ | ||
UNKNOWN("UNKNOWN"); | ||
|
||
private final String status; | ||
|
||
/** | ||
* Internal constructor for GerritChangeStatus enum. | ||
* @param status string value returned in JSON | ||
*/ | ||
GerritChangeStatus(String status) { | ||
this.status = status; | ||
} | ||
|
||
/** | ||
* Look up the GerritChangeStatus from a string representation. | ||
* @param status the GerritChangeStatus returned in JSON | ||
* @return GerritChangeStatus enum value | ||
*/ | ||
public static GerritChangeStatus fromString(String status) { | ||
for (GerritChangeStatus s : GerritChangeStatus.values()) { | ||
if (s.status.equals(status)) { | ||
return s; | ||
} | ||
} | ||
return UNKNOWN; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.