Class ConverterIntoChain<I,O>

java.lang.Object
dev.enola.common.convert.ConverterIntoChain<I,O>
All Implemented Interfaces:
ConverterInto<I,O>
Direct Known Subclasses:
ResourceConverterChain

public class ConverterIntoChain<I,O> extends Object implements ConverterInto<I,O>
A "chain" of ConverterIntos. It attempts the conversion in order until one is successful.
  • Constructor Details

  • Method Details

    • convertInto

      public boolean convertInto(I from, O into) throws ConversionException, IOException
      Description copied from interface: ConverterInto
      Convert from an I into an O.
      Specified by:
      convertInto in interface ConverterInto<I,O>
      Parameters:
      from - the input to convert
      into - 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 O
      IOException - TODO wrap IOException into ConversionException and remove throws