Record Class InstanceStatus

java.lang.Object
java.lang.Record
cloud.spawnery.agent.api.InstanceStatus

public record InstanceStatus(String name, String group, boolean proxy, String phase, boolean ready, int players, int slots, OptionalDouble tps, OptionalDouble mspt, Duration age, boolean retiring, boolean held, boolean draining, ResourceUsage usage, String node, int playableSlots) extends Record
One server or proxy in a NetworkStatus. phase is empty for a proxy, whose state is ready and draining. tps and mspt are empty for a proxy and for a server that has not reported. node is the Kubernetes node the pod runs on, empty while it is not scheduled. playableSlots is how many of slots count as capacity, equal to slots when nothing narrowed it.
  • Constructor Summary

    Constructors
    Constructor
    Description
    InstanceStatus(String name, String group, boolean proxy, String phase, boolean ready, int players, int slots, OptionalDouble tps, OptionalDouble mspt, Duration age, boolean retiring, boolean held, boolean draining, ResourceUsage usage)
    The record as it was before node, which it reads as not scheduled.
    InstanceStatus(String name, String group, boolean proxy, String phase, boolean ready, int players, int slots, OptionalDouble tps, OptionalDouble mspt, Duration age, boolean retiring, boolean held, boolean draining, ResourceUsage usage, String node)
    The record as it was before playableSlots, which it reads as every seat.
    InstanceStatus(String name, String group, boolean proxy, String phase, boolean ready, int players, int slots, OptionalDouble tps, OptionalDouble mspt, Duration age, boolean retiring, boolean held, boolean draining, ResourceUsage usage, String node, int playableSlots)
    Creates an instance of a InstanceStatus record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    age()
    Returns the value of the age record component.
    boolean
    Returns the value of the draining record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the group record component.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the held record component.
    Returns the value of the mspt record component.
    Returns the value of the name record component.
    Returns the value of the node record component.
    Returns the value of the phase record component.
    int
    Returns the value of the playableSlots record component.
    int
    Returns the value of the players record component.
    boolean
    Returns the value of the proxy record component.
    boolean
    Returns the value of the ready record component.
    boolean
    Returns the value of the retiring record component.
    int
    Returns the value of the slots record component.
    final String
    Returns a string representation of this record class.
    tps()
    Returns the value of the tps record component.
    Returns the value of the usage record component.

    Methods inherited from class java.lang.Object

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

    • InstanceStatus

      public InstanceStatus(String name, String group, boolean proxy, String phase, boolean ready, int players, int slots, OptionalDouble tps, OptionalDouble mspt, Duration age, boolean retiring, boolean held, boolean draining, ResourceUsage usage, String node, int playableSlots)
      Creates an instance of a InstanceStatus record class.
      Parameters:
      name - the value for the name record component
      group - the value for the group record component
      proxy - the value for the proxy record component
      phase - the value for the phase record component
      ready - the value for the ready record component
      players - the value for the players record component
      slots - the value for the slots record component
      tps - the value for the tps record component
      mspt - the value for the mspt record component
      age - the value for the age record component
      retiring - the value for the retiring record component
      held - the value for the held record component
      draining - the value for the draining record component
      usage - the value for the usage record component
      node - the value for the node record component
      playableSlots - the value for the playableSlots record component
    • InstanceStatus

      public InstanceStatus(String name, String group, boolean proxy, String phase, boolean ready, int players, int slots, OptionalDouble tps, OptionalDouble mspt, Duration age, boolean retiring, boolean held, boolean draining, ResourceUsage usage, String node)
      The record as it was before playableSlots, which it reads as every seat.
    • InstanceStatus

      public InstanceStatus(String name, String group, boolean proxy, String phase, boolean ready, int players, int slots, OptionalDouble tps, OptionalDouble mspt, Duration age, boolean retiring, boolean held, boolean draining, ResourceUsage usage)
      The record as it was before node, which it reads as not scheduled.
  • 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
    • group

      public String group()
      Returns the value of the group record component.
      Returns:
      the value of the group record component
    • proxy

      public boolean proxy()
      Returns the value of the proxy record component.
      Returns:
      the value of the proxy record component
    • phase

      public String phase()
      Returns the value of the phase record component.
      Returns:
      the value of the phase record component
    • ready

      public boolean ready()
      Returns the value of the ready record component.
      Returns:
      the value of the ready record component
    • players

      public int players()
      Returns the value of the players record component.
      Returns:
      the value of the players record component
    • slots

      public int slots()
      Returns the value of the slots record component.
      Returns:
      the value of the slots record component
    • tps

      public OptionalDouble tps()
      Returns the value of the tps record component.
      Returns:
      the value of the tps record component
    • mspt

      public OptionalDouble mspt()
      Returns the value of the mspt record component.
      Returns:
      the value of the mspt record component
    • age

      public Duration age()
      Returns the value of the age record component.
      Returns:
      the value of the age record component
    • retiring

      public boolean retiring()
      Returns the value of the retiring record component.
      Returns:
      the value of the retiring record component
    • held

      public boolean held()
      Returns the value of the held record component.
      Returns:
      the value of the held record component
    • draining

      public boolean draining()
      Returns the value of the draining record component.
      Returns:
      the value of the draining record component
    • usage

      public ResourceUsage usage()
      Returns the value of the usage record component.
      Returns:
      the value of the usage record component
    • node

      public String node()
      Returns the value of the node record component.
      Returns:
      the value of the node record component
    • playableSlots

      public int playableSlots()
      Returns the value of the playableSlots record component.
      Returns:
      the value of the playableSlots record component