Package net.citizensnpcs.api.persistence
Annotation Type Persist
A marker annotation for 
PersistenceLoader to persist a field by saving and loading it into DataKeys.- 
Optional Element SummaryOptional ElementsModifier and TypeOptional ElementDescriptionClass<?> The specialised collection type to use when a super class is specified.Class<?> The specific key type to use when deserialising Map keys from storage.If using global/static persistence, must be non-empty.booleanWhether to use PersistenceLoader to load/save the value of this class.booleanWhether a value must be present at load time.The DataKey path to use when saving/loading.Class<?> The specific value type to use when deserialising values from storage.
- 
Element Details- 
collectionTypeClass<?> collectionTypeThe specialised collection type to use when a super class is specified. Eg. WeakHashMap.class when the field type is Map.- Default:
- java.util.Collection.class
 
- 
keyTypeClass<?> keyTypeThe specific key type to use when deserialising Map keys from storage. Only supports primitive values and UUIDs currently.- Default:
- java.lang.String.class
 
- 
namespaceString namespaceIf using global/static persistence, must be non-empty.- Default:
- ""
 
- 
reifyboolean reifyWhether to use PersistenceLoader to load/save the value of this class.- Default:
- false
 
- 
requiredboolean requiredWhether a value must be present at load time. If a value for the field could not be loaded,PersistenceLoader.load(Object, DataKey)will return null.- Default:
- false
 
- 
valueString valueThe DataKey path to use when saving/loading. If not present, the field name will be used instead.- @Persist-> root key + field name
- @Persist("")-> root key + "" (i.e. just the root key)
- @Persist("sub")root key + "sub"
- @Persist("$key")loads the root key, does not save
 - Default:
- "UNINITIALISED"
 
- 
valueTypeClass<?> valueTypeThe specific value type to use when deserialising values from storage. Most useful when using specific number types e.g. Long, Byte, Short but storing as Integer.- Default:
- java.lang.Object.class
 
 
-