Record Class NuggetAdminTarget

java.lang.Object
java.lang.Record
org.j7m.middleware.operations.api.NuggetAdminTarget
Record Components:
nuggetId - stable nugget identity
runtimeId - stable runtime identity
generation - target generation, or 0 for explicitly documented current/unknown matching
endpointIdentity - optional safe endpoint identity metadata
providerIdentity - optional safe provider identity metadata

public record NuggetAdminTarget(String nuggetId, String runtimeId, long generation, String endpointIdentity, String providerIdentity) extends Record
Public target identity for an admin request.

The authoritative target fields are nuggetId(), runtimeId(), and generation(). Display names, endpoint names, provider identifiers, and CLI prompt text are only metadata and must not be used as authority for mutation, authorization, or stale-target acceptance. A generation of 0 means "current or unknown" only for operations that explicitly document that weaker match. Mutating operations should use an exact positive generation whenever the provider can supply one.

Instances are immutable and thread-safe.

  • Constructor Details

    • NuggetAdminTarget

      public NuggetAdminTarget(String nuggetId, String runtimeId, long generation, String endpointIdentity, String providerIdentity)
      Creates a validated target identity.
  • Method Details

    • current

      public static NuggetAdminTarget current(String nuggetId, String runtimeId)
      Creates a target for the current or unknown generation.
      Parameters:
      nuggetId - stable nugget identity
      runtimeId - stable runtime identity
      Returns:
      target with generation 0
    • 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.
    • nuggetId

      public String nuggetId()
      Returns the value of the nuggetId record component.
      Returns:
      the value of the nuggetId record component
    • runtimeId

      public String runtimeId()
      Returns the value of the runtimeId record component.
      Returns:
      the value of the runtimeId record component
    • generation

      public long generation()
      Returns the value of the generation record component.
      Returns:
      the value of the generation record component
    • endpointIdentity

      public String endpointIdentity()
      Returns the value of the endpointIdentity record component.
      Returns:
      the value of the endpointIdentity record component
    • providerIdentity

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