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 Converter
getConverter
(Type type) Get the converter for the typestatic Converter
getConverterIfDefault
(Type type, Class<? extends Converter> converterClass) Get the converter for the type if the given converter is the default onestatic Converter
getConverterIfDefault
(Type type, Converter converter) Get the converter for the type if the given converter is the default onestatic void
registerConverter
(Type type, Converter converter) Register the converter for the typestatic void
registerProvider
(ConverterProvider provider) Register a converter providerstatic void
unregisterConverter
(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
-