Class AbstractRegistry<R extends RegistryKey,T>
java.lang.Object
ovh.mythmc.social.api.util.registry.AbstractRegistry<R,T>
- Direct Known Subclasses:
AbstractRegistry.Identified,AbstractRegistry.Namespaced
public abstract class AbstractRegistry<R extends RegistryKey,T>
extends Object
implements Registry<R,T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(R registryKey) Checks if a value exists in the registry for the given registry key.booleancontainsValue(T value) Checks if a given value exists in the registry.iterator()keys()Retrieves a set of all the registry keys in the registry.voidRegisters a value to the registry, associating it with the given registry key.unregister(R registryKey) Unregisters a value from the registry, removing it associated with the given registry key.Retrieves the value associated with the given registry key, wrapped in anOptional.values()Retrieves a list of all the values in the registry.valuesByType(@NotNull Class<V> type) Retrieves a list of values of a specific type associated with the registry.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
AbstractRegistry
public AbstractRegistry()
-
-
Method Details
-
iterator
- Specified by:
iteratorin interfaceIterable<R extends RegistryKey>
-
register
Description copied from interface:RegistryRegisters a value to the registry, associating it with the given registry key.- Specified by:
registerin interfaceRegistry<R extends RegistryKey,T> - Parameters:
registryKey- the key to associate with the value.value- the value to register.
-
unregister
Description copied from interface:RegistryUnregisters a value from the registry, removing it associated with the given registry key.- Specified by:
unregisterin interfaceRegistry<R extends RegistryKey,T> - Parameters:
registryKey- the key whose associated value should be removed.- Returns:
- the removed value, or
nullif no value was associated with the key.
-
containsKey
Description copied from interface:RegistryChecks if a value exists in the registry for the given registry key.- Specified by:
containsKeyin interfaceRegistry<R extends RegistryKey,T> - Parameters:
registryKey- the key to check.- Returns:
trueif the key exists in the registry,falseotherwise.
-
containsValue
Description copied from interface:RegistryChecks if a given value exists in the registry.- Specified by:
containsValuein interfaceRegistry<R extends RegistryKey,T> - Parameters:
value- the value to check.- Returns:
trueif the value exists in the registry,falseotherwise.
-
value
Description copied from interface:RegistryRetrieves the value associated with the given registry key, wrapped in anOptional. -
valuesByType
Description copied from interface:RegistryRetrieves a list of values of a specific type associated with the registry.- Specified by:
valuesByTypein interfaceRegistry<R extends RegistryKey,T> - Type Parameters:
V- the type of the values to retrieve.- Parameters:
type- the class type of the values to retrieve.- Returns:
- a list of values that match the given type.
-
keys
Description copied from interface:RegistryRetrieves a set of all the registry keys in the registry. -
values
Description copied from interface:RegistryRetrieves a list of all the values in the registry.
-