Package cloud.spawnery.agent.api
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 whatSpawneryApi.servers()calls it and whatSpawneryApi.stopServer(java.lang.String)takesalreadyRunning- 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.NONEfor a member without any stamped values.
public record StartedServer(String name, boolean alreadyRunning, ServerResources resources)
extends Record
The private server a
SpawneryApi.startServer(java.lang.String, java.lang.String) produced.-
Constructor Summary
ConstructorsConstructorDescriptionStartedServer(String name, boolean alreadyRunning) The record as it was beforeresources, which it reads as none.StartedServer(String name, boolean alreadyRunning, ServerResources resources) Creates an instance of aStartedServerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thealreadyRunningrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Returns the value of theresourcesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
StartedServer
Creates an instance of aStartedServerrecord class.- Parameters:
name- the value for thenamerecord componentalreadyRunning- the value for thealreadyRunningrecord componentresources- the value for theresourcesrecord component
-
StartedServer
The record as it was beforeresources, which it reads as none.
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
alreadyRunning
public boolean alreadyRunning()Returns the value of thealreadyRunningrecord component.- Returns:
- the value of the
alreadyRunningrecord component
-
resources
Returns the value of theresourcesrecord component.- Returns:
- the value of the
resourcesrecord component
-