Record Class Group

java.lang.Object
java.lang.Record
cloud.spawnery.agent.api.Group
Record Components:
freeSlots - the operator's own figure, which counts only ready servers of the group's current spec. It can disagree with a sum over SpawneryApi.servers() while a rolling update is in flight.
attributes - what whoever runs this network wrote down about this group in its own definition, empty until somebody writes something. Unlike ServerInfo.attributes(), a person writes these, not a server. Immutable.
displayName - what this group is called where a person reads it, for example on a scoreboard; name() is a DNS label. Never empty: a group nobody has named is displayed by its own name.
pinned - whether an Exact ScaleBoost holds the group at a size.
pinnedReplicas - the size the pin holds the group at, 0 without a pin.
pinnedUntil - when the pin ends on the operator's clock; null for a pin without an end and for no pin.

public record Group(String name, Group.Kind kind, int replicas, int readyReplicas, int onlinePlayers, int freeSlots, Map<String,String> attributes, String displayName, boolean pinned, int pinnedReplicas, Instant pinnedUntil) extends Record
A group of servers, as the operator last described it.
  • Constructor Details

    • Group

      public Group(String name, Group.Kind kind, int replicas, int readyReplicas, int onlinePlayers, int freeSlots, Map<String,String> attributes, String displayName, boolean pinned, int pinnedReplicas, Instant pinnedUntil)
      Creates an instance of a Group record class.
      Parameters:
      name - the value for the name record component
      kind - the value for the kind record component
      replicas - the value for the replicas record component
      readyReplicas - the value for the readyReplicas record component
      onlinePlayers - the value for the onlinePlayers record component
      freeSlots - the value for the freeSlots record component
      attributes - the value for the attributes record component
      displayName - the value for the displayName record component
      pinned - the value for the pinned record component
      pinnedReplicas - the value for the pinnedReplicas record component
      pinnedUntil - the value for the pinnedUntil record component
    • Group

      public Group(String name, Group.Kind kind, int replicas, int readyReplicas, int onlinePlayers, int freeSlots, Map<String,String> attributes, String displayName)
      The 0.18 shape: no pin.
  • Method Details

    • 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 '=='.
      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.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • kind

      public Group.Kind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • replicas

      public int replicas()
      Returns the value of the replicas record component.
      Returns:
      the value of the replicas record component
    • readyReplicas

      public int readyReplicas()
      Returns the value of the readyReplicas record component.
      Returns:
      the value of the readyReplicas record component
    • onlinePlayers

      public int onlinePlayers()
      Returns the value of the onlinePlayers record component.
      Returns:
      the value of the onlinePlayers record component
    • freeSlots

      public int freeSlots()
      Returns the value of the freeSlots record component.
      Returns:
      the value of the freeSlots record component
    • attributes

      public Map<String,String> attributes()
      Returns the value of the attributes record component.
      Returns:
      the value of the attributes record component
    • displayName

      public String displayName()
      Returns the value of the displayName record component.
      Returns:
      the value of the displayName record component
    • pinned

      public boolean pinned()
      Returns the value of the pinned record component.
      Returns:
      the value of the pinned record component
    • pinnedReplicas

      public int pinnedReplicas()
      Returns the value of the pinnedReplicas record component.
      Returns:
      the value of the pinnedReplicas record component
    • pinnedUntil

      public Instant pinnedUntil()
      Returns the value of the pinnedUntil record component.
      Returns:
      the value of the pinnedUntil record component