Record Class StartedServer

java.lang.Object
java.lang.Record
cloud.spawnery.agent.api.StartedServer
Record Components:
name - the server's name, composed by the operator from the group and the key — this is what SpawneryApi.servers() calls it and what SpawneryApi.stopServer(java.lang.String) takes
alreadyRunning - whether it was already there, which is a success and not a refusal. It says nothing about whether the server is ready for players.
resources - what the member runs with. For a start that found it already running these are the values it was started with, which may not be the ones asked for now. ServerResources.NONE for a member without any stamped values.

public record StartedServer(String name, boolean alreadyRunning, ServerResources resources) extends Record
  • Constructor Details

    • StartedServer

      public StartedServer(String name, boolean alreadyRunning, ServerResources resources)
      Creates an instance of a StartedServer record class.
      Parameters:
      name - the value for the name record component
      alreadyRunning - the value for the alreadyRunning record component
      resources - the value for the resources record component
    • StartedServer

      public StartedServer(String name, boolean alreadyRunning)
      The record as it was before resources, which it reads as none.
  • 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
    • alreadyRunning

      public boolean alreadyRunning()
      Returns the value of the alreadyRunning record component.
      Returns:
      the value of the alreadyRunning record component
    • resources

      public ServerResources resources()
      Returns the value of the resources record component.
      Returns:
      the value of the resources record component