Record Class ModelReadBoundary

java.lang.Object
java.lang.Record
io.fluxzero.common.api.modeling.ModelReadBoundary
Record Components:
stateIndex - namespace-wide state boundary, or null for an unpinned or opaque boundary
commitId - commit that defines the boundary, or null
substep - zero-based substep within commitId, or null
eventIndex - event that defines the boundary, or null
before - whether the state immediately before the selected boundary is requested
includeMessageBatch - whether staged values from the active message batch are visible
fallbackToCurrent - whether an unmapped eventIndex resolves to current state instead of failing

public record ModelReadBoundary(Long stateIndex, String commitId, Integer substep, Long eventIndex, boolean before, boolean includeMessageBatch, boolean fallbackToCurrent) extends Record
One current, state, commit or event boundary shared by every Model read.
  • Field Details

    • CURRENT

      public static final ModelReadBoundary CURRENT
      Unpinned current-state boundary including active message-batch values.
  • Constructor Details

    • ModelReadBoundary

      public ModelReadBoundary(Long stateIndex, String commitId, Integer substep, Long eventIndex, boolean before, boolean includeMessageBatch, boolean fallbackToCurrent)
      Creates an instance of a ModelReadBoundary record class.
      Parameters:
      stateIndex - the value for the stateIndex record component
      commitId - the value for the commitId record component
      substep - the value for the substep record component
      eventIndex - the value for the eventIndex record component
      before - the value for the before record component
      includeMessageBatch - the value for the includeMessageBatch record component
      fallbackToCurrent - the value for the fallbackToCurrent record component
  • Method Details

    • current

      public static ModelReadBoundary current()
      Returns the shared current-state boundary.
    • at

      public static ModelReadBoundary at(Long stateIndex)
      Returns a current boundary for null, otherwise an exact state boundary.
    • state

      public static ModelReadBoundary state(long stateIndex, boolean includeMessageBatch)
      Creates an exact state boundary with optional active message-batch visibility.
    • commit

      public static ModelReadBoundary commit(String commitId, int substep)
      Creates a boundary at a commit substep.
    • event

      public static ModelReadBoundary event(long eventIndex)
      Creates a boundary at an event index.
    • eventOrCurrent

      public static ModelReadBoundary eventOrCurrent(long eventIndex)
      Creates an event boundary that retains current-state behavior when the event has no Model mapping.
    • asBefore

      public ModelReadBoundary asBefore()
      Returns the boundary immediately before this selection.
    • resolved

      public ModelReadBoundary resolved(long resolvedStateIndex)
      Pins this selection to the durable state returned by storage.
    • resolved

      public ModelReadBoundary resolved(long resolvedStateIndex, boolean includeMessageBatch)
      Pins this selection while explicitly retaining or excluding active message-batch values.
    • withoutMessageBatch

      public ModelReadBoundary withoutMessageBatch()
      Returns this boundary without active message-batch visibility.
    • historical

      public boolean historical()
      Indicates whether this selection refers to a durable historical boundary.
    • forRequest

      public ModelReadBoundary forRequest()
      Returns the durable selector form carried by a storage request.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • stateIndex

      public Long stateIndex()
      Returns the value of the stateIndex record component.
      Returns:
      the value of the stateIndex record component
    • commitId

      public String commitId()
      Returns the value of the commitId record component.
      Returns:
      the value of the commitId record component
    • substep

      public Integer substep()
      Returns the value of the substep record component.
      Returns:
      the value of the substep record component
    • eventIndex

      public Long eventIndex()
      Returns the value of the eventIndex record component.
      Returns:
      the value of the eventIndex record component
    • before

      public boolean before()
      Returns the value of the before record component.
      Returns:
      the value of the before record component
    • includeMessageBatch

      public boolean includeMessageBatch()
      Returns the value of the includeMessageBatch record component.
      Returns:
      the value of the includeMessageBatch record component
    • fallbackToCurrent

      public boolean fallbackToCurrent()
      Returns the value of the fallbackToCurrent record component.
      Returns:
      the value of the fallbackToCurrent record component