Package cdc.converters.defaults
Class EnumToString<E extends Enum<?>>
- java.lang.Object
-
- cdc.converters.AbstractConverter<S,T>
-
- cdc.converters.AbstractNoArgsConverter<E,String>
-
- cdc.converters.defaults.EnumToString<E>
-
- Type Parameters:
E- The enum type.
public class EnumToString<E extends Enum<?>> extends AbstractNoArgsConverter<E,String>
Class that can convert any enum type to a string.It is possible to specialize this class for a specific enum type.
This is not necessary as this class can convert any enum to a string.- Author:
- Damien Carbonne
-
-
Field Summary
Fields Modifier and Type Field Description static Factory<EnumToString<Enum<?>>>FACTORYstatic EnumToString<Enum<?>>INSTANCE-
Fields inherited from interface cdc.converters.Converter
META_FARGS, SOURCE_CLASS, TARGET_CLASS
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedEnumToString(Class<E> targetClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringapply(E source)-
Methods inherited from class cdc.converters.AbstractNoArgsConverter
getParams
-
Methods inherited from class cdc.converters.AbstractConverter
getSourceClass, getTargetClass, getWrappedSourceClass, getWrappedTargetClass, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface cdc.converters.Converter
adapt, andThen, andThenRaw, applyRaw, areCompliantSourceAndTargetClasses, areMatchingSourceAndTargetClasses, cast, compose, composeRaw, isCompliantSourceClass, isCompliantTargetClass, isMatchingSourceClass, isMatchingTargetClass, orElse, orElseRaw
-
-
-
-
Field Detail
-
INSTANCE
public static final EnumToString<Enum<?>> INSTANCE
-
FACTORY
public static final Factory<EnumToString<Enum<?>>> FACTORY
-
-