Class ConverterFromString
java.lang.Object
de.iip_ecosphere.platform.connectors.parser.ConverterFromString
- All Implemented Interfaces:
InputParser.InputConverter<String>
- Direct Known Subclasses:
TextLineParser.TextLineParserConverter
A basic String to primitive types converter.
- Author:
- Holger Eichelberger, SSE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontoBigDecimal(String data) Converts parsed data returned byInputParser.ParseResultto aBigDecimal.toBigInteger(String data) Converts parsed data returned byInputParser.ParseResultto aBigInteger.booleanConverts parsed data returned byInputParser.ParseResultto Boolean.byteConverts parsed data returned byInputParser.ParseResultto byte.byte[]toByteArray(String data) Converts parsed data returned byInputParser.ParseResultto a byte array.doubleConverts parsed data returned byInputParser.ParseResultto double.double[]toDoubleArray(String data) Converts parsed data returned byInputParser.ParseResultto a double array.<E> List<de.iip_ecosphere.platform.transport.serialization.QualifiedElement<E>> toElementList(String data, Class<E> eltCls) Converts parsed data returned byInputParser.ParseResultto a list instance.floatConverts parsed data returned byInputParser.ParseResultto float.floattoFloatIndex(String data) Converts parsed index data returned byInputParser.ParseResultto float.intConverts parsed data returned byInputParser.ParseResultto integer.int[]toIntegerArray(String data) Converts parsed data returned byInputParser.ParseResultto an integer array.<E> List<E> Converts parsed data returned byInputParser.ParseResultto a list instance.longConverts parsed data returned byInputParser.ParseResultto long.longtoLongIndex(String 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(String data) Converts parsed data returned byInputParser.ParseResultto a String array.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.iip_ecosphere.platform.connectors.parser.InputParser.InputConverter
toDate, toEnum, toLocalDateTime
-
Constructor Details
-
ConverterFromString
public ConverterFromString()
-
-
Method Details
-
toInteger
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto integer.- Specified by:
toIntegerin interfaceInputParser.InputConverter<String>- Parameters:
data- the obtained data- Returns:
- the converted integer
- Throws:
IOException- if conversion fails
-
toByte
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto byte.- Specified by:
toBytein interfaceInputParser.InputConverter<String>- Parameters:
data- the obtained data- Returns:
- the converted integer
- Throws:
IOException- if conversion fails
-
toLong
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto long.- Specified by:
toLongin interfaceInputParser.InputConverter<String>- Parameters:
data- the obtained data- Returns:
- the converted long
- Throws:
IOException- if conversion fails
-
toString
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto String.- Specified by:
toStringin interfaceInputParser.InputConverter<String>- Parameters:
data- the obtained data- Returns:
- the converted String
- Throws:
IOException- if conversion fails
-
toDouble
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto double.- Specified by:
toDoublein interfaceInputParser.InputConverter<String>- Parameters:
data- the obtained data- Returns:
- the converted double
- Throws:
IOException- if conversion fails
-
toShort
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto short.- Specified by:
toShortin interfaceInputParser.InputConverter<String>- Parameters:
data- the obtained data- Returns:
- the converted long
- Throws:
IOException- if conversion fails
-
toFloat
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto float.- Specified by:
toFloatin interfaceInputParser.InputConverter<String>- Parameters:
data- the obtained data- Returns:
- the converted float
- Throws:
IOException- if conversion fails
-
toBoolean
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto Boolean.- Specified by:
toBooleanin interfaceInputParser.InputConverter<String>- Parameters:
data- the obtained data- Returns:
- the converted Boolean
- Throws:
IOException- if conversion fails
-
toIntegerArray
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto an integer array.- Specified by:
toIntegerArrayin interfaceInputParser.InputConverter<String>- Parameters:
data- the obtained data- Returns:
- the converted integer array
- Throws:
IOException- if conversion fails
-
toStringArray
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto a String array.- Specified by:
toStringArrayin interfaceInputParser.InputConverter<String>- Parameters:
data- the obtained data- Returns:
- the converted integer array
- Throws:
IOException- if conversion fails
-
toByteArray
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto a byte array.- Specified by:
toByteArrayin interfaceInputParser.InputConverter<String>- Parameters:
data- the obtained data- Returns:
- the converted double array
- Throws:
IOException- if conversion fails
-
toDoubleArray
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto a double array.- Specified by:
toDoubleArrayin interfaceInputParser.InputConverter<String>- Parameters:
data- the obtained data- Returns:
- the converted double array
- Throws:
IOException- if conversion fails
-
toObject
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto an object. [fallback dummy]- Specified by:
toObjectin interfaceInputParser.InputConverter<String>- Parameters:
data- the obtained data- Returns:
- the converted double array
- Throws:
IOException- if conversion fails
-
toList
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto a list instance.- Specified by:
toListin interfaceInputParser.InputConverter<String>- 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
public <E> List<de.iip_ecosphere.platform.transport.serialization.QualifiedElement<E>> toElementList(String data, Class<E> eltCls) throws IOException Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto a list instance.- Specified by:
toElementListin interfaceInputParser.InputConverter<String>- 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
-
toBigInteger
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto aBigInteger.- Specified by:
toBigIntegerin interfaceInputParser.InputConverter<String>- Parameters:
data- the obtained data- Returns:
- the converted
BigInteger - Throws:
IOException- if conversion fails
-
toBigDecimal
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto aBigDecimal.- Specified by:
toBigDecimalin interfaceInputParser.InputConverter<String>- Parameters:
data- the obtained data- Returns:
- the converted
BigDecimal - Throws:
IOException- if conversion fails
-
toLongIndex
Description copied from interface:InputParser.InputConverterConverts parsed index data returned byInputParser.ParseResultto long.- Specified by:
toLongIndexin interfaceInputParser.InputConverter<String>- Parameters:
data- the obtained data- Returns:
- the converted integer
- Throws:
IOException- if conversion fails
-
toFloatIndex
Description copied from interface:InputParser.InputConverterConverts parsed index data returned byInputParser.ParseResultto float.- Specified by:
toFloatIndexin interfaceInputParser.InputConverter<String>- Parameters:
data- the obtained data- Returns:
- the converted float
- Throws:
IOException- if conversion fails
-