Commit e85cb91f authored by Stefan Schuhbaeck's avatar Stefan Schuhbaeck
Browse files

add new label method and remove static from nextVersion method

parent 6c604b86
...@@ -23,6 +23,10 @@ public enum Version { ...@@ -23,6 +23,10 @@ public enum Version {
return label; return label;
} }
public String label(char repalce) {
return label.replace(' ', repalce);
}
public static Version fromString(String versionStr) { public static Version fromString(String versionStr) {
for (Version v : values()) { for (Version v : values()) {
if (v.label.equals(versionStr)) if (v.label.equals(versionStr))
...@@ -41,8 +45,13 @@ public enum Version { ...@@ -41,8 +45,13 @@ public enum Version {
throw new IllegalArgumentException("Value not in Version Enumeration " + curr.toString()); throw new IllegalArgumentException("Value not in Version Enumeration " + curr.toString());
} }
public static Version nextVersion(Version curr){ public Version nextVersion(){
int nextId = versionId(curr) == (values().length -1) ? versionId(curr) : versionId(curr) + 1; int nextId = versionId(this) == (values().length -1) ? versionId(this) : versionId(this) + 1;
return values()[nextId];
}
public Version previousVersion(){
int nextId = versionId(this) == 0 ? versionId(this) : versionId(this) - 1;
return values()[nextId]; return values()[nextId];
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment