public class BaseConfigurationService extends BaseRegistry implements ConfigurationService
| Modifier and Type | Field and Description |
|---|---|
protected ninja.leaping.configurate.loader.ConfigurationLoader<ninja.leaping.configurate.commented.CommentedConfigurationNode> |
configLoader |
| Constructor and Description |
|---|
BaseConfigurationService(ninja.leaping.configurate.loader.ConfigurationLoader<ninja.leaping.configurate.commented.CommentedConfigurationNode> configLoader) |
| Modifier and Type | Method and Description |
|---|---|
<T> void |
addToCollection(Key<? extends java.util.Collection<T>> key,
T value)
Adds the provided value to this registry's
Collection value for the provided Key |
void |
load()
Runs all
listeners that were
added before this call. |
<K,T> void |
putInMap(Key<? extends java.util.Map<K,T>> key,
K mapKey,
T mapValue)
Puts the provided key and value pair to this registry's
Map value for the provided Key |
<T> void |
remove(Key<T> key)
Removes this registry's value for the provided
Key |
<T> void |
removeFromCollection(Key<? extends java.util.Collection<T>> key,
T value)
Removes the provided value from this registry's
Collection value for the provided Key |
<K,T> void |
removeFromMap(Key<? extends java.util.Map<K,T>> key,
K mapKey)
Removes the provided key from this registry's
Map value for the provided Key |
boolean |
save()
Updates the config with values from the registry.
|
<T> void |
set(Key<T> key,
T value)
Sets this registry's value for the provided
Key |
protected void |
setDescription(Key<?> key,
java.lang.String description) |
protected void |
setName(Key<?> key,
java.lang.String name) |
protected <T> void |
setVerification(Key<T> key,
java.util.Map<java.util.function.Predicate<T>,java.util.function.Function<T,T>> verification) |
<T> void |
transform(Key<T> key,
java.util.function.BiFunction<? super Key<T>,? super T,? extends T> transformer)
Applies the provided transformation to this registry's
value for the provided
Key |
<T> void |
transform(Key<T> key,
java.util.function.Function<? super T,? extends T> transformer)
Applies the provided transformation to this registry's
value for the provided
Key |
protected void |
withAll() |
protected void |
withCore() |
protected void |
withDataStore() |
protected void |
withDataStoreCore() |
protected void |
withDefault() |
protected void |
withMongoDB() |
protected void |
withProxyMode() |
protected void |
withRedis() |
get, getDefault, getUnsafe, setDefault, toString, whenLoadedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitget, getDefault, getOrDefault, getUnsafe, whenLoadedprotected ninja.leaping.configurate.loader.ConfigurationLoader<ninja.leaping.configurate.commented.CommentedConfigurationNode> configLoader
@Inject public BaseConfigurationService(ninja.leaping.configurate.loader.ConfigurationLoader<ninja.leaping.configurate.commented.CommentedConfigurationNode> configLoader)
protected void withCore()
protected void withDataStoreCore()
protected void withDataStore()
protected void withMongoDB()
protected void withRedis()
protected void withProxyMode()
protected void withDefault()
protected void withAll()
protected <T> void setVerification(Key<T> key, java.util.Map<java.util.function.Predicate<T>,java.util.function.Function<T,T>> verification)
protected void setName(Key<?> key, java.lang.String name)
protected void setDescription(Key<?> key, java.lang.String description)
public <T> void set(Key<T> key, T value)
RegistryKeypublic <T> void remove(Key<T> key)
RegistryKeypublic <T> void transform(Key<T> key, java.util.function.BiFunction<? super Key<T>,? super T,? extends T> transformer)
RegistryKeypublic <T> void transform(Key<T> key, java.util.function.Function<? super T,? extends T> transformer)
RegistryKeypublic <T> void addToCollection(Key<? extends java.util.Collection<T>> key, T value)
RegistryCollection value for the provided KeyaddToCollection in interface RegistryaddToCollection in class BaseRegistryT - The value type of the provided Keykey - The Key of the collection
to add the provided value tovalue - The value to addpublic <T> void removeFromCollection(Key<? extends java.util.Collection<T>> key, T value)
RegistryCollection value for the provided KeyremoveFromCollection in interface RegistryremoveFromCollection in class BaseRegistryT - The value type of the provided Keykey - The Key of the collection
to add the provided value tovalue - The value to addpublic <K,T> void putInMap(Key<? extends java.util.Map<K,T>> key, K mapKey, T mapValue)
RegistryMap value for the provided KeyputInMap in interface RegistryputInMap in class BaseRegistryK - The key type of the map value for the provided keyT - The value type of the map value for the provided keykey - The Key of the map to add the
provided key and value pair tomapKey - The map key to addmapValue - The map value to addpublic <K,T> void removeFromMap(Key<? extends java.util.Map<K,T>> key, K mapKey)
RegistryMap value for the provided KeyremoveFromMap in interface RegistryremoveFromMap in class BaseRegistryK - The key type of the map value for the provided keyT - The value type of the map value for the provided keykey - The Key of the map to remove the provided mapKey frommapKey - The map key to removepublic void load()
Registrylisteners that were
added before this call.load in interface Registryload in class BaseRegistryEnvironment.reload(),
Registry.whenLoaded(Runnable)public boolean save()
ConfigurationServicesave in interface ConfigurationServicetrue if there were updated values to save and they were saved successfully
otherwise false