Interface InputParser.InputConverter<T>
- Type Parameters:
T- the type of data produced by parsing
- All Known Implementing Classes:
ConverterFromString,JsonInputParser.JsonInputConverter,ModelInputConverter,TextLineParser.TextLineParserConverter
- Enclosing interface:
InputParser<T>
public static interface InputParser.InputConverter<T>
Converts parsed data to primitive types. Implementations must be stateless.
- Author:
- Holger Eichelberger, SSE
-
Method Summary
Modifier and TypeMethodDescriptiontoBigDecimal(T data) Converts parsed data returned byInputParser.ParseResultto aBigDecimal.toBigInteger(T data) Converts parsed data returned byInputParser.ParseResultto aBigInteger.booleanConverts parsed data returned byInputParser.ParseResultto Boolean.byteConverts parsed data returned byInputParser.ParseResultto byte.byte[]toByteArray(T data) Converts parsed data returned byInputParser.ParseResultto a byte array.default DateConverts parsed data returned byInputParser.ParseResultto a date representation.doubleConverts parsed data returned byInputParser.ParseResultto double.double[]toDoubleArray(T data) Converts parsed data returned byInputParser.ParseResultto a double array.<E> List<de.iip_ecosphere.platform.transport.serialization.QualifiedElement<E>> toElementList(T data, Class<E> eltCls) Converts parsed data returned byInputParser.ParseResultto a list instance.default <E extends Enum<E> & de.iip_ecosphere.platform.transport.serialization.IipEnum>
EConverts parsed data returned byInputParser.ParseResultto an instance ofenumType.floatConverts parsed data returned byInputParser.ParseResultto float.floattoFloatIndex(T data) Converts parsed index data returned byInputParser.ParseResultto float.intConverts parsed data returned byInputParser.ParseResultto integer.int[]toIntegerArray(T data) Converts parsed data returned byInputParser.ParseResultto an integer array.<E> List<E> Converts parsed data returned byInputParser.ParseResultto a list instance.default LocalDateTimetoLocalDateTime(T data, String format) Converts parsed data returned byInputParser.ParseResultto a date representation.longConverts parsed data returned byInputParser.ParseResultto long.longtoLongIndex(T data) Converts parsed index data returned byInputParser.ParseResultto long.Converts parsed data returned byInputParser.ParseResultto an object.shortConverts parsed data returned byInputParser.ParseResultto short.Converts parsed data returned byInputParser.ParseResultto String.String[]toStringArray(T data) Converts parsed data returned byInputParser.ParseResultto a String array.
-
Method Details
-
toByte
Converts parsed data returned byInputParser.ParseResultto byte.- Parameters:
data- the obtained data- Returns:
- the converted integer
- Throws:
IOException- if conversion fails
-
toInteger
Converts parsed data returned byInputParser.ParseResultto integer.- Parameters:
data- the obtained data- Returns:
- the converted integer
- Throws:
IOException- if conversion fails
-
toLong
Converts parsed data returned byInputParser.ParseResultto long.- Parameters:
data- the obtained data- Returns:
- the converted long
- Throws:
IOException- if conversion fails
-
toShort
Converts parsed data returned byInputParser.ParseResultto short.- Parameters:
data- the obtained data- Returns:
- the converted long
- Throws:
IOException- if conversion fails
-
toString
Converts parsed data returned byInputParser.ParseResultto String.- Parameters:
data- the obtained data- Returns:
- the converted String
- Throws:
IOException- if conversion fails
-
toDouble
Converts parsed data returned byInputParser.ParseResultto double.- Parameters:
data- the obtained data- Returns:
- the converted double
- Throws:
IOException- if conversion fails
-
toFloat
Converts parsed data returned byInputParser.ParseResultto float.- Parameters:
data- the obtained data- Returns:
- the converted float
- Throws:
IOException- if conversion fails
-
toBigInteger
Converts parsed data returned byInputParser.ParseResultto aBigInteger.- Parameters:
data- the obtained data- Returns:
- the converted
BigInteger - Throws:
IOException- if conversion fails
-
toBigDecimal
Converts parsed data returned byInputParser.ParseResultto aBigDecimal.- Parameters:
data- the obtained data- Returns:
- the converted
BigDecimal - Throws:
IOException- if conversion fails
-
toBoolean
Converts parsed data returned byInputParser.ParseResultto Boolean.- Parameters:
data- the obtained data- Returns:
- the converted Boolean
- Throws:
IOException- if conversion fails
-
toIntegerArray
Converts parsed data returned byInputParser.ParseResultto an integer array.- Parameters:
data- the obtained data- Returns:
- the converted integer array
- Throws:
IOException- if conversion fails
-
toStringArray
Converts parsed data returned byInputParser.ParseResultto a String array.- Parameters:
data- the obtained data- Returns:
- the converted integer array
- Throws:
IOException- if conversion fails
-
toDoubleArray
Converts parsed data returned byInputParser.ParseResultto a double array.- Parameters:
data- the obtained data- Returns:
- the converted double array
- Throws:
IOException- if conversion fails
-
toByteArray
Converts parsed data returned byInputParser.ParseResultto a byte array.- Parameters:
data- the obtained data- Returns:
- the converted double array
- Throws:
IOException- if conversion fails
-
toDate
Converts parsed data returned byInputParser.ParseResultto a date representation.- Parameters:
data- the obtained dataformat- the target date format (seeTimeUtils)- Returns:
- the converted date
- Throws:
IOException- if conversion fails
-
toLocalDateTime
Converts parsed data returned byInputParser.ParseResultto a date representation.- Parameters:
data- the obtained dataformat- the target date format (seeTimeUtils)- Returns:
- the converted date
- Throws:
IOException- if conversion fails
-
toEnum
default <E extends Enum<E> & de.iip_ecosphere.platform.transport.serialization.IipEnum> E toEnum(T data, Class<E> enumType) throws IOException Converts parsed data returned byInputParser.ParseResultto an instance ofenumType. Primarily, a conversion totoInteger(Object)andIipEnum.getModelOrdinal()is performed. If this fails, a name-based enum conversion is applied.- Type Parameters:
E- the enum type- Parameters:
data- the obtained dataenumType- enumeration target type- Returns:
- the converted enum instance
- Throws:
IOException- if the conversion fails
-
toList
Converts parsed data returned byInputParser.ParseResultto a list instance.- Type Parameters:
E- the element type- Parameters:
data- the obtained dataeltCls- the element type class- Returns:
- the converted list instance
- Throws:
IOException- if the conversion fails
-
toElementList
<E> List<de.iip_ecosphere.platform.transport.serialization.QualifiedElement<E>> toElementList(T data, Class<E> eltCls) throws IOException Converts parsed data returned byInputParser.ParseResultto a list instance.- Type Parameters:
E- the element type- Parameters:
data- the obtained dataeltCls- the element type class- Returns:
- the converted list instance
- Throws:
IOException- if the conversion fails
-
toObject
Converts parsed data returned byInputParser.ParseResultto an object. [fallback dummy]- Parameters:
data- the obtained data- Returns:
- the converted double array
- Throws:
IOException- if conversion fails
-
toLongIndex
Converts parsed index data returned byInputParser.ParseResultto long.- Parameters:
data- the obtained data- Returns:
- the converted integer
- Throws:
IOException- if conversion fails
-
toFloatIndex
Converts parsed index data returned byInputParser.ParseResultto float.- Parameters:
data- the obtained data- Returns:
- the converted float
- Throws:
IOException- if conversion fails
-