public final class Location extends Object
Many client operations locate a piece of information in Riak via a
bucket type, bucket name, and a key. This class encapsulates these
three items by combining a Namespace
with a key and is
used with most client operations.
Riak itself is character set agnostic; everything is stored as bytes. The convenience methods in this class rely on either the default Charset or a supplied one to convert Strings to a byte[].
Constructor and Description |
---|
Location(Namespace namespace,
BinaryValue key)
Construct a new Location with the provided Namespace and key.
|
Location(Namespace namespace,
String key)
Construct a new Location with the provided namespace and key.
|
Location(Namespace namespace,
String key,
Charset charset)
Construct a new Location with the provided Namespace and key.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
BinaryValue |
getKey()
Returns the key for this location.
|
String |
getKeyAsString()
Get the key for this location as a String.
|
String |
getKeyAsString(Charset charset)
Get the key for this location as a String.
|
Namespace |
getNamespace()
Return the Namespace for this location.
|
int |
hashCode() |
String |
toString() |
public Location(Namespace namespace, BinaryValue key)
namespace
- The namespace for this location.key
- The key for this location.public Location(Namespace namespace, String key, Charset charset)
The supplied string is converted to bytes using the supplied charset.
namespace
- The namespace for this location.key
- The key for this location.charset
- the charset for the keypublic BinaryValue getKey()
public String getKeyAsString()
The default character set is used.
public String getKeyAsString(Charset charset)
The supplied character set is used.
charset
- The Charset used to convert to a String.public Namespace getNamespace()
Copyright © 2016. All rights reserved.