Package org.apache.ofbiz.base.conversion
Class MiscConverters.EnumToString
- java.lang.Object
-
- org.apache.ofbiz.base.conversion.AbstractConverter<java.lang.Enum<?>,java.lang.String>
-
- org.apache.ofbiz.base.conversion.MiscConverters.EnumToString
-
- All Implemented Interfaces:
Converter<java.lang.Enum<?>,java.lang.String>
,ConverterLoader
- Enclosing class:
- MiscConverters
public static class MiscConverters.EnumToString extends AbstractConverter<java.lang.Enum<?>,java.lang.String>
-
-
Constructor Summary
Constructors Constructor Description EnumToString()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canConvert(java.lang.Class<?> sourceClass, java.lang.Class<?> targetClass)
Returnstrue
if this object can convertsourceClass
totargetClass
.java.lang.String
convert(java.lang.Class<? extends java.lang.String> targetClass, java.lang.Enum<?> obj)
Convertsobj
toT
.java.lang.String
convert(java.lang.Enum<?> obj)
Convertsobj
toT
.java.lang.Class<? super java.lang.Enum<?>>
getSourceClass()
Returns the sourceClass
for this converter.-
Methods inherited from class org.apache.ofbiz.base.conversion.AbstractConverter
getTargetClass, loadConverters
-
-
-
-
Method Detail
-
canConvert
public boolean canConvert(java.lang.Class<?> sourceClass, java.lang.Class<?> targetClass)
Description copied from interface:Converter
Returnstrue
if this object can convertsourceClass
totargetClass
.Implementations can accomodate class hierarchy ranges by converting super classes or interfaces.
- Specified by:
canConvert
in interfaceConverter<java.lang.Enum<?>,java.lang.String>
- Overrides:
canConvert
in classAbstractConverter<java.lang.Enum<?>,java.lang.String>
- Parameters:
sourceClass
- The sourceClass
targetClass
- The targetClass
- Returns:
true
if this object can convertsourceClass
totargetClass
.
-
convert
public java.lang.String convert(java.lang.Enum<?> obj) throws ConversionException
Description copied from interface:Converter
Convertsobj
toT
.- Parameters:
obj
- The sourceObject
to convert- Returns:
- The converted
Object
- Throws:
ConversionException
-
convert
public java.lang.String convert(java.lang.Class<? extends java.lang.String> targetClass, java.lang.Enum<?> obj) throws ConversionException
Description copied from interface:Converter
Convertsobj
toT
.- Specified by:
convert
in interfaceConverter<java.lang.Enum<?>,java.lang.String>
- Overrides:
convert
in classAbstractConverter<java.lang.Enum<?>,java.lang.String>
- Parameters:
targetClass
- TheClass
to convert toobj
- The sourceObject
to convert- Returns:
- The converted
Object
- Throws:
ConversionException
-
getSourceClass
public java.lang.Class<? super java.lang.Enum<?>> getSourceClass()
Description copied from interface:Converter
Returns the sourceClass
for this converter.- Specified by:
getSourceClass
in interfaceConverter<java.lang.Enum<?>,java.lang.String>
- Overrides:
getSourceClass
in classAbstractConverter<java.lang.Enum<?>,java.lang.String>
- Returns:
- The source
Class
for this converter
-
-