Class ConfigAdapters
java.lang.Object
dev.ua.theroer.magicutils.config.serialization.ConfigAdapters
Simple registry for config value adapters.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ConfigValueAdapter<T> Lookup adapter for a type.static Map<Class<?>, ConfigValueAdapter<?>> Provides read-only access to registered adapters.static booleanReturns true if an adapter is registered for the given type.static <T> voidregister(Class<T> type, ConfigValueAdapter<T> adapter) Register an adapter for the given type.
-
Method Details
-
register
Register an adapter for the given type.- Type Parameters:
T- target type- Parameters:
type- target classadapter- adapter implementation
-
get
Lookup adapter for a type.- Type Parameters:
T- target type- Parameters:
type- target class- Returns:
- adapter or null if not registered
-
has
Returns true if an adapter is registered for the given type.- Parameters:
type- class to check- Returns:
- true when present
-
getAdaptersView
Provides read-only access to registered adapters.- Returns:
- unmodifiable view of adapters map
-