Class AbstractQueryOptions.BaseBuilder<K extends QueryKey<T>, T extends TemporalPointType & QueryablePointType<T>, B extends AbstractQueryOptions.BaseBuilder<K,T,B>>

java.lang.Object
com.inductiveautomation.historian.common.model.options.AbstractQueryOptions.BaseBuilder<K,T,B>
Type Parameters:
K - the query key type.
T - the point type.
B - the builder type.
Direct Known Subclasses:
AnnotationQueryOptions.Builder, DataPointQueryOptions.DataQueryBuilder, MetadataQueryOptions.Builder
Enclosing class:
AbstractQueryOptions<K extends QueryKey<T>, T extends TemporalPointType & QueryablePointType<T>>

public abstract static class AbstractQueryOptions.BaseBuilder<K extends QueryKey<T>, T extends TemporalPointType & QueryablePointType<T>, B extends AbstractQueryOptions.BaseBuilder<K,T,B>> extends Object
Base builder for AbstractQueryOptions.
  • Field Details

    • queryKeys

      protected final List<K extends QueryKey<T>> queryKeys
    • returnSize

      protected @Nullable Integer returnSize
  • Constructor Details

  • Method Details

    • includeBounds

      public B includeBounds()
      Includes the bounds in the time range.
    • excludeBounds

      public B excludeBounds()
      Excludes the bounds from the time range.
    • startTime

      public B startTime(@Nullable Instant startTime)
      Sets the start time.
      Parameters:
      startTime - the start time, or null to unset.
      Returns:
      this builder.
    • startTime

      public B startTime(long startTime)
      Sets the start time.
      Parameters:
      startTime - the start time in epoch milliseconds.
      Returns:
      this builder.
    • endTime

      public B endTime(@Nullable Instant endTime)
      Sets the end time.
      Parameters:
      endTime - the end time, or null to unset.
      Returns:
      this builder.
    • endTime

      public B endTime(long endTime)
      Sets the end time.
      Parameters:
      endTime - the end time in epoch milliseconds.
      Returns:
      this builder.
    • rangeHours

      public B rangeHours(int hours)
      Adds hours to the time range.
      Parameters:
      hours - the hours to add.
      Returns:
      this builder.
    • rangeMinutes

      public B rangeMinutes(int minutes)
      Adds minutes to the time range.
      Parameters:
      minutes - the minutes to add.
      Returns:
      this builder.
    • rangeSeconds

      public B rangeSeconds(int seconds)
      Adds seconds to the time range.
      Parameters:
      seconds - the seconds to add.
      Returns:
      this builder.
    • returnSize

      public B returnSize(@Nullable Integer returnSize)
      Sets the maximum number of results.
      Parameters:
      returnSize - the maximum, or null to unset.
      Returns:
      this builder.
    • addPropertyValue

      public <V> B addPropertyValue(Property<V> property, V value)
      Adds an extended property value.
      Type Parameters:
      V - the value type.
      Parameters:
      property - the property.
      value - the value.
      Returns:
      this builder.
    • addPropertyValues

      public B addPropertyValues(PropertySet properties)
      Adds extended property values.
      Parameters:
      properties - the properties to add.
      Returns:
      this builder.
    • addQueryKey

      public B addQueryKey(K key)
      Adds a query key.
      Parameters:
      key - the key.
      Returns:
      this builder.
    • addQueryKeys

      public B addQueryKeys(Collection<K> keys)
      Adds query keys.
      Parameters:
      keys - the keys.
      Returns:
      this builder.
    • clearQueryKeys

      public B clearQueryKeys()
      Removes all query keys.
      Returns:
      this builder.
    • self

      protected abstract B self()
    • build

      public abstract AbstractQueryOptions<K,T> build()
      Builds the options.
      Returns:
      the new options.
    • calculateTimeRange

      protected @Nullable TimeRange calculateTimeRange()
      Derives the time range from the start time, end time and range.
      Returns:
      the range, or null if none can be determined.
      Throws:
      IllegalArgumentException - if an end time is set without a start time or range.