Record Class CorrelationData.Confirm

java.lang.Object
java.lang.Record
org.springframework.amqp.rabbit.connection.CorrelationData.Confirm
Record Components:
ack - true to confirm
reason - the reason for nack
Enclosing class:
CorrelationData

public static record CorrelationData.Confirm(boolean ack, @Nullable String reason) extends Record
Represents a publisher confirmation. When the ack field is true, the publish was successful; otherwise failed with a possible reason (maybe null, meaning unknown).
Since:
2.1
  • Constructor Summary

    Constructors
    Constructor
    Description
    Confirm(boolean ack, @Nullable String reason)
    Creates an instance of a Confirm record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    ack()
    Returns the value of the ack record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    @Nullable String
    Deprecated, for removal: This API element is subject to removal in a future version.
    final int
    Returns a hash code value for this object.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    @Nullable String
    Returns the value of the reason record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Confirm

      public Confirm(boolean ack, @Nullable String reason)
      Creates an instance of a Confirm record class.
      Parameters:
      ack - the value for the ack record component
      reason - the value for the reason record component
  • Method Details

    • isAck

      @Deprecated(forRemoval=true, since="4.0") public boolean isAck()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getReason

      @Deprecated(forRemoval=true, since="4.0") public @Nullable String getReason()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • 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.
    • ack

      public boolean ack()
      Returns the value of the ack record component.
      Returns:
      the value of the ack record component
    • reason

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