Record Class PlayerRelation
java.lang.Object
java.lang.Record
org.rusherhack.client.api.utils.objects.PlayerRelation
- All Implemented Interfaces:
org.rusherhack.core.serialize.ISerializable<com.google.gson.JsonElement>,org.rusherhack.core.serialize.JsonSerializable
public record PlayerRelation(String username, String alias, PlayerRelation.State state)
extends Record
implements org.rusherhack.core.serialize.JsonSerializable
TODO: UUID based
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPlayerRelation(String username, String alias, PlayerRelation.State state) Creates an instance of aPlayerRelationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionalias()Returns the value of thealiasrecord component.booleandeserialize(com.google.gson.JsonElement jsonElement) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.com.google.gson.JsonElementstate()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.username()Returns the value of theusernamerecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.rusherhack.core.serialize.ISerializable
shouldAutoSave, shouldSerialize
-
Constructor Details
-
PlayerRelation
Creates an instance of aPlayerRelationrecord class.- Parameters:
username- the value for theusernamerecord componentalias- the value for thealiasrecord componentstate- the value for thestaterecord component
-
-
Method Details
-
serialize
public com.google.gson.JsonElement serialize()- Specified by:
serializein interfaceorg.rusherhack.core.serialize.ISerializable<com.google.gson.JsonElement>
-
deserialize
public boolean deserialize(com.google.gson.JsonElement jsonElement) - Specified by:
deserializein interfaceorg.rusherhack.core.serialize.ISerializable<com.google.gson.JsonElement>
-
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). -
username
Returns the value of theusernamerecord component.- Returns:
- the value of the
usernamerecord component
-
alias
Returns the value of thealiasrecord component.- Returns:
- the value of the
aliasrecord component
-
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-