Class DefaultConverterManager
java.lang.Object
me.hsgamer.hscore.config.annotation.converter.manager.DefaultConverterManager
A manager to specify a default
Converter for a type class-
Method Summary
Modifier and TypeMethodDescriptionstatic ConvertergetConverter(Class<?> clazz) Get the converter for the type classstatic ConvertergetConverterIfDefault(Class<?> clazz, Class<? extends Converter> converterClass) Get the converter for the type class if the given converter is the default onestatic ConvertergetConverterIfDefault(Class<?> clazz, Converter converter) Get the converter for the type class if the given converter is the default onestatic voidregisterConverter(Class<?> clazz, Converter converter) Register the converter for the type classstatic voidunregisterConverter(Class<?> clazz) Unregister the converter for the type class
-
Method Details
-
registerConverter
Register the converter for the type class- Parameters:
clazz- the type classconverter- the converter
-
unregisterConverter
Unregister the converter for the type class- Parameters:
clazz- the type class
-
getConverterIfDefault
Get the converter for the type class if the given converter is the default one- Parameters:
clazz- the type classconverter- 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 classconverterClass- the class of the converter- Returns:
- the converter
-
getConverter
Get the converter for the type class- Parameters:
clazz- the type class- Returns:
- the converter
-