Class ConverterFromString
- java.lang.Object
-
- de.iip_ecosphere.platform.connectors.parser.ConverterFromString
-
- All Implemented Interfaces:
InputParser.InputConverter<java.lang.String>
- Direct Known Subclasses:
TextLineParser.TextLineParserConverter
public class ConverterFromString extends java.lang.Object implements InputParser.InputConverter<java.lang.String>
A basic String to primitive types converter.- Author:
- Holger Eichelberger, SSE
-
-
Constructor Summary
Constructors Constructor Description ConverterFromString()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleantoBoolean(java.lang.String data)Converts parsed data returned byInputParser.ParseResultto Boolean.bytetoByte(java.lang.String data)Converts parsed data returned byInputParser.ParseResultto byte.byte[]toByteArray(java.lang.String data)Converts parsed data returned byInputParser.ParseResultto a byte array.doubletoDouble(java.lang.String data)Converts parsed data returned byInputParser.ParseResultto double.double[]toDoubleArray(java.lang.String data)Converts parsed data returned byInputParser.ParseResultto a double array.floattoFloat(java.lang.String data)Converts parsed data returned byInputParser.ParseResultto float.inttoInteger(java.lang.String data)Converts parsed data returned byInputParser.ParseResultto integer.int[]toIntegerArray(java.lang.String data)Converts parsed data returned byInputParser.ParseResultto an integer array.longtoLong(java.lang.String data)Converts parsed data returned byInputParser.ParseResultto long.java.lang.ObjecttoObject(java.lang.String data)Converts parsed data returned byInputParser.ParseResultto an object.shorttoShort(java.lang.String data)Converts parsed data returned byInputParser.ParseResultto short.java.lang.StringtoString(java.lang.String data)Converts parsed data returned byInputParser.ParseResultto String.java.lang.String[]toStringArray(java.lang.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, wait
-
Methods inherited from interface de.iip_ecosphere.platform.connectors.parser.InputParser.InputConverter
toDate, toEnum, toLocalDateTime
-
-
-
-
Method Detail
-
toInteger
public int toInteger(java.lang.String data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto integer.- Specified by:
toIntegerin interfaceInputParser.InputConverter<java.lang.String>- Parameters:
data- the obtained data- Returns:
- the converted integer
- Throws:
java.io.IOException- if conversion fails
-
toByte
public byte toByte(java.lang.String data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto byte.- Specified by:
toBytein interfaceInputParser.InputConverter<java.lang.String>- Parameters:
data- the obtained data- Returns:
- the converted integer
- Throws:
java.io.IOException- if conversion fails
-
toLong
public long toLong(java.lang.String data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto long.- Specified by:
toLongin interfaceInputParser.InputConverter<java.lang.String>- Parameters:
data- the obtained data- Returns:
- the converted long
- Throws:
java.io.IOException- if conversion fails
-
toString
public java.lang.String toString(java.lang.String data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto String.- Specified by:
toStringin interfaceInputParser.InputConverter<java.lang.String>- Parameters:
data- the obtained data- Returns:
- the converted String
- Throws:
java.io.IOException- if conversion fails
-
toDouble
public double toDouble(java.lang.String data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto double.- Specified by:
toDoublein interfaceInputParser.InputConverter<java.lang.String>- Parameters:
data- the obtained data- Returns:
- the converted double
- Throws:
java.io.IOException- if conversion fails
-
toShort
public short toShort(java.lang.String data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto short.- Specified by:
toShortin interfaceInputParser.InputConverter<java.lang.String>- Parameters:
data- the obtained data- Returns:
- the converted long
- Throws:
java.io.IOException- if conversion fails
-
toFloat
public float toFloat(java.lang.String data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto float.- Specified by:
toFloatin interfaceInputParser.InputConverter<java.lang.String>- Parameters:
data- the obtained data- Returns:
- the converted float
- Throws:
java.io.IOException- if conversion fails
-
toBoolean
public boolean toBoolean(java.lang.String data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto Boolean.- Specified by:
toBooleanin interfaceInputParser.InputConverter<java.lang.String>- Parameters:
data- the obtained data- Returns:
- the converted Boolean
- Throws:
java.io.IOException- if conversion fails
-
toIntegerArray
public int[] toIntegerArray(java.lang.String data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto an integer array.- Specified by:
toIntegerArrayin interfaceInputParser.InputConverter<java.lang.String>- Parameters:
data- the obtained data- Returns:
- the converted integer array
- Throws:
java.io.IOException- if conversion fails
-
toStringArray
public java.lang.String[] toStringArray(java.lang.String data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto a String array.- Specified by:
toStringArrayin interfaceInputParser.InputConverter<java.lang.String>- Parameters:
data- the obtained data- Returns:
- the converted integer array
- Throws:
java.io.IOException- if conversion fails
-
toByteArray
public byte[] toByteArray(java.lang.String data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto a byte array.- Specified by:
toByteArrayin interfaceInputParser.InputConverter<java.lang.String>- Parameters:
data- the obtained data- Returns:
- the converted double array
- Throws:
java.io.IOException- if conversion fails
-
toDoubleArray
public double[] toDoubleArray(java.lang.String data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto a double array.- Specified by:
toDoubleArrayin interfaceInputParser.InputConverter<java.lang.String>- Parameters:
data- the obtained data- Returns:
- the converted double array
- Throws:
java.io.IOException- if conversion fails
-
toObject
public java.lang.Object toObject(java.lang.String data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto an object. [fallback dummy]- Specified by:
toObjectin interfaceInputParser.InputConverter<java.lang.String>- Parameters:
data- the obtained data- Returns:
- the converted double array
- Throws:
java.io.IOException- if conversion fails
-
-