Class InfluxDBResultMapper

java.lang.Object
org.influxdb.impl.InfluxDBResultMapper
Direct Known Subclasses:
InfluxDBMapper

public class InfluxDBResultMapper
extends Object
Main class responsible for mapping a QueryResult to a POJO.
Author:
fmachado
  • Constructor Summary

    Constructors 
    Constructor Description
    InfluxDBResultMapper()  
  • Method Summary

    Modifier and Type Method Description
    <T> List<T> toPOJO​(QueryResult queryResult, Class<T> clazz)
    Process a QueryResult object returned by the InfluxDB client inspecting the internal data structure and creating the respective object instances based on the Class passed as parameter.
    <T> List<T> toPOJO​(QueryResult queryResult, Class<T> clazz, String measurementName)
    Process a QueryResult object returned by the InfluxDB client inspecting the internal data structure and creating the respective object instances based on the Class passed as parameter.
    <T> List<T> toPOJO​(QueryResult queryResult, Class<T> clazz, String measurementName, TimeUnit precision)
    Process a QueryResult object returned by the InfluxDB client inspecting the internal data structure and creating the respective object instances based on the Class passed as parameter.
    <T> List<T> toPOJO​(QueryResult queryResult, Class<T> clazz, TimeUnit precision)
    Process a QueryResult object returned by the InfluxDB client inspecting the internal data structure and creating the respective object instances based on the Class passed as parameter.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • toPOJO

      public <T> List<T> toPOJO​(QueryResult queryResult, Class<T> clazz) throws InfluxDBMapperException

      Process a QueryResult object returned by the InfluxDB client inspecting the internal data structure and creating the respective object instances based on the Class passed as parameter.

      Type Parameters:
      T - the target type
      Parameters:
      queryResult - the InfluxDB result object
      clazz - the Class that will be used to hold your measurement data
      Returns:
      a List of objects from the same Class passed as parameter and sorted on the same order as received from InfluxDB.
      Throws:
      InfluxDBMapperException - If QueryResult parameter contain errors, clazz parameter is not annotated with @Measurement or it was not possible to define the values of your POJO (e.g. due to an unsupported field type).
    • toPOJO

      public <T> List<T> toPOJO​(QueryResult queryResult, Class<T> clazz, TimeUnit precision) throws InfluxDBMapperException

      Process a QueryResult object returned by the InfluxDB client inspecting the internal data structure and creating the respective object instances based on the Class passed as parameter.

      Type Parameters:
      T - the target type
      Parameters:
      queryResult - the InfluxDB result object
      clazz - the Class that will be used to hold your measurement data
      precision - the time precision of results
      Returns:
      a List of objects from the same Class passed as parameter and sorted on the same order as received from InfluxDB.
      Throws:
      InfluxDBMapperException - If QueryResult parameter contain errors, clazz parameter is not annotated with @Measurement or it was not possible to define the values of your POJO (e.g. due to an unsupported field type).
    • toPOJO

      public <T> List<T> toPOJO​(QueryResult queryResult, Class<T> clazz, String measurementName) throws InfluxDBMapperException

      Process a QueryResult object returned by the InfluxDB client inspecting the internal data structure and creating the respective object instances based on the Class passed as parameter.

      Type Parameters:
      T - the target type
      Parameters:
      queryResult - the InfluxDB result object
      clazz - the Class that will be used to hold your measurement data
      measurementName - name of the Measurement
      Returns:
      a List of objects from the same Class passed as parameter and sorted on the same order as received from InfluxDB.
      Throws:
      InfluxDBMapperException - If QueryResult parameter contain errors, clazz parameter is not annotated with @Measurement or it was not possible to define the values of your POJO (e.g. due to an unsupported field type).
    • toPOJO

      public <T> List<T> toPOJO​(QueryResult queryResult, Class<T> clazz, String measurementName, TimeUnit precision) throws InfluxDBMapperException

      Process a QueryResult object returned by the InfluxDB client inspecting the internal data structure and creating the respective object instances based on the Class passed as parameter.

      Type Parameters:
      T - the target type
      Parameters:
      queryResult - the InfluxDB result object
      clazz - the Class that will be used to hold your measurement data
      measurementName - name of the Measurement
      precision - the time precision of results
      Returns:
      a List of objects from the same Class passed as parameter and sorted on the same order as received from InfluxDB.
      Throws:
      InfluxDBMapperException - If QueryResult parameter contain errors, clazz parameter is not annotated with @Measurement or it was not possible to define the values of your POJO (e.g. due to an unsupported field type).