Class DefaultConverterManager
java.lang.Object
me.hsgamer.hscore.config.annotation.converter.manager.DefaultConverterManager
A manager to specify a default
Converter for a type-
Method Summary
Modifier and TypeMethodDescriptionstatic ConvertergetConverter(Type type) Get the converter for the typestatic ConvertergetConverterIfDefault(Type type, Class<? extends Converter> converterClass) Get the converter for the type if the given converter is the default onestatic ConvertergetConverterIfDefault(Type type, Converter converter) Get the converter for the type if the given converter is the default onestatic voidregisterConverter(Type type, Converter converter) Register the converter for the typestatic voidregisterProvider(ConverterProvider provider) Register a converter providerstatic voidunregisterConverter(Type type) Unregister the converter for the type
-
Method Details
-
registerProvider
Register a converter provider- Parameters:
provider- the provider
-
registerConverter
Register the converter for the type- Parameters:
type- the type classconverter- the converter
-
unregisterConverter
Unregister the converter for the type- Parameters:
type- the type
-
getConverterIfDefault
Get the converter for the type if the given converter is the default one- Parameters:
type- the typeconverter- the converter- Returns:
- the converter
-
getConverterIfDefault
Get the converter for the type if the given converter is the default one- Parameters:
type- the typeconverterClass- the class of the converter- Returns:
- the converter
-
getConverter
Get the converter for the type- Parameters:
type- the type- Returns:
- the converter
-