Created
November 12, 2010 14:07
-
-
Save jbrisbin/674124 to your computer and use it in GitHub Desktop.
Example KeyValueStoreKey representation to handle keys for various NoSQL stores.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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