Record Class SerializedAssociation

java.lang.Object
java.lang.Record
io.axoniq.framework.workflow.runtime.association.SerializedAssociation
Record Components:
qualifier - association source qualifier, maps to ValueRetriever.qualifier()
path - source-specific path, maps to ValueRetriever.path()
operator - comparison operator name
value - serialized comparison value

public record SerializedAssociation(String qualifier, String path, String operator, String value) extends Record
Canonical serialized representation of an event association.
Since:
5.4.0
Author:
Simon Zambrovski
  • Constructor Details

    • SerializedAssociation

      public SerializedAssociation(String qualifier, String path, String operator, String value)
      Creates an instance of a SerializedAssociation record class.
      Parameters:
      qualifier - the value for the qualifier record component
      path - the value for the path record component
      operator - the value for the operator record component
      value - the value for the value record component
  • Method Details

    • from

      public static SerializedAssociation from(ValueRetriever retriever, String operator, Object value)
      Creates a serialized association from the given retriever and matcher details.
      Parameters:
      retriever - value retriever
      operator - comparison operator name
      value - comparison value
      Returns:
      serialized association
    • parse

      public static SerializedAssociation parse(ValueComparisonOperatorRegistry registry, String serializedCondition)
      Parses a serialized association string.
      Parameters:
      registry - operator registry used to resolve operators
      serializedCondition - serialized association
      Returns:
      parsed serialized association
    • asEventMessagePredicate

      public BiPredicate<EventMessage,ProcessingContext> asEventMessagePredicate(ValueComparisonOperatorRegistry registry)
      Delivers a predicate that can be used to filter event messages.
      Parameters:
      registry - value comparison operator registry
      Returns:
      bi predicate that can be used to filter event messages
    • serialize

      public String serialize()
      Serializes the association.
      Returns:
      serialized association
    • toString

      public 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • qualifier

      public String qualifier()
      Returns the value of the qualifier record component.
      Returns:
      the value of the qualifier record component
    • path

      public String path()
      Returns the value of the path record component.
      Returns:
      the value of the path record component
    • operator

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

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