Package ovh.mythmc.gestalt.features
Class FeatureConstructorParamsRegistry
java.lang.Object
ovh.mythmc.gestalt.features.FeatureConstructorParamsRegistry
Stores custom constructor parameters for
Feature-annotated classes
that cannot be instantiated with a no-arg constructor.
When a feature requires constructor arguments, the corresponding FeatureConstructorParams
should be registered here before the feature class is registered with
Gestalt. The parameters are keyed by fully qualified class name.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetParameters(@NotNull Class<?> clazz) Returns the constructor parameters registered for the specified class, ornullif none have been registered.getParameters(@NotNull String className) Returns the constructor parameters registered for the specified class name, ornullif none have been registered.voidregister(@NotNull Class<?> clazz, @Nullable FeatureConstructorParams params) Associates the given constructor parameters with the specified class.voidregister(@NotNull String className, @Nullable FeatureConstructorParams params) Associates the given constructor parameters with the specified class name.voidunregister(@NotNull Class<?> clazz) Removes the constructor parameters associated with the specified class.voidunregister(@NotNull String className) Removes the constructor parameters associated with the specified class name.
-
Constructor Details
-
FeatureConstructorParamsRegistry
public FeatureConstructorParamsRegistry()
-
-
Method Details
-
register
public void register(@NotNull @NotNull String className, @Nullable @Nullable FeatureConstructorParams params) Associates the given constructor parameters with the specified class name.- Parameters:
className- the fully qualified name of the feature classparams- the constructor parameters to store, ornullto clear them
-
register
public void register(@NotNull @NotNull Class<?> clazz, @Nullable @Nullable FeatureConstructorParams params) Associates the given constructor parameters with the specified class.- Parameters:
clazz- the feature classparams- the constructor parameters to store, ornullto clear them
-
unregister
Removes the constructor parameters associated with the specified class name.- Parameters:
className- the fully qualified name of the feature class
-
unregister
Removes the constructor parameters associated with the specified class.- Parameters:
clazz- the feature class
-
getParameters
Returns the constructor parameters registered for the specified class name, ornullif none have been registered.- Parameters:
className- the fully qualified name of the feature class- Returns:
- the registered constructor parameters, or
null
-
getParameters
Returns the constructor parameters registered for the specified class, ornullif none have been registered.- Parameters:
clazz- the feature class- Returns:
- the registered constructor parameters, or
null
-