Package dev.enola.common.convert
Interface ObjectWithTypeTokenConverter
- All Superinterfaces:
ConverterInto<ObjectWithTypeToken<?>,,MutableObjectWithTypeToken<?>> ObjectClassConverter<Object>
- All Known Implementing Classes:
IdentityObjectWithTypeConverter,ObjectWithTypeTokenConverterChain
public interface ObjectWithTypeTokenConverter
extends ObjectClassConverter<Object>, ConverterInto<ObjectWithTypeToken<?>,MutableObjectWithTypeToken<?>>
-
Method Summary
Modifier and TypeMethodDescriptionbooleanconvertInto(ObjectWithTypeToken<?> from, MutableObjectWithTypeToken<?> into) Convert from an I into an O.default <T> Optional<T> convertToType(Object input, Class<T> type) default <T> ObjectWithTypeToken<T> convertToTypeOrThrow(Object input, TypeToken<T> intoType) Methods inherited from interface dev.enola.common.convert.ConverterInto
convertIntoOrThrow
-
Method Details
-
convertInto
boolean convertInto(ObjectWithTypeToken<?> from, MutableObjectWithTypeToken<?> into) throws ConversionException, IOException Description copied from interface:ConverterIntoConvert from an I into an O.- Specified by:
convertIntoin interfaceConverterInto<ObjectWithTypeToken<?>,MutableObjectWithTypeToken<?>> - 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
-
convertToTypeOrThrow
default <T> ObjectWithTypeToken<T> convertToTypeOrThrow(Object input, TypeToken<T> intoType) throws ConversionException - Throws:
ConversionException
-
convertToType
- Specified by:
convertToTypein interfaceObjectClassConverter<Object>- Throws:
IOException
-