org.omnaest.utils.structure.element.converter
Class ElementConverterToBidirectionalConverterAdapter<FROM,TO>
java.lang.Object
org.omnaest.utils.structure.element.converter.ElementConverterToBidirectionalConverterAdapter<FROM,TO>
- Type Parameters:
FROM - TO -
- All Implemented Interfaces:
- Serializable, ElementBidirectionalConverter<FROM,TO>, ElementBidirectionalConverterSerializable<FROM,TO>, ElementConverter<FROM,TO>
public class ElementConverterToBidirectionalConverterAdapter<FROM,TO>
- extends Object
- implements ElementBidirectionalConverterSerializable<FROM,TO>
Adapter for two ElementConverter instances acting like an ElementBidirectionalConverter
If any given ElementConverter is null, the respective transformation direction will throw an
UnsupportedOperationException
- Author:
- Omnaest
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ElementConverterToBidirectionalConverterAdapter
public ElementConverterToBidirectionalConverterAdapter(ElementConverter<FROM,TO> elementConverter,
ElementConverter<TO,FROM> elementConverterReverse)
- Parameters:
elementConverter - elementConverterReverse - - See Also:
ElementConverterToBidirectionalConverterAdapter
convertBackwards
public FROM convertBackwards(TO element)
- Description copied from interface:
ElementBidirectionalConverter
- Converts an element in backwards way
- Specified by:
convertBackwards in interface ElementBidirectionalConverter<FROM,TO>
- Returns:
convert
public TO convert(FROM element)
- Description copied from interface:
ElementConverter
- Transforms a single element from one type into another.
- Specified by:
convert in interface ElementConverter<FROM,TO>
- Returns:
- converted element
Copyright © 2013. All Rights Reserved.