Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchType.java')
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchType.java66
1 files changed, 66 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchType.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchType.java
new file mode 100644
index 00000000000..d50833ad3ad
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchType.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.core.enums;
+
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public enum BranchType {
+ WORKING(0),
+ BASELINE(2),
+ MERGE(3),
+ SYSTEM_ROOT(4);
+ private final int value;
+
+ BranchType(int value) {
+ this.value = value;
+ }
+
+ public final int getValue() {
+ return value;
+ }
+
+ public boolean isBaselineBranch() {
+ return this == BranchType.BASELINE;
+ }
+
+ public boolean isSystemRootBranch() {
+ return this == BranchType.SYSTEM_ROOT;
+ }
+
+ public boolean isMergeBranch() {
+ return this == BranchType.MERGE;
+ }
+
+ public boolean isWorkingBranch() {
+ return this == BranchType.WORKING;
+ }
+
+ public boolean isOfType(BranchType... branchTypes) {
+ for (BranchType branchType : branchTypes) {
+ if (this == branchType) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static BranchType valueOf(int value) throws OseeArgumentException {
+ for (BranchType type : values()) {
+ if (type.getValue() == value) {
+ return type;
+ }
+ }
+ throw new OseeArgumentException("No branch type with value " + value);
+ }
+}

Back to the top