Class ConfigAdapters

java.lang.Object
dev.ua.theroer.magicutils.config.serialization.ConfigAdapters

public final class ConfigAdapters extends Object
Simple registry for config value adapters.
  • Method Details

    • register

      public static <T> void register(Class<T> type, ConfigValueAdapter<T> adapter)
      Register an adapter for the given type.
      Type Parameters:
      T - target type
      Parameters:
      type - target class
      adapter - adapter implementation
    • get

      public static <T> ConfigValueAdapter<T> get(Class<T> type)
      Lookup adapter for a type.
      Type Parameters:
      T - target type
      Parameters:
      type - target class
      Returns:
      adapter or null if not registered
    • has

      public static boolean has(Class<?> type)
      Returns true if an adapter is registered for the given type.
      Parameters:
      type - class to check
      Returns:
      true when present
    • getAdaptersView

      public static Map<Class<?>, ConfigValueAdapter<?>> getAdaptersView()
      Provides read-only access to registered adapters.
      Returns:
      unmodifiable view of adapters map