summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkwilk2011-12-07 17:05:27 (EST)
committerRyan D. Brooks2011-12-07 17:05:27 (EST)
commit9ba5e5b6bfb8f08423b38e9a0c05628be9e15126 (patch)
treea1366c6e2475724bbe7acfdf4d7158fc20a70502
parent705425d65ee4d06ace788a78ce9384bbcf35f607 (diff)
downloadorg.eclipse.osee-9ba5e5b6bfb8f08423b38e9a0c05628be9e15126.zip
org.eclipse.osee-9ba5e5b6bfb8f08423b38e9a0c05628be9e15126.tar.gz
org.eclipse.osee-9ba5e5b6bfb8f08423b38e9a0c05628be9e15126.tar.bz2
feature[ats_SL1LB]: Improve unarchive ability0.9.9.v201112080002_SR3
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchArchivedState.java39
1 files changed, 35 insertions, 4 deletions
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchArchivedState.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchArchivedState.java
index 09f2c63..b3e80a6 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchArchivedState.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/BranchArchivedState.java
@@ -16,7 +16,9 @@ package org.eclipse.osee.framework.core.enums;
public enum BranchArchivedState {
ARCHIVED(1),
UNARCHIVED(0),
- ALL(-1);
+ ALL(-1),
+ ARCHIVED_IN_PROGRESS(2),
+ UNARCHIVED_IN_PROGRESS(3);
private final int value;
@@ -28,6 +30,14 @@ public enum BranchArchivedState {
return value;
}
+ public boolean isBeingArchived() {
+ return this == ARCHIVED_IN_PROGRESS;
+ }
+
+ public boolean isBeingUnarchived() {
+ return this == UNARCHIVED_IN_PROGRESS;
+ }
+
public boolean isArchived() {
return this == ARCHIVED;
}
@@ -40,11 +50,32 @@ public enum BranchArchivedState {
return branchState == BranchArchivedState.ALL || this == branchState;
}
- public static BranchArchivedState fromBoolean(boolean isArchived) {
- return isArchived ? ARCHIVED : UNARCHIVED;
+ /**
+ * @return mapping to BranchArchivedState subset.
+ *
+ * <p>
+ * <code>
+ * true == BranchArchivedState.ARCHIVED<br/>
+ * false == BranchArchivedState.UNARCHIVED
+ * <code>
+ * </p>
+ */
+ public static BranchArchivedState fromBoolean(boolean archived) {
+ return archived ? ARCHIVED : UNARCHIVED;
}
public static BranchArchivedState valueOf(int value) {
- return ARCHIVED.getValue() != value ? UNARCHIVED : ARCHIVED;
+ switch (value) {
+ case 1:
+ return ARCHIVED;
+ case 2:
+ return ARCHIVED_IN_PROGRESS;
+ case 3:
+ return UNARCHIVED_IN_PROGRESS;
+ case -1:
+ case 0:
+ default:
+ return UNARCHIVED;
+ }
}
}