org.cubeengine.converter.converter
Class SimpleConverter<ConvertT>

java.lang.Object
  extended by org.cubeengine.converter.converter.SimpleConverter<ConvertT>
All Implemented Interfaces:
ClassedConverter<ConvertT>, Converter<ConvertT,Class<? extends ConvertT>>
Direct Known Subclasses:
BooleanConverter, ByteConverter, ClassConverter, DateConverter, DoubleConverter, FileConverter, FloatConverter, IntegerConverter, LevelConverter, LocaleConverter, LongConverter, ShortConverter, StringConverter, UUIDConverter

public abstract class SimpleConverter<ConvertT>
extends Object
implements ClassedConverter<ConvertT>

A simple Converter for a single Class


Constructor Summary
SimpleConverter()
           
 
Method Summary
abstract  ConvertT fromNode(Node node)
          Converts the node back into the original object
 ConvertT fromNode(Node node, Class<? extends ConvertT> type, ConverterManager manager)
          Converts the node back into the original object
abstract  Node toNode(ConvertT object)
          Converts the object into a serializable Node
 Node toNode(ConvertT 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

SimpleConverter

public SimpleConverter()
Method Detail

toNode

public final Node toNode(ConvertT object,
                         ConverterManager manager)
                  throws ConversionException
Description copied from interface: Converter
Converts the object into a serializable Node

Specified by:
toNode in interface Converter<ConvertT,Class<? extends ConvertT>>
Parameters:
object - the object to convert
manager - the ConverterManager
Returns:
the converted object
Throws:
ConversionException

fromNode

public final ConvertT fromNode(Node node,
                               Class<? extends ConvertT> type,
                               ConverterManager manager)
                        throws ConversionException
Description copied from interface: Converter
Converts the node back into the original object

Specified by:
fromNode in interface Converter<ConvertT,Class<? extends ConvertT>>
Parameters:
node - the node to convert
type - the type to convert to
manager - the manager
Returns:
the converted node
Throws:
ConversionException

toNode

public abstract Node toNode(ConvertT object)
                     throws ConversionException
Converts the object into a serializable Node

Parameters:
object - the object to convert
Returns:
the converted object
Throws:
ConversionException

fromNode

public abstract ConvertT fromNode(Node node)
                           throws ConversionException
Converts the node back into the original object

Parameters:
node - the node to convert
Returns:
the converted node
Throws:
ConversionException


Copyright © 2013–2017. All rights reserved.