Class ModelInputConverter
- java.lang.Object
-
- de.iip_ecosphere.platform.connectors.model.ModelInputConverter
-
- All Implemented Interfaces:
InputParser.InputConverter<java.lang.Object>
public class ModelInputConverter extends java.lang.Object implements InputParser.InputConverter<java.lang.Object>
Input converter implementing theModelAccessconversion conventions. An input converter forModelAccessshall allow for more homogeneous generated code compared toInputParser-based code. Moreover, this shall allow for encapsulating future changes to input/output conventions forModelAccess.- Author:
- Holger Eichelberger, SSE
-
-
Field Summary
Fields Modifier and Type Field Description static ModelInputConverterINSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description protectedModelInputConverter()Prevents external creation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleantoBoolean(java.lang.Object data)Converts parsed data returned byInputParser.ParseResultto Boolean.bytetoByte(java.lang.Object data)Converts parsed data returned byInputParser.ParseResultto byte.byte[]toByteArray(java.lang.Object data)Converts parsed data returned byInputParser.ParseResultto a byte array.doubletoDouble(java.lang.Object data)Converts parsed data returned byInputParser.ParseResultto double.double[]toDoubleArray(java.lang.Object data)Converts parsed data returned byInputParser.ParseResultto a double array.floattoFloat(java.lang.Object data)Converts parsed data returned byInputParser.ParseResultto float.inttoInteger(java.lang.Object data)Converts parsed data returned byInputParser.ParseResultto integer.int[]toIntegerArray(java.lang.Object data)Converts parsed data returned byInputParser.ParseResultto an integer array.longtoLong(java.lang.Object data)Converts parsed data returned byInputParser.ParseResultto long.java.lang.ObjecttoObject(java.lang.Object data)Converts parsed data returned byInputParser.ParseResultto an object.shorttoShort(java.lang.Object data)Converts parsed data returned byInputParser.ParseResultto short.java.lang.StringtoString(java.lang.Object data)Converts parsed data returned byInputParser.ParseResultto String.java.lang.String[]toStringArray(java.lang.Object 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
-
-
-
-
Field Detail
-
INSTANCE
public static final ModelInputConverter INSTANCE
-
-
Method Detail
-
toInteger
public int toInteger(java.lang.Object data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto integer.- Specified by:
toIntegerin interfaceInputParser.InputConverter<java.lang.Object>- Parameters:
data- the obtained data- Returns:
- the converted integer
- Throws:
java.io.IOException- if conversion fails
-
toByte
public byte toByte(java.lang.Object data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto byte.- Specified by:
toBytein interfaceInputParser.InputConverter<java.lang.Object>- Parameters:
data- the obtained data- Returns:
- the converted integer
- Throws:
java.io.IOException- if conversion fails
-
toLong
public long toLong(java.lang.Object data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto long.- Specified by:
toLongin interfaceInputParser.InputConverter<java.lang.Object>- Parameters:
data- the obtained data- Returns:
- the converted long
- Throws:
java.io.IOException- if conversion fails
-
toShort
public short toShort(java.lang.Object data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto short.- Specified by:
toShortin interfaceInputParser.InputConverter<java.lang.Object>- Parameters:
data- the obtained data- Returns:
- the converted long
- Throws:
java.io.IOException- if conversion fails
-
toString
public java.lang.String toString(java.lang.Object data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto String.- Specified by:
toStringin interfaceInputParser.InputConverter<java.lang.Object>- Parameters:
data- the obtained data- Returns:
- the converted String
- Throws:
java.io.IOException- if conversion fails
-
toDouble
public double toDouble(java.lang.Object data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto double.- Specified by:
toDoublein interfaceInputParser.InputConverter<java.lang.Object>- Parameters:
data- the obtained data- Returns:
- the converted double
- Throws:
java.io.IOException- if conversion fails
-
toFloat
public float toFloat(java.lang.Object data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto float.- Specified by:
toFloatin interfaceInputParser.InputConverter<java.lang.Object>- Parameters:
data- the obtained data- Returns:
- the converted float
- Throws:
java.io.IOException- if conversion fails
-
toBoolean
public boolean toBoolean(java.lang.Object data) throws java.io.IOExceptionDescription copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto Boolean.- Specified by:
toBooleanin interfaceInputParser.InputConverter<java.lang.Object>- Parameters:
data- the obtained data- Returns:
- the converted Boolean
- Throws:
java.io.IOException- if conversion fails
-
toIntegerArray
public int[] toIntegerArray(java.lang.Object 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.Object>- Parameters:
data- the obtained data- Returns:
- the converted integer array
- Throws:
java.io.IOException- if conversion fails
-
toDoubleArray
public double[] toDoubleArray(java.lang.Object 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.Object>- Parameters:
data- the obtained data- Returns:
- the converted double array
- Throws:
java.io.IOException- if conversion fails
-
toStringArray
public java.lang.String[] toStringArray(java.lang.Object 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.Object>- Parameters:
data- the obtained data- Returns:
- the converted integer array
- Throws:
java.io.IOException- if conversion fails
-
toByteArray
public byte[] toByteArray(java.lang.Object 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.Object>- 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.Object 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.Object>- Parameters:
data- the obtained data- Returns:
- the converted double array
- Throws:
java.io.IOException- if conversion fails
-
-