Package dev.enola.common.convert
Class ConverterIntoChain<I,O>
java.lang.Object
dev.enola.common.convert.ConverterIntoChain<I,O>
- All Implemented Interfaces:
ConverterInto<I,
O>
- Direct Known Subclasses:
ResourceConverterChain
A "chain" of
ConverterInto
s. It attempts the conversion in order until one is successful.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
convertInto
(I from, O into) Convert from an I into an O.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.enola.common.convert.ConverterInto
convertIntoOrThrow
-
Constructor Details
-
ConverterIntoChain
-
-
Method Details
-
convertInto
Description copied from interface:ConverterInto
Convert from an I into an O.- Specified by:
convertInto
in interfaceConverterInto<I,
O> - Parameters:
from
- the input to convertinto
- the destination where to output- Returns:
- true if conversion was successful, false if this converter cannot handle it; see
ConverterIntoChain
- Throws:
ConversionException
- in case of conversion problems or technical failures to read from I or write to OIOException
- TODO wrap IOException into ConversionException and remove throws
-