47 lines
1.2 KiB
Java
47 lines
1.2 KiB
Java
// Copyright (c) 2021, Fr.Terrot. All rights reserved.
|
|
// Use of this source code is governed by a MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package io.gitea.model;
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
public enum IssueType {
|
|
EPIC("epic"), STORY("story"), FEATURE("feature"), BUG("bug"), TASK("task"), ENHANCEMENT("enhancement"),
|
|
QUESTION("question"), IMPEDIMENT("impediment");
|
|
|
|
static public final Pattern PATTERN = Pattern.compile("(" + StringUtils.join(IssueType.values(), "|") + ")");
|
|
|
|
private String value;
|
|
|
|
private IssueType(String value) {
|
|
this.value = value;
|
|
}
|
|
|
|
public String getValue() {
|
|
return value;
|
|
}
|
|
|
|
public String toString() {
|
|
return value;
|
|
}
|
|
|
|
public boolean equals(IssueType arg0) {
|
|
return this.value.contentEquals(arg0.getValue());
|
|
}
|
|
|
|
public boolean equals(String arg0) {
|
|
return this.value.equals(arg0);
|
|
}
|
|
|
|
public static boolean contains(String value) {
|
|
for (IssueType t : IssueType.values()) {
|
|
if (t.equals(value))
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
}
|