Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 217c9af4747de735d5f5531478a74ef915321a4b 1 parent 50d1b36
@mikewied mikewied authored ingenthr committed
View
3  src/main/java/net/spy/memcached/ObserveResponse.java
@@ -77,4 +77,7 @@ public static ObserveResponse valueOf(byte b) {
}
}
+ public byte getResponse() {
+ return value;
+ }
}
View
20 src/main/java/net/spy/memcached/PersistTo.java
@@ -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;
+ }
}
View
18 src/main/java/net/spy/memcached/ReplicateTo.java
@@ -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;
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.