Permalink
Browse files

JCBC-110: Add accessor funcitons to observe enum classes

Change-Id: If6c8ecd0fd5be178001db7db229b94a9184a8a2f
Reviewed-on: http://review.couchbase.org/20849
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Matt Ingenthron <matt@couchbase.com>
  • Loading branch information...
1 parent 50d1b36 commit 217c9af4747de735d5f5531478a74ef915321a4b @mikewied mikewied committed with ingenthr Sep 14, 2012
@@ -77,4 +77,7 @@ public static ObserveResponse valueOf(byte b) {
}
}
+ public byte getResponse() {
+ return value;
+ }
}
@@ -29,21 +29,31 @@
/**
* Persist to the Master. ONE implies MASTER.
*/
- MASTER,
+ MASTER(1),
/**
* ONE implies MASTER.
*/
- ONE,
+ ONE(1),
/**
* Persist to at least two nodes including Master.
*/
- TWO,
+ TWO(2),
/**
* Persist to at least three nodes including Master.
*/
- THREE,
+ THREE(3),
/**
* Persist to at least four nodes including Master.
*/
- FOUR
+ FOUR(4);
+
+ private final int value;
+
+ PersistTo(int val) {
+ value = val;
+ }
+
+ public int getValue() {
+ return value;
+ }
}
@@ -29,17 +29,27 @@
/**
* Replicate to at least zero nodes.
*/
- ZERO,
+ ZERO(0),
/**
* Replicate to at least one node.
*/
- ONE,
+ ONE(1),
/**
* Replicate to at least two nodes.
*/
- TWO,
+ TWO(2),
/**
* Replicate to at least three nodes.
*/
- THREE
+ THREE(3);
+
+ private final int value;
+
+ ReplicateTo(int val) {
+ value = val;
+ }
+
+ public int getValue() {
+ return value;
+ }
}

0 comments on commit 217c9af

Please sign in to comment.