Interface CollectionContext

All Known Implementing Classes:
EmptyCollectionContext, StandardCollectionContext

public sealed interface CollectionContext permits StandardCollectionContext, EmptyCollectionContext
Describes one data collection operation for a DataCollector, as a set of properties. Standard contexts carry the full set; empty contexts carry few or none.
  • Method Details

    • hasProperty

      boolean hasProperty(Property<?> property)
    • getValue

      <T> Optional<T> getValue(Property<T> property)
    • getProperties

      PropertySet getProperties()
    • collectionId

      default Optional<String> collectionId()
      Returns the identifier of this collection, such as a tag group name.
      Returns:
      the identifier, or empty if unavailable.
    • collectionSource

      default Optional<String> collectionSource()
      Returns the initiator of this collection, such as a tag provider name.
      Returns:
      the source, or empty if unavailable.
    • collectionInterval

      default Optional<Duration> collectionInterval()
      Returns the interval of a periodic collection. Empty means a one-time or event-driven collection, such as on value change or a manual trigger.
      Returns:
      the interval, or empty.
    • collectionTime

      default Optional<Instant> collectionTime()
      Returns when the collection occurred.
      Returns:
      the time, or empty if unavailable.
    • isHeartbeat

      default boolean isHeartbeat()
      Returns whether this is a heartbeat collection, which represents system health.
      Returns:
      true for a heartbeat.
    • valueOrigin

      default Optional<ValueOrigin> valueOrigin()
      Returns whether the collected values come directly from the source or are observed or derived by the collector.
      Returns:
      the origin, or empty if unavailable.
    • isEmpty

      boolean isEmpty()
      Returns whether this context has no properties, or only default ones.
      Returns:
      true for an empty context.
    • empty

      static CollectionContext empty()
      Returns an empty context with no collection parameters.
      Returns:
      the empty context.
    • builder

      Starts building a StandardCollectionContext.
      Returns:
      the first builder step.