@Retention(value=RUNTIME) @Target(value={FIELD,METHOD}) public @interface RiakUsermeta
If you set the key value (to anything other than the empty string) then you can use the annotation to map a single key of user meta data to a field.
public class MyClass { @RiakUsermeta private Map<String, String> usermetaData; @RiakUsermeta("usermeta-data-key1") private String usermetaDataItem1; } public class MyClass { private Map<String, String> usermetaData; private String usermetaDataItem1; @RiakUsermeta public Map<String, String> getMeta() { return usermetaData; } @RiakUsermeta public void setMeta( Map<String,String> meta) { usermetaData = meta; } @RiakUsermeta("usermeta-data-key1") public String getSingleMeta() { return usermetaDataItem1; } @RiakUsermeta("usermeta-data-key1") public void setSingleMeta(String meta) { usermetaDataItem1 = meta; } }
public abstract String key
Copyright © 2016. All rights reserved.