Class ImmutableSignalRecordValue

java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableSignalRecordValue
All Implemented Interfaces:
JsonSerializable, RecordValue, RecordValueWithVariables, SignalRecordValue

@ParametersAreNonnullByDefault @Immutable public final class ImmutableSignalRecordValue extends Object implements SignalRecordValue
Immutable implementation of SignalRecordValue.

Use the builder to create immutable instances: ImmutableSignalRecordValue.builder().

  • Method Details

    • getVariables

      public Map<String,Object> getVariables()
      Specified by:
      getVariables in interface RecordValueWithVariables
      Returns:
      the variables of this record. Can be empty.
    • getSignalName

      public String getSignalName()
      Specified by:
      getSignalName in interface SignalRecordValue
      Returns:
      the name of the signal
    • withVariables

      public final ImmutableSignalRecordValue withVariables(Map<String,? extends Object> entries)
      Copy the current immutable object by replacing the variables map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to be added to the variables map
      Returns:
      A modified copy of this object
    • withSignalName

      public final ImmutableSignalRecordValue withSignalName(String value)
      Copy the current immutable object by setting a value for the signalName attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for signalName (can be null)
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableSignalRecordValue that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Returns a lazily computed hash code from attributes: variables, signalName.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value SignalRecordValue with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableSignalRecordValue copyOf(SignalRecordValue instance)
      Creates an immutable copy of a SignalRecordValue value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable SignalRecordValue instance
    • builder

      public static ImmutableSignalRecordValue.Builder builder()
      Creates a builder for ImmutableSignalRecordValue.
       ImmutableSignalRecordValue.builder()
          .putVariable|putAllVariables(String => Object) // variables mappings
          .withSignalName(String | null) // nullable signalName
          .build();
       
      Returns:
      A new ImmutableSignalRecordValue builder