Class ConverterToString
- java.lang.Object
-
- de.iip_ecosphere.platform.connectors.formatter.ConverterToString
-
- All Implemented Interfaces:
OutputFormatter.OutputConverter<java.lang.String>
- Direct Known Subclasses:
TextLineFormatter.TextLineFormatterConverter
public class ConverterToString extends java.lang.Object implements OutputFormatter.OutputConverter<java.lang.String>
Converts primitive data to string format.- Author:
- Holger Eichelberger, SSE
-
-
Constructor Summary
Constructors Constructor Description ConverterToString()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringfromBoolean(boolean data)Converts data from Boolean to the output format.java.lang.StringfromByte(byte data)Converts data from byte to the output format.java.lang.StringfromByteArray(byte[] data)Converts data from a byte array to the output format.java.lang.StringfromDate(java.util.Date data, java.lang.String format)Converts data from a date to the output format.java.lang.StringfromDouble(double data)Converts data from double to the output format.java.lang.StringfromDoubleArray(double[] data)Converts data from a double array to the output format.java.lang.StringfromFloat(float data)Converts data from float to the output format.java.lang.StringfromInteger(int data)Converts data from int to the output format.java.lang.StringfromIntegerArray(int[] data)Converts data from an integer array to the output format.java.lang.StringfromLong(long data)Converts data from long to the output format.java.lang.StringfromObject(java.lang.Object data)Converts data from an object the output format.java.lang.StringfromShort(short data)Converts data from short to the output format.java.lang.StringfromString(java.lang.String data)Converts data from String to the output format.java.lang.StringfromStringArray(java.lang.String[] data)Converts data from a string array to the output format.-
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.formatter.OutputFormatter.OutputConverter
fromEnum, fromEnumAsName, fromLocalDateTime
-
-
-
-
Method Detail
-
fromInteger
public java.lang.String fromInteger(int data) throws java.io.IOExceptionDescription copied from interface:OutputFormatter.OutputConverterConverts data from int to the output format.- Specified by:
fromIntegerin interfaceOutputFormatter.OutputConverter<java.lang.String>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
java.io.IOException- if conversion fails
-
fromByte
public java.lang.String fromByte(byte data) throws java.io.IOExceptionDescription copied from interface:OutputFormatter.OutputConverterConverts data from byte to the output format.- Specified by:
fromBytein interfaceOutputFormatter.OutputConverter<java.lang.String>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
java.io.IOException- if conversion fails
-
fromLong
public java.lang.String fromLong(long data) throws java.io.IOExceptionDescription copied from interface:OutputFormatter.OutputConverterConverts data from long to the output format.- Specified by:
fromLongin interfaceOutputFormatter.OutputConverter<java.lang.String>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
java.io.IOException- if conversion fails
-
fromShort
public java.lang.String fromShort(short data) throws java.io.IOExceptionDescription copied from interface:OutputFormatter.OutputConverterConverts data from short to the output format.- Specified by:
fromShortin interfaceOutputFormatter.OutputConverter<java.lang.String>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
java.io.IOException- if conversion fails
-
fromString
public java.lang.String fromString(java.lang.String data) throws java.io.IOExceptionDescription copied from interface:OutputFormatter.OutputConverterConverts data from String to the output format.- Specified by:
fromStringin interfaceOutputFormatter.OutputConverter<java.lang.String>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
java.io.IOException- if conversion fails
-
fromDouble
public java.lang.String fromDouble(double data) throws java.io.IOExceptionDescription copied from interface:OutputFormatter.OutputConverterConverts data from double to the output format.- Specified by:
fromDoublein interfaceOutputFormatter.OutputConverter<java.lang.String>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
java.io.IOException- if conversion fails
-
fromFloat
public java.lang.String fromFloat(float data) throws java.io.IOExceptionDescription copied from interface:OutputFormatter.OutputConverterConverts data from float to the output format.- Specified by:
fromFloatin interfaceOutputFormatter.OutputConverter<java.lang.String>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
java.io.IOException- if conversion fails
-
fromBoolean
public java.lang.String fromBoolean(boolean data) throws java.io.IOExceptionDescription copied from interface:OutputFormatter.OutputConverterConverts data from Boolean to the output format.- Specified by:
fromBooleanin interfaceOutputFormatter.OutputConverter<java.lang.String>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
java.io.IOException- if conversion fails
-
fromIntegerArray
public java.lang.String fromIntegerArray(int[] data) throws java.io.IOExceptionDescription copied from interface:OutputFormatter.OutputConverterConverts data from an integer array to the output format.- Specified by:
fromIntegerArrayin interfaceOutputFormatter.OutputConverter<java.lang.String>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
java.io.IOException- if conversion fails
-
fromDoubleArray
public java.lang.String fromDoubleArray(double[] data) throws java.io.IOExceptionDescription copied from interface:OutputFormatter.OutputConverterConverts data from a double array to the output format.- Specified by:
fromDoubleArrayin interfaceOutputFormatter.OutputConverter<java.lang.String>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
java.io.IOException- if conversion fails
-
fromStringArray
public java.lang.String fromStringArray(java.lang.String[] data) throws java.io.IOExceptionDescription copied from interface:OutputFormatter.OutputConverterConverts data from a string array to the output format.- Specified by:
fromStringArrayin interfaceOutputFormatter.OutputConverter<java.lang.String>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
java.io.IOException- if conversion fails
-
fromByteArray
public java.lang.String fromByteArray(byte[] data) throws java.io.IOExceptionDescription copied from interface:OutputFormatter.OutputConverterConverts data from a byte array to the output format.- Specified by:
fromByteArrayin interfaceOutputFormatter.OutputConverter<java.lang.String>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
java.io.IOException- if conversion fails
-
fromObject
public java.lang.String fromObject(java.lang.Object data) throws java.io.IOExceptionDescription copied from interface:OutputFormatter.OutputConverterConverts data from an object the output format. [fallback dummy]- Specified by:
fromObjectin interfaceOutputFormatter.OutputConverter<java.lang.String>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
java.io.IOException- if conversion fails
-
fromDate
public java.lang.String fromDate(java.util.Date data, java.lang.String format) throws java.io.IOExceptionDescription copied from interface:OutputFormatter.OutputConverterConverts data from a date to the output format.- Specified by:
fromDatein interfaceOutputFormatter.OutputConverter<java.lang.String>- Parameters:
data- the dateformat- the target date format (seeSimpleDateFormat)- Returns:
- the converted output format
- Throws:
java.io.IOException- if conversion fails
-
-