Package net.citizensnpcs.api.npc
Class SimpleMetadataStore
java.lang.Object
net.citizensnpcs.api.npc.SimpleMetadataStore
- All Implemented Interfaces:
- MetadataStore
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionclone()Copies the metadata store.<T> TFetches metadata from the given key.<T> TFetches metadata from the given key.<T> Tget(NPC.Metadata key) Fetches metadata from the given key.<T> Tget(NPC.Metadata key, T def) Fetches metadata from the given key.booleanReturns whether the metadata exists.booleanhas(NPC.Metadata key) Returns whether the metadata exists.voidLoads persistent metadata from the givenDataKey.voidRemoves any metadata at the given metadata key.voidremove(NPC.Metadata key) Removes any metadata at the given metadata key.voidSaves persistent metadata to the givenDataKey.voidStores data at the given key.voidset(NPC.Metadata key, Object data) Stores data at the given key.voidsetPersistent(String key, Object data) Stores data at the given key.voidsetPersistent(NPC.Metadata key, Object data) Stores data at the given key.intsize()
- 
Constructor Details- 
SimpleMetadataStorepublic SimpleMetadataStore()
 
- 
- 
Method Details- 
cloneDescription copied from interface:MetadataStoreCopies the metadata store.- Specified by:
- clonein interface- MetadataStore
- Overrides:
- clonein class- Object
 
- 
getDescription copied from interface:MetadataStoreFetches metadata from the given key.- Specified by:
- getin interface- MetadataStore
- Parameters:
- key- The key to get metadata from
- Returns:
- The metadata at the given key, or null if not found
 
- 
getDescription copied from interface:MetadataStoreFetches metadata from the given key.- Specified by:
- getin interface- MetadataStore
- Parameters:
- key- The key to get metadata from
- def- The default value to return
- Returns:
- The metadata at the given key, or def if not found
 
- 
getDescription copied from interface:MetadataStoreFetches metadata from the given key.- Specified by:
- getin interface- MetadataStore
- Parameters:
- key- The key to get metadata from
- Returns:
- The metadata at the given key, or null if not found
 
- 
getDescription copied from interface:MetadataStoreFetches metadata from the given key. Sets the default value provided viaMetadataStore.set(String, Object)if the metadata is not already stored.- Specified by:
- getin interface- MetadataStore
- Parameters:
- key- The key to get metadata from
- def- The default value to return
- Returns:
- The metadata at the given key, or def if not found
 
- 
hasDescription copied from interface:MetadataStoreReturns whether the metadata exists.- Specified by:
- hasin interface- MetadataStore
- Parameters:
- key- The metadata key
- Returns:
- Whether the metadata exists
 
- 
hasDescription copied from interface:MetadataStoreReturns whether the metadata exists.- Specified by:
- hasin interface- MetadataStore
- Parameters:
- key- The metadata key
- Returns:
- Whether the metadata exists
 
- 
loadFromDescription copied from interface:MetadataStoreLoads persistent metadata from the givenDataKey.- Specified by:
- loadFromin interface- MetadataStore
- Parameters:
- key- The key to load from
 
- 
removeDescription copied from interface:MetadataStoreRemoves any metadata at the given metadata key.- Specified by:
- removein interface- MetadataStore
- Parameters:
- key- The metadata key
 
- 
removeDescription copied from interface:MetadataStoreRemoves any metadata at the given metadata key.- Specified by:
- removein interface- MetadataStore
- Parameters:
- key- The metadata key
 
- 
saveToDescription copied from interface:MetadataStoreSaves persistent metadata to the givenDataKey.- Specified by:
- saveToin interface- MetadataStore
- Parameters:
- key- The key to save to.
 
- 
setDescription copied from interface:MetadataStoreStores data at the given key. Data will not persist.- Specified by:
- setin interface- MetadataStore
- Parameters:
- key- The metadata key
- data- The data to store
 
- 
setDescription copied from interface:MetadataStoreStores data at the given key. Data will not persist.- Specified by:
- setin interface- MetadataStore
- Parameters:
- key- The metadata key
- data- The data to store
 
- 
setPersistentDescription copied from interface:MetadataStoreStores data at the given key. Data will persist and must be a primitive type orString.- Specified by:
- setPersistentin interface- MetadataStore
- Parameters:
- key- The metadata key
- data- The data to store
 
- 
setPersistentDescription copied from interface:MetadataStoreStores data at the given key. Data will persist and must be a primitive type orString.- Specified by:
- setPersistentin interface- MetadataStore
- Parameters:
- key- The metadata key
- data- The data to store
 
- 
sizepublic int size()- Specified by:
- sizein interface- MetadataStore
- Returns:
- The number of elements in the store
 
 
-