Starting from 2021-07-01, all LRZ GitLab users will be required to explicitly accept the GitLab Terms of Service. Please see the detailed information at https://doku.lrz.de/display/PUBLIC/GitLab and make sure that your projects conform to the requirements.

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 {
return label;
}
public String label(char repalce) {
return label.replace(' ', repalce);
}
public static Version fromString(String versionStr) {
for (Version v : values()) {
if (v.label.equals(versionStr))
......@@ -41,8 +45,13 @@ public enum Version {
throw new IllegalArgumentException("Value not in Version Enumeration " + curr.toString());
}
public static Version nextVersion(Version curr){
int nextId = versionId(curr) == (values().length -1) ? versionId(curr) : versionId(curr) + 1;
public Version nextVersion(){
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];
}
......
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