Module watamebot
Package net.foxgenesis.property
Interface PropertyProvider<C,K,G,M extends PropertyMapping>
- Type Parameters:
C- property category typeK- property key typeG- lookup typeM- property mapping type
- All Known Subinterfaces:
LCKPropertyProvider,PluginPropertyProvider
public interface PropertyProvider<C,K,G,M extends PropertyMapping>
Base interface defining methods to provide and register
LCKProperty
and PropertyInfo.- Author:
- Ashley
-
Method Summary
Modifier and TypeMethodDescriptiongetProperty(@NotNull PropertyInfo info) Get aLCKPropertylinked to the specifiedPropertyInfo.getProperty(C category, K key) getPropertyByID(int id) Get aLCKPropertybased on the specified property informationid.Get a list of all registeredPropertyInfo.}booleanpropertyExists(C category, K key) Check if aPropertyInfois registered inside the configurationregisterProperty(C category, K key, boolean modifiable, @NotNull PropertyType type) Register a newPropertyInfoinside the configuration.upsertProperty(C category, K key, boolean modifiable, @NotNull PropertyType type) Register aPropertyInfoif it does not exist inside the configuration and return a newLCKPropertycreated with the property information.
-
Method Details
-
registerProperty
PropertyInfo registerProperty(@NotNull C category, @NotNull K key, boolean modifiable, @NotNull @NotNull PropertyType type) Register a newPropertyInfoinside the configuration.- Parameters:
category- - property ownerkey- - property keymodifiable- - if can be modified by the usertype- - property storage type- Returns:
- Returns the created
PropertyInfo
-
upsertProperty
default Property<G,M> upsertProperty(@NotNull C category, @NotNull K key, boolean modifiable, @NotNull @NotNull PropertyType type) Register aPropertyInfoif it does not exist inside the configuration and return a newLCKPropertycreated with the property information.- Parameters:
category- - property ownerkey- - property keymodifiable- - if can be modified by the end usertype- - property storage type- Returns:
- Returns a
LCKPropertywith the specifiedPropertyInfo
-
getPropertyByID
Get aLCKPropertybased on the specified property informationid.- Parameters:
id- -PropertyInfoid- Returns:
- Returns a
LCKPropertyusing the specifiedPropertyInfoid
-
getProperty
- Parameters:
category- - property ownerkey- - property key- Returns:
- Returns a
LCKPropertylinked to thePropertyInfocategoryandname
-
getProperty
Get aLCKPropertylinked to the specifiedPropertyInfo.- Parameters:
info- - property information- Returns:
- Returns a
LCKPropertywith the specifiedinfo
-
propertyExists
Check if aPropertyInfois registered inside the configuration- Parameters:
category- - property ownerkey- - property key- Returns:
- Returns
trueif the property already exists inside the configuration, otherwisefalse
-
getPropertyList
List<PropertyInfo> getPropertyList()Get a list of all registeredPropertyInfo.}- Returns:
- Returns a
Listof allPropertyInforegistered inside the configuration
-