org.cubeengine.converter.converter
Class EnumConverter

java.lang.Object
  extended by 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


Constructor Summary
EnumConverter()
           
 
Method Summary
 Enum fromNode(Node node, Class<? extends Enum> enumClass, ConverterManager manager)
          Converts the node back into the original object
 Node toNode(Enum object, ConverterManager manager)
          Converts the object into a serializable Node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumConverter

public EnumConverter()
Method Detail

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 convert
manager - 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 convert
enumClass - the type to convert to
manager - the manager
Returns:
the converted node
Throws:
ConversionException


Copyright © 2013–2017. All rights reserved.