java.lang.Object
java.lang.Enum<Type>
io.openems.backend.timedata.timescaledb.internal.Type
All Implemented Interfaces:
Serializable, Comparable<Type>, Constable

public enum Type extends Enum<Type>
  • Enum Constant Details

    • INTEGER

      public static final Type INTEGER
    • FLOAT

      public static final Type FLOAT
    • STRING

      public static final Type STRING
  • Field Details

    • id

      public final int id
    • sqlDataType

      public final String sqlDataType
    • defaultAggregateFunction

      public final String defaultAggregateFunction
    • aggregateFunctions

      public final String[] aggregateFunctions
  • Method Details

    • values

      public static Type[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Type valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getRawTableName

      public String getRawTableName(Priority priority)
      Gets the raw table name of the type and the specified priority.
      Parameters:
      priority - the priority of the table
      Returns:
      the table name
    • getAggregate5mTableName

      public String getAggregate5mTableName(Priority priority)
      Gets the aggregate table name of the current type and the specified priority.
      Parameters:
      priority - the priority of the table
      Returns:
      the table name
    • fillRow

      public Consumer<de.bytefish.pgbulkinsert.row.SimpleRow> fillRow(Point point)
      Fills a PgBulkInsert Row-Writer with data (timestamp, channel_id and value).
      Parameters:
      point - the Point holding data
      Returns:
      a Consumer as required by SimpleRowWriter.startRow(Consumer)
      Throws:
      Exception - on error
    • parseValueFromResultSet

      public com.google.gson.JsonElement parseValueFromResultSet(ResultSet rs, int columnIndex) throws SQLException
      Parses a value from a ResultSet to JsonElement.
      Parameters:
      rs - the ResultSet
      columnIndex - the first column is 1, the second is 2, ...
      Returns:
      a JsonElement
      Throws:
      SQLException - on error
    • subtract

      public com.google.gson.JsonElement subtract(com.google.gson.JsonElement minuend, com.google.gson.JsonElement subtrahend) throws OpenemsError.OpenemsNamedException
      Subtracts two values.
      Parameters:
      minuend - the minuend of the subtraction
      subtrahend - the subtrahend of the subtraction
      Returns:
      the result, possibly null
      Throws:
      OpenemsError.OpenemsNamedException - on error
    • fromId

      public static Type fromId(int id)
      Gets the Type from its ID.
      Parameters:
      id - the ID
      Returns:
      the Type; null if unknown
    • detect

      public static Type detect(com.google.gson.JsonElement value)
      Tries to detect the Type of a JsonElement value.
      Parameters:
      value - the value
      Returns:
      the type