Record Class BCServerList
java.lang.Object
java.lang.Record
de.florianmichael.classic4j.model.betacraft.BCServerList
- Record Components:
servers- The servers on the BetaCraft server list.
This class represents a list of servers on the BetaCraft server list. It is used to parse the HTML document returned by the BetaCraft server list.
-
Constructor Summary
ConstructorsConstructorDescriptionBCServerList(List<BCServerInfo> servers) Creates an instance of aBCServerListrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static CompletableFuture<BCServerList>get(HttpClient httpClient, com.google.gson.Gson gson, URI uri, Class<? extends BCServerInfo> infoSpec) Sends a request to the BetaCraft server list and returns the response as aBCServerListobject.final inthashCode()Returns a hash code value for this object.servers()Returns the value of theserversrecord component.Returns a list of servers that have the given version category.serversWithOnlineMode(boolean on) Returns a list of servers that have the given version category.final StringtoString()Returns a string representation of this record class.withConnectVersion(String v1Version) Returns a list of servers that have the given version category.
-
Constructor Details
-
BCServerList
Creates an instance of aBCServerListrecord class.- Parameters:
servers- the value for theserversrecord component
-
-
Method Details
-
get
public static CompletableFuture<BCServerList> get(HttpClient httpClient, com.google.gson.Gson gson, URI uri, Class<? extends BCServerInfo> infoSpec) Sends a request to the BetaCraft server list and returns the response as aBCServerListobject.- Parameters:
httpClient- The HttpClient to use for the request.gson- The Gson instance to use for the request.uri- The URI of the request. This is the URI of the BetaCraft server list.infoSpec- The class of the server info specification. This is the class that will be used to parse the JSON response.- Returns:
- A CompletableFuture containing the response.
-
servers
Returns the value of theserversrecord component.- Returns:
- the value of the
serversrecord component
-
serversOfVersionCategory
Returns a list of servers that have the given version category.- Parameters:
version- The version category to filter by.- Returns:
- A list of servers that have the given version category.
-
serversWithOnlineMode
Returns a list of servers that have the given version category.- Parameters:
on- Whether the servers should be online mode or not.- Returns:
- A list of servers that have the given version category.
-
withConnectVersion
Returns a list of servers that have the given version category.- Parameters:
v1Version- The connect version to filter by.- Returns:
- A list of servers that have the given version category.
-
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. All components in this record class are compared withObjects::equals(Object,Object).
-