Class DefaultConverterManager

java.lang.Object
me.hsgamer.hscore.config.annotation.converter.manager.DefaultConverterManager

public final class DefaultConverterManager extends Object
A manager to specify a default Converter for a type class
  • Method Details

    • registerConverter

      public static void registerConverter(Class<?> clazz, Converter converter)
      Register the converter for the type class
      Parameters:
      clazz - the type class
      converter - the converter
    • unregisterConverter

      public static void unregisterConverter(Class<?> clazz)
      Unregister the converter for the type class
      Parameters:
      clazz - the type class
    • getConverterIfDefault

      public static Converter getConverterIfDefault(Class<?> clazz, Converter converter)
      Get the converter for the type class if the given converter is the default one
      Parameters:
      clazz - the type class
      converter - the converter
      Returns:
      the converter
    • getConverterIfDefault

      public static Converter getConverterIfDefault(Class<?> clazz, Class<? extends Converter> converterClass)
      Get the converter for the type class if the given converter is the default one
      Parameters:
      clazz - the type class
      converterClass - the class of the converter
      Returns:
      the converter
    • getConverter

      public static Converter getConverter(Class<?> clazz)
      Get the converter for the type class
      Parameters:
      clazz - the type class
      Returns:
      the converter