Record Class NuggetAdminCommandResult<T>

java.lang.Object
java.lang.Record
org.j7m.middleware.operations.api.NuggetAdminCommandResult<T>
Type Parameters:
T - typed payload family
Record Components:
target - authoritative result target, or null only for result payloads that do not repeat target identity
header - common result header
payload - typed result payload, or null
payloadType - stable public payload type id for schema diagnostics

public record NuggetAdminCommandResult<T>(NuggetAdminTarget target, NuggetAdminResultHeader header, T payload, String payloadType) extends Record
Shared public envelope for one typed admin operation result.

The payload is a typed public DTO such as an introspection collection, lifecycle result, control result, discovery result, or capability result. Callers must use header() for common outcome, error, count, warning, timing, partial, and truncation semantics, then interpret payload() according to the typed operation family. The operation family binding is owned by NuggetAdminOperationKind; construction validates the exact public DTO result family, the null-payload policy, common outcome flags, mutation-only header state on read-only operations, and the stable payload type token.

Instances are immutable and thread-safe.

  • Constructor Details

    • NuggetAdminCommandResult

      public NuggetAdminCommandResult(NuggetAdminResultHeader header, T payload, String payloadType)
      Creates an immutable command result for payloads that do not repeat the authoritative target identity.
      Parameters:
      header - common result header
      payload - typed result payload, or null
      payloadType - stable public payload type id
    • NuggetAdminCommandResult

      public NuggetAdminCommandResult(NuggetAdminTarget target, NuggetAdminResultHeader header, T payload, String payloadType)
      Creates an immutable command result.
  • Method Details

    • toString

      public String toString()
      Specified by:
      toString in class Record
    • 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.
    • target

      public NuggetAdminTarget target()
      Returns the value of the target record component.
      Returns:
      the value of the target record component
    • header

      public NuggetAdminResultHeader header()
      Returns the value of the header record component.
      Returns:
      the value of the header record component
    • payload

      public T payload()
      Returns the value of the payload record component.
      Returns:
      the value of the payload record component
    • payloadType

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