diff --git a/vcs/src/main/java/one/nem/lacerta/vcs/ActionTypes.java b/vcs/src/main/java/one/nem/lacerta/vcs/ActionTypes.java new file mode 100644 index 00000000..db0b398a --- /dev/null +++ b/vcs/src/main/java/one/nem/lacerta/vcs/ActionTypes.java @@ -0,0 +1,40 @@ +package one.nem.lacerta.vcs; + +public enum ActionTypes { + + INSERT_PAGE("insert_page"), + UPDATE_PAGE("update_page"), + DELETE_PAGE("delete_page"), + UPDATE_PAGE_ORDER("update_page_order"), + INSERT_PAGE_CONTENT("insert_page_content"), + UPDATE_PAGE_CONTENT("update_page_content"), + DELETE_PAGE_CONTENT("delete_page_content"), + + CREATE_BRANCH("create_branch"), + DROP_BRANCH("drop_branch"), + REBASE_BRANCH("rebase_branch"), + + CREATE_DOCUMENT("create_document"), + DROP_DOCUMENT("drop_document"), + UPDATE_DOCUMENT_META("update_document_meta"), + OTHER("other"); + + private final String value; + + ActionTypes(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionTypes fromValue(String value) { + for (ActionTypes actionType : ActionTypes.values()) { + if (actionType.getValue().equals(value)) { + return actionType; + } + } + return ActionTypes.OTHER; + } +}