Class MeasurementFilter

java.lang.Object
com.cumulocity.sdk.client.Filter
com.cumulocity.sdk.client.measurement.MeasurementFilter

public class MeasurementFilter extends Filter
A filter to be used in measurement queries. The setter (by*) methods return the filter itself to provide chaining: MeasurementFilter filter = new MeasurementFilter().byType(type).bySource(source);
  • Constructor Details

    • MeasurementFilter

      public MeasurementFilter()
  • Method Details

    • byType

      public MeasurementFilter byType(String type)
      Specifies the type query parameter
      Parameters:
      type - the type of the event(s)
      Returns:
      the event filter with type set
    • bySource

      public MeasurementFilter bySource(GId id)
      Specifies the source query parameter
      Parameters:
      id - the managed object that generated the event(s)
      Returns:
      the event filter with source set
    • bySource

      Deprecated.
      Specifies the source query parameter
      Parameters:
      source - the managed object that generated the event(s)
      Returns:
      the event filter with source set
    • getType

      public String getType()
      Returns:
      the type parameter of the query
    • getSource

      public String getSource()
      Returns:
      the source parameter of the query
    • byFragmentType

      public MeasurementFilter byFragmentType(Class<?> fragmentType)
    • byFragmentType

      public MeasurementFilter byFragmentType(String fragmentType)
    • getFragmentType

      public String getFragmentType()
    • byValueFragmentType

      public MeasurementFilter byValueFragmentType(String valueFragmentType)
      Specify value fragment type. This is preferred over the parameter fragmentType, because working with structured data and filtering via this parameter is lighter than filtering via fragmentType.
      Parameters:
      valueFragmentType - the value fragment type to filter.
      Returns:
      the event filter with valueFragmentType set.
      See Also:
    • byValueFragmentSeries

      public MeasurementFilter byValueFragmentSeries(String valueFragmentSeries)
      Specify value fragment series, usually use in conjunction with byValueFragmentType(String)
      Parameters:
      valueFragmentSeries - value fragment series to filter.
      Returns:
      the event filter with valueFragmentSeries set.
      See Also:
    • byValueFragmentTypeAndSeries

      public MeasurementFilter byValueFragmentTypeAndSeries(String valueFragmentType, String valueFragmentSeries)
      Parameters:
      valueFragmentType - value fragment type to filter, example: c8y_TemperatureMeasurement
      valueFragmentSeries - value fragment series to filter, example: T
      Returns:
      the event filter with valueFragmentType and valueFragmentSeries set.
    • getValueFragmentType

      public String getValueFragmentType()
    • getValueFragmentSeries

      public String getValueFragmentSeries()
    • byDate

      public MeasurementFilter byDate(Date fromDate, Date toDate)
    • byFromDate

      public MeasurementFilter byFromDate(Date fromDate)
    • getFromDate

      public String getFromDate()
    • getToDate

      public String getToDate()