Package dev.enola.common.convert
Interface ObjectToStringBiConverter<T>
- Type Parameters:
T- the type of objects to convert
- All Superinterfaces:
BiConverter<T,,String> ConverterInto<T,,Appendable> ConverterIntoAppendable<T>,ObjectClassConverter<T>
- All Known Subinterfaces:
IdConverter<I>
- All Known Implementing Classes:
IdConverterChain,ObjectToStringBiConverterWithFormat,ObjectToStringWithToStringBiConverter,TemporalAccessorToStringConverter
@Immutable
public interface ObjectToStringBiConverter<T>
extends BiConverter<T,String>, ConverterIntoAppendable<T>, ObjectClassConverter<T>
Converts objects of type T to & from String, if it can.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanconvertInto(T from, Appendable into) Convert from an I into an O.default <X> Optional<X> convertObjectToType(Object input, Class<X> type) default <X> Optional<X> convertToType(T input, Class<X> type) Methods inherited from interface dev.enola.common.convert.BiConverter
convertFrom, convertToMethods inherited from interface dev.enola.common.convert.ConverterInto
convertIntoOrThrow
-
Method Details
-
convertInto
Description copied from interface:ConverterIntoConvert from an I into an O.- Specified by:
convertIntoin interfaceConverterInto<T,Appendable> - Specified by:
convertIntoin interfaceConverterIntoAppendable<T>- 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
-
convertToType
- Specified by:
convertToTypein interfaceObjectClassConverter<T>- Throws:
IOException
-
convertObjectToType
- Throws:
IOException
-