Record Class SessionData
java.lang.Object
java.lang.Record
lol.trq.alts.model.SessionData
- Record Components:
username- the player's usernameuuid- the player's UUID, dashedaccessToken- the session access token (empty for offline accounts)type- the protocol the account was authenticated with
public record SessionData(String username, String uuid, String accessToken, AccountType type)
extends Record
A transport-neutral description of a resolved account, handed to the host's
SessionInjector so it can install the session in whatever form its platform
uses. Deliberately free of any Minecraft or renderer type so the library stays consumer-agnostic.- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionSessionData(String username, String uuid, String accessToken, AccountType type) Creates an instance of aSessionDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaccessTokenrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.toString()Returns a description of this session with the access token redacted, so a host that logs what it was handed does not write a live credential to disk.type()Returns the value of thetyperecord component.username()Returns the value of theusernamerecord component.uuid()Returns the value of theuuidrecord component.
-
Constructor Details
-
SessionData
Creates an instance of aSessionDatarecord class.- Parameters:
username- the value for theusernamerecord componentuuid- the value for theuuidrecord componentaccessToken- the value for theaccessTokenrecord componenttype- the value for thetyperecord component
-
-
Method Details
-
toString
-
hashCode
-
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
-
uuid
-
accessToken
Returns the value of theaccessTokenrecord component.- Returns:
- the value of the
accessTokenrecord component
-
type
-