Record Class NuggetAdminCommandRequest<T>

java.lang.Object
java.lang.Record
org.j7m.middleware.operations.api.NuggetAdminCommandRequest<T>
Type Parameters:
T - typed payload family
Record Components:
context - shared request context
payload - typed request payload, or null for capability queries
payloadType - stable public payload type id for schema diagnostics

public record NuggetAdminCommandRequest<T>(NuggetAdminRequestContext context, T payload, String payloadType) extends Record
Shared public envelope for one typed admin operation request.

The envelope references an existing typed request payload or a small contract DTO. It deliberately rejects strings and maps as payloads so callers cannot smuggle command-line text, free-form method names, or arbitrary JSON object maps into a second dispatch model. Service implementations must still evaluate the typed family directly and must not use this envelope as a reflection router. The operation family binding is owned by NuggetAdminOperationKind; construction validates the request protocol version through NuggetAdminRequestContext, the operation kind, the exact public DTO payload family, the null-payload policy, and the stable payload type token before a provider can receive the request.

Instances are immutable and thread-safe.

  • Constructor Details

    • NuggetAdminCommandRequest

      public NuggetAdminCommandRequest(NuggetAdminRequestContext context, T payload, String payloadType)
      Creates a validated immutable command request.
  • 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.
    • context

      public NuggetAdminRequestContext context()
      Returns the value of the context record component.
      Returns:
      the value of the context 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