Interface OutputFormatter.OutputConverter<T>

Type Parameters:
T - the output format type
All Known Implementing Classes:
ConverterToString, JsonOutputFormatter.JsonOutputConverter, ModelOutputConverter, TextLineFormatter.TextLineFormatterConverter
Enclosing interface:
OutputFormatter<T>

public static interface OutputFormatter.OutputConverter<T>
Converts primitive types to the output format. Must be stateless.
Author:
Holger Eichelberger, SSE
  • Method Summary

    Modifier and Type
    Method
    Description
    Converts data from BigDecimal to the output format.
    Converts data from BigInteger to the output format.
    fromBoolean(boolean data)
    Converts data from Boolean to the output format.
    fromByte(byte data)
    Converts data from byte to the output format.
    fromByteArray(byte[] data)
    Converts data from a byte array to the output format.
    fromDate(Date data, String format)
    Converts data from a date to the output format.
    fromDouble(double data)
    Converts data from double to the output format.
    fromDoubleArray(double[] data)
    Converts data from a double array to the output format.
    <E> T
    fromElementList(List<de.iip_ecosphere.platform.transport.serialization.QualifiedElement<E>> data)
    Converts data from an object the output format.
    default T
    fromEnum(de.iip_ecosphere.platform.transport.serialization.IipEnum data)
    Converts data from an IIP enum literal to the output format using IipEnum.getModelOrdinal().
    default T
    Converts data from an IIP enum literal to the output format using Enum.name().
    fromFloat(float data)
    Converts data from float to the output format.
    fromInteger(int data)
    Converts data from int to the output format.
    fromIntegerArray(int[] data)
    Converts data from an integer array to the output format.
    fromList(List<?> data)
    Converts data from an object the output format.
    default T
    Converts data from a date to the output format.
    fromLong(long data)
    Converts data from long to the output format.
    Converts data from an object the output format.
    fromShort(short data)
    Converts data from short to the output format.
    Converts data from String to the output format.
    Converts data from a string array to the output format.
  • Method Details

    • fromByte

      T fromByte(byte data) throws IOException
      Converts data from byte to the output format.
      Parameters:
      data - the data
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromInteger

      T fromInteger(int data) throws IOException
      Converts data from int to the output format.
      Parameters:
      data - the data
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromLong

      T fromLong(long data) throws IOException
      Converts data from long to the output format.
      Parameters:
      data - the data
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromString

      T fromString(String data) throws IOException
      Converts data from String to the output format.
      Parameters:
      data - the data
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromShort

      T fromShort(short data) throws IOException
      Converts data from short to the output format.
      Parameters:
      data - the data
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromDouble

      T fromDouble(double data) throws IOException
      Converts data from double to the output format.
      Parameters:
      data - the data
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromFloat

      T fromFloat(float data) throws IOException
      Converts data from float to the output format.
      Parameters:
      data - the data
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromBigInteger

      T fromBigInteger(BigInteger data) throws IOException
      Converts data from BigInteger to the output format.
      Parameters:
      data - the data
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromBigDecimal

      T fromBigDecimal(BigDecimal data) throws IOException
      Converts data from BigDecimal to the output format.
      Parameters:
      data - the data
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromBoolean

      T fromBoolean(boolean data) throws IOException
      Converts data from Boolean to the output format.
      Parameters:
      data - the data
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromIntegerArray

      T fromIntegerArray(int[] data) throws IOException
      Converts data from an integer array to the output format.
      Parameters:
      data - the data
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromDoubleArray

      T fromDoubleArray(double[] data) throws IOException
      Converts data from a double array to the output format.
      Parameters:
      data - the data
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromStringArray

      T fromStringArray(String[] data) throws IOException
      Converts data from a string array to the output format.
      Parameters:
      data - the data
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromByteArray

      T fromByteArray(byte[] data) throws IOException
      Converts data from a byte array to the output format.
      Parameters:
      data - the data
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromDate

      T fromDate(Date data, String format) throws IOException
      Converts data from a date to the output format.
      Parameters:
      data - the date
      format - the target date format (see SimpleDateFormat)
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromLocalDateTime

      default T fromLocalDateTime(LocalDateTime data, String format) throws IOException
      Converts data from a date to the output format.
      Parameters:
      data - the date
      format - the target date format (see SimpleDateFormat)
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromEnum

      default T fromEnum(de.iip_ecosphere.platform.transport.serialization.IipEnum data) throws IOException
      Converts data from an IIP enum literal to the output format using IipEnum.getModelOrdinal().
      Parameters:
      data - the data
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromEnumAsName

      default T fromEnumAsName(Enum<?> data) throws IOException
      Converts data from an IIP enum literal to the output format using Enum.name().
      Parameters:
      data - the data
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromList

      T fromList(List<?> data) throws IOException
      Converts data from an object the output format.
      Parameters:
      data - the data
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromElementList

      <E> T fromElementList(List<de.iip_ecosphere.platform.transport.serialization.QualifiedElement<E>> data) throws IOException
      Converts data from an object the output format.
      Type Parameters:
      E - the element type
      Parameters:
      data - the data
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails
    • fromObject

      T fromObject(Object data) throws IOException
      Converts data from an object the output format. [fallback dummy]
      Parameters:
      data - the data
      Returns:
      the converted output format
      Throws:
      IOException - if conversion fails