Record Class MinecraftAccount
java.lang.Object
java.lang.Record
com.soulfiremc.server.account.MinecraftAccount
- Record Components:
authType- The type of authenticationprofileId- Identifier that uniquely identifies the accountlastKnownName- The last known name of the accountaccountData- The data of the account (values depend on the authType)settings- Per-bot settingspersistentMetadata- Persistent metadata stored with the account
- All Implemented Interfaces:
SettingsSource.Stem<SettingsSource.Bot>
public record MinecraftAccount(AuthType authType, UUID profileId, String lastKnownName, AccountData accountData, @Nullable Map<String, Map<String, com.google.gson.JsonElement>> settings, @Nullable Map<String, Map<String, com.google.gson.JsonElement>> persistentMetadata)
extends Record
implements SettingsSource.Stem<SettingsSource.Bot>
Represents an authenticated MC account. This can be a premium, offline or bedrock account. Beware
that the profileId is not a valid online UUID for offline and bedrock accounts.
-
Constructor Summary
ConstructorsConstructorDescriptionMinecraftAccount(AuthType authType, UUID profileId, String lastKnownName, AccountData accountData, @Nullable Map<String, Map<String, com.google.gson.JsonElement>> settings, @Nullable Map<String, Map<String, com.google.gson.JsonElement>> persistentMetadata) Creates an instance of aMinecraftAccountrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaccountDatarecord component.authType()Returns the value of theauthTyperecord component.final booleanIndicates whether some other object is "equal to" this one.static MinecraftAccountfromProto(MinecraftAccountProto account) final inthashCode()Returns a hash code value for this object.Returns the value of thelastKnownNamerecord component.Returns the value of thepersistentMetadatarecord component.Returns the value of theprofileIdrecord component.settings()Returns the value of thesettingsrecord component.toProto()toString()Returns a string representation of this record class.@NotNull MinecraftAccountwithAccountData(AccountData accountData) @NotNull MinecraftAccountwithAuthType(AuthType authType) @NotNull MinecraftAccountwithLastKnownName(String lastKnownName) @NotNull MinecraftAccountwithPersistentMetadata(@Nullable Map<String, Map<String, com.google.gson.JsonElement>> persistentMetadata) @NotNull MinecraftAccountwithProfileId(UUID profileId) @NotNull MinecraftAccountwithSettings(@Nullable Map<String, Map<String, com.google.gson.JsonElement>> settings) Methods inherited from interface SettingsSource.Stem
get, settingsToProto
-
Constructor Details
-
MinecraftAccount
public MinecraftAccount(AuthType authType, UUID profileId, String lastKnownName, AccountData accountData, @Nullable Map<String, Map<String, com.google.gson.JsonElement>> settings, @Nullable Map<String, Map<String, com.google.gson.JsonElement>> persistentMetadata) Creates an instance of aMinecraftAccountrecord class.- Parameters:
authType- the value for theauthTyperecord componentprofileId- the value for theprofileIdrecord componentlastKnownName- the value for thelastKnownNamerecord componentaccountData- the value for theaccountDatarecord componentsettings- the value for thesettingsrecord componentpersistentMetadata- the value for thepersistentMetadatarecord component
-
-
Method Details
-
fromProto
-
toString
-
toProto
-
withAuthType
- Returns:
this.
-
withProfileId
- Returns:
this.
-
withLastKnownName
- Returns:
this.
-
withAccountData
- Returns:
this.
-
withSettings
@NotNull public @NotNull MinecraftAccount withSettings(@Nullable Map<String, Map<String, com.google.gson.JsonElement>> settings) - Returns:
this.
-
withPersistentMetadata
@NotNull public @NotNull MinecraftAccount withPersistentMetadata(@Nullable Map<String, Map<String, com.google.gson.JsonElement>> persistentMetadata) - Returns:
this.
-
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). -
authType
-
profileId
-
lastKnownName
Returns the value of thelastKnownNamerecord component.- Returns:
- the value of the
lastKnownNamerecord component
-
accountData
Returns the value of theaccountDatarecord component.- Returns:
- the value of the
accountDatarecord component
-
settings
Returns the value of thesettingsrecord component.- Specified by:
settingsin interfaceSettingsSource.Stem<SettingsSource.Bot>- Returns:
- the value of the
settingsrecord component
-
persistentMetadata
Returns the value of thepersistentMetadatarecord component.- Returns:
- the value of the
persistentMetadatarecord component
-