Package dev.twilite.game.wrapper
Record Class Server
java.lang.Object
java.lang.Record
dev.twilite.game.wrapper.Server
- Record Components:
id- world idactivity- world activity texthost- world host namelocation- server locationflags- decoded world property flagspopulation- current population, or-1when unavailable
public record Server(int id, String activity, String host, Server.Location location, Set<Server.Flag> flags, int population)
extends Record
Snapshot of an Old School RuneScape server from the public world list.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumPublic world-list property flags.static enumPublic world-list location ids. -
Constructor Summary
ConstructorsConstructorDescriptionServer(int id, String activity, String host, Server.Location location, Set<Server.Flag> flags, int population) Creates an instance of aServerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionactivity()Returns the value of theactivityrecord component.final booleanIndicates whether some other object is "equal to" this one.flags()Returns the value of theflagsrecord component.static Set<Server.Flag> flags(int rawFlags) Decodes raw public world-list flags.final inthashCode()Returns a hash code value for this object.host()Returns the value of thehostrecord component.intid()Returns the value of theidrecord component.booleanis(Server.Flag flag) Returns whether this server has a property flag.location()Returns the value of thelocationrecord component.booleanmembers()Returns whether this is a members-only server.intPacks this server's decoded flags back into the raw bitmask expected by the client.intReturns the value of thepopulationrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Server
public Server(int id, String activity, String host, Server.Location location, Set<Server.Flag> flags, int population) Creates an instance of aServerrecord class.- Parameters:
id- the value for theidrecord componentactivity- the value for theactivityrecord componenthost- the value for thehostrecord componentlocation- the value for thelocationrecord componentflags- the value for theflagsrecord componentpopulation- the value for thepopulationrecord component
-
-
Method Details
-
flags
Decodes raw public world-list flags. -
packedFlags
public int packedFlags()Packs this server's decoded flags back into the raw bitmask expected by the client. -
is
Returns whether this server has a property flag. -
members
public boolean members()Returns whether this is a members-only server. -
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 '=='. -
id
public int id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
activity
Returns the value of theactivityrecord component.- Returns:
- the value of the
activityrecord component
-
host
Returns the value of thehostrecord component.- Returns:
- the value of the
hostrecord component
-
location
Returns the value of thelocationrecord component.- Returns:
- the value of the
locationrecord component
-
flags
Returns the value of theflagsrecord component.- Returns:
- the value of the
flagsrecord component
-
population
public int population()Returns the value of thepopulationrecord component.- Returns:
- the value of the
populationrecord component
-