Record Class Change

java.lang.Object
java.lang.Record
io.fluxzero.sdk.modeling.Change

public record Change(String modelId, Class<?> modelType, long beforeSequenceNumber, Long beforeLastEventIndex, Object before, Object after, Executable handler, UnaryOperator<Entity<?>> directReplay, boolean cascadedDeletion, EntityMetadata metadata, io.fluxzero.common.api.modeling.ModelConflictPolicy conflictPolicy, GraphProjectionCompletion graphProjectionCompletion, boolean active, boolean storeEvent, boolean publishEvent, boolean updateState) extends Record
One fully resolved immutable model mutation outcome consumed by commit preparation.

This type is public only so the repository package can consume the canonical internal value directly; it is not a supported application extension point.

  • Constructor Details

    • Change

      public Change(String modelId, Class<?> modelType, long beforeSequenceNumber, Long beforeLastEventIndex, Object before, Object after, Executable handler, UnaryOperator<Entity<?>> directReplay, boolean cascadedDeletion, EntityMetadata metadata, io.fluxzero.common.api.modeling.ModelConflictPolicy conflictPolicy, GraphProjectionCompletion graphProjectionCompletion, boolean active, boolean storeEvent, boolean publishEvent, boolean updateState)
      Creates an instance of a Change record class.
      Parameters:
      modelId - the value for the modelId record component
      modelType - the value for the modelType record component
      beforeSequenceNumber - the value for the beforeSequenceNumber record component
      beforeLastEventIndex - the value for the beforeLastEventIndex record component
      before - the value for the before record component
      after - the value for the after record component
      handler - the value for the handler record component
      directReplay - the value for the directReplay record component
      cascadedDeletion - the value for the cascadedDeletion record component
      metadata - the value for the metadata record component
      conflictPolicy - the value for the conflictPolicy record component
      graphProjectionCompletion - the value for the graphProjectionCompletion record component
      active - the value for the active record component
      storeEvent - the value for the storeEvent record component
      publishEvent - the value for the publishEvent record component
      updateState - the value for the updateState record component
  • Method Details

    • withEffects

      public Change withEffects(boolean storeEvent, boolean publishEvent, boolean updateState)
    • directMutation

      public boolean directMutation()
      Whether this change originated from a direct graph mutation rather than a model handler.
    • validate

      public void validate()
    • configuration

      public EntityMetadata.RootConfiguration configuration()
    • 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.
    • modelId

      public String modelId()
      Returns the value of the modelId record component.
      Returns:
      the value of the modelId record component
    • modelType

      public Class<?> modelType()
      Returns the value of the modelType record component.
      Returns:
      the value of the modelType record component
    • beforeSequenceNumber

      public long beforeSequenceNumber()
      Returns the value of the beforeSequenceNumber record component.
      Returns:
      the value of the beforeSequenceNumber record component
    • beforeLastEventIndex

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

      public Object before()
      Returns the value of the before record component.
      Returns:
      the value of the before record component
    • after

      public Object after()
      Returns the value of the after record component.
      Returns:
      the value of the after record component
    • handler

      public Executable handler()
      Returns the value of the handler record component.
      Returns:
      the value of the handler record component
    • directReplay

      public UnaryOperator<Entity<?>> directReplay()
      Returns the value of the directReplay record component.
      Returns:
      the value of the directReplay record component
    • cascadedDeletion

      public boolean cascadedDeletion()
      Returns the value of the cascadedDeletion record component.
      Returns:
      the value of the cascadedDeletion record component
    • metadata

      public EntityMetadata metadata()
      Returns the value of the metadata record component.
      Returns:
      the value of the metadata record component
    • conflictPolicy

      public io.fluxzero.common.api.modeling.ModelConflictPolicy conflictPolicy()
      Returns the value of the conflictPolicy record component.
      Returns:
      the value of the conflictPolicy record component
    • graphProjectionCompletion

      public GraphProjectionCompletion graphProjectionCompletion()
      Returns the value of the graphProjectionCompletion record component.
      Returns:
      the value of the graphProjectionCompletion record component
    • active

      public boolean active()
      Returns the value of the active record component.
      Returns:
      the value of the active record component
    • storeEvent

      public boolean storeEvent()
      Returns the value of the storeEvent record component.
      Returns:
      the value of the storeEvent record component
    • publishEvent

      public boolean publishEvent()
      Returns the value of the publishEvent record component.
      Returns:
      the value of the publishEvent record component
    • updateState

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