Record Class TracedQueue.Message

java.lang.Object
java.lang.Record
org.j7m.middleware.integrations.TracedQueue.Message
Record Components:
context - durable propagation parent
payload - application bytes, copied on construction and access
Enclosing class:
TracedQueue

public static record TracedQueue.Message(org.j7m.middleware.distributed.TraceCarrier context, byte[] payload) extends Record
Immutable delivery envelope.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Message(org.j7m.middleware.distributed.TraceCarrier context, byte[] payload)
    Copies and bounds application bytes.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.j7m.middleware.distributed.TraceCarrier
    Returns the value of the context record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    byte[]
    Returns independent payload bytes.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • Message

      public Message(org.j7m.middleware.distributed.TraceCarrier context, byte[] payload)
      Copies and bounds application bytes.
      Parameters:
      context - immutable propagation carrier
      payload - bytes, at most 30000
      Throws:
      IllegalArgumentException - for oversized payload
  • Method Details

    • payload

      public byte[] payload()
      Returns independent payload bytes.
      Returns:
      copied payload
    • 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. 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.
    • context

      public org.j7m.middleware.distributed.TraceCarrier context()
      Returns the value of the context record component.
      Returns:
      the value of the context record component