org.cubeengine.converter.converter
Class EnumConverter
java.lang.Object
org.cubeengine.converter.converter.EnumConverter
- All Implemented Interfaces:
- ClassedConverter<Enum>, Converter<Enum,Class<? extends Enum>>
public class EnumConverter
- extends Object
- implements ClassedConverter<Enum>
A converter for generic enums
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EnumConverter
public EnumConverter()
toNode
public Node toNode(Enum object,
ConverterManager manager)
throws ConversionException
- Description copied from interface:
Converter
- Converts the object into a serializable Node
- Specified by:
toNode in interface Converter<Enum,Class<? extends Enum>>
- Parameters:
object - the object to convertmanager - the ConverterManager
- Returns:
- the converted object
- Throws:
ConversionException
fromNode
public Enum fromNode(Node node,
Class<? extends Enum> enumClass,
ConverterManager manager)
throws ConversionException
- Description copied from interface:
Converter
- Converts the node back into the original object
- Specified by:
fromNode in interface Converter<Enum,Class<? extends Enum>>
- Parameters:
node - the node to convertenumClass - the type to convert tomanager - the manager
- Returns:
- the converted node
- Throws:
ConversionException
Copyright © 2013–2017. All rights reserved.