diff options
Diffstat (limited to 'src/com/gitblit/Constants.java')
-rw-r--r-- | src/com/gitblit/Constants.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/com/gitblit/Constants.java b/src/com/gitblit/Constants.java index 2543ea12..3204a553 100644 --- a/src/com/gitblit/Constants.java +++ b/src/com/gitblit/Constants.java @@ -227,4 +227,25 @@ public class Constants { return name();
}
}
+
+ /**
+ * Enumeration of the search types.
+ */
+ public static enum SearchType {
+ AUTHOR, COMMITTER, COMMIT;
+
+ public static SearchType forName(String name) {
+ for (SearchType type : values()) {
+ if (type.name().equalsIgnoreCase(name)) {
+ return type;
+ }
+ }
+ return COMMIT;
+ }
+
+ @Override
+ public String toString() {
+ return name().toLowerCase();
+ }
+ }
}
|