Package net.citizensnpcs.api.npc
Interface MetadataStore
- All Known Implementing Classes:
- SimpleMetadataStore
public interface MetadataStore
Represents a storage system for metadata
- 
Method SummaryModifier and TypeMethodDescriptionclone()Copies the metadata store.<T> TFetches metadata from the given key.<T> TFetches metadata from the given key.default <T> Tget(NPC.Metadata key) Fetches metadata from the given key.default <T> Tget(NPC.Metadata key, T def) Fetches metadata from the given key.booleanReturns whether the metadata exists.default booleanhas(NPC.Metadata key) Returns whether the metadata exists.voidLoads persistent metadata from the givenDataKey.voidRemoves any metadata at the given metadata key.default voidremove(NPC.Metadata key) Removes any metadata at the given metadata key.voidSaves persistent metadata to the givenDataKey.voidStores data at the given key.default voidset(NPC.Metadata key, Object data) Stores data at the given key.voidsetPersistent(String key, Object data) Stores data at the given key.default voidsetPersistent(NPC.Metadata key, Object data) Stores data at the given key.intsize()
- 
Method Details- 
cloneMetadataStore clone()Copies the metadata store.
- 
getFetches metadata from the given key.- Parameters:
- key- The key to get metadata from
- Returns:
- The metadata at the given key, or null if not found
 
- 
getFetches metadata from the given key.- 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
 
- 
getFetches metadata from the given key.- Parameters:
- key- The key to get metadata from
- Returns:
- The metadata at the given key, or null if not found
 
- 
getFetches metadata from the given key. Sets the default value provided viaset(String, Object)if the metadata is not already stored.- 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
 
- 
hasReturns whether the metadata exists.- Parameters:
- key- The metadata key
- Returns:
- Whether the metadata exists
 
- 
hasReturns whether the metadata exists.- Parameters:
- key- The metadata key
- Returns:
- Whether the metadata exists
 
- 
loadFromLoads persistent metadata from the givenDataKey.- Parameters:
- key- The key to load from
 
- 
removeRemoves any metadata at the given metadata key.- Parameters:
- key- The metadata key
 
- 
removeRemoves any metadata at the given metadata key.- Parameters:
- key- The metadata key
 
- 
saveToSaves persistent metadata to the givenDataKey.- Parameters:
- key- The key to save to.
 
- 
setStores data at the given key. Data will not persist.- Parameters:
- key- The metadata key
- data- The data to store
 
- 
setStores data at the given key. Data will not persist.- Parameters:
- key- The metadata key
- data- The data to store
 
- 
setPersistentStores data at the given key. Data will persist and must be a primitive type orString.- Parameters:
- key- The metadata key
- data- The data to store
 
- 
setPersistentStores data at the given key. Data will persist and must be a primitive type orString.- Parameters:
- key- The metadata key
- data- The data to store
 
- 
sizeint size()- Returns:
- The number of elements in the store
 
 
-