com.basho.riak.client.cap
Class Quorum

java.lang.Object
  extended by com.basho.riak.client.cap.Quorum

public final class Quorum
extends Object

Encapsulates a bucket's r/w/dw/rw/p/pr/pw quora as either the symbolic Quora or an int.

Author:
russell
See Also:
BucketPropertiesBuilder

Constructor Summary
Quorum(int i)
          Construct an instance that wraps an int value
Quorum(Quora quorum)
          Construct and instance that wraps a symbolic Quora
 
Method Summary
 boolean equals(Object obj)
           
 int getIntValue()
          The int value of the quorum.
 String getName()
           
 Quora getSymbolicValue()
          Get the Symbolic value of this quorum.
 int hashCode()
           
 boolean isSymbolic()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Quorum

public Quorum(int i)
Construct an instance that wraps an int value

Parameters:
i -

Quorum

public Quorum(Quora quorum)
Construct and instance that wraps a symbolic Quora

Parameters:
quorum -
Method Detail

isSymbolic

public boolean isSymbolic()
Returns:
true if this Quorum represents a symbolic value, false if literal integer value

getIntValue

public int getIntValue()
The int value of the quorum. Call isSymbolic to determine if you should use this.

Returns:
the int value. Will be a negative number for symbolic values.

getSymbolicValue

public Quora getSymbolicValue()
Get the Symbolic value of this quorum. A value of Quora.INTEGER means that the quorum has a meaningful int value

Returns:

getName

public String getName()
Returns:
the name given to this quorum's symbolic value
See Also:
Quora.getName()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2012. All Rights Reserved.