org.pfsw.bif.conversion
Interface IBidirectionalConverter<TInternal,TExternal>


public interface IBidirectionalConverter<TInternal,TExternal>

A general interface for converters that can do conversion from an internal object representation to an external representation and vice versa.


Method Summary
 TExternal toExternal(TInternal object)
          Converts the given internal object representation to its corresponding external representation.
 TInternal toInternal(TExternal object)
          Converts the given external object representation to its corresponding internal representation.
 

Method Detail

toInternal

TInternal toInternal(TExternal object)
                     throws ConversionRuntimeException
Converts the given external object representation to its corresponding internal representation.

Parameters:
object - The external representation of the object to convert (may be null).
Returns:
null (if given object was null) or the internal representation of the given object.
Throws:
ConversionRuntimeException - For any problem that prevented successful object conversion.

toExternal

TExternal toExternal(TInternal object)
                     throws ConversionRuntimeException
Converts the given internal object representation to its corresponding external representation.

Parameters:
object - The internal representation of the object to convert (may be null).
Returns:
null (if given object was null) or the external representation of the given object.
Throws:
ConversionRuntimeException - For any problem that prevented successful object conversion.