Skip to content

Instantly share code, notes, and snippets.

@jbrisbin
Created November 12, 2010 14:07
Show Gist options
  • Save jbrisbin/674124 to your computer and use it in GitHub Desktop.
Save jbrisbin/674124 to your computer and use it in GitHub Desktop.
Example KeyValueStoreKey representation to handle keys for various NoSQL stores.
public class KeyValueStoreKey {
protected Object family;
protected Object key;
public KeyValueStoreKey() {
}
public KeyValueStoreKey(Object family, Object key) {
this.family = family;
this.key = key;
}
public Object getFamily() {
return family;
}
public void setFamily(Object family) {
this.family = family;
}
public Object getKey() {
return key;
}
public void setKey(Object key) {
this.key = key;
}
@Override
public String toString() {
if (null == family && null == key) {
return super.toString();
} else {
return (null != family ? family.toString() : "") + ":" + (null != key ? key.toString() : "");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment