Record Class ProfileApiConfig
java.lang.Object
java.lang.Record
me.pauleff.common.handlers.uuid.ProfileApiConfig
public record ProfileApiConfig(String customApiBaseUrl, String retrieveUuidUrl, String retrieveNameUrl)
extends Record
Immutable endpoint configuration for online Minecraft profile lookups.
Endpoint-specific URLs override the shared custom base URL, which in turn overrides the Mojang / Minecraft Services defaults.
-
Constructor Summary
ConstructorsConstructorDescriptionProfileApiConfig(String customApiBaseUrl, String retrieveUuidUrl, String retrieveNameUrl) Creates a config with normalized URL fields. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecustomApiBaseUrlrecord component.static ProfileApiConfigdefaults()Returns a config that uses Mojang defaults for all lookups.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.nameToUuidUrl(String name) Builds the request URL used to resolve a player name to an online UUID.Returns the value of theretrieveNameUrlrecord component.Returns the value of theretrieveUuidUrlrecord component.final StringtoString()Returns a string representation of this record class.uuidToNameUrl(UUID uuid) Builds the request URL used to resolve an online UUID to a player name.Returns a copy with a different shared custom API base URL.Returns a copy with a different UUID-to-name endpoint prefix.Returns a copy with a different name-to-UUID endpoint prefix.
-
Constructor Details
-
ProfileApiConfig
Creates a config with normalized URL fields.- Parameters:
customApiBaseUrl- shared custom API base URL, ornull/blank to unsetretrieveUuidUrl- name-to-UUID endpoint prefix, ornull/blank to unsetretrieveNameUrl- UUID-to-name endpoint prefix, ornull/blank to unset
-
-
Method Details
-
defaults
Returns a config that uses Mojang defaults for all lookups.- Returns:
- the default profile API configuration
-
withCustomApiBaseUrl
Returns a copy with a different shared custom API base URL.- Parameters:
url- the custom API base URL, ornull/blank to clear it- Returns:
- a new config with the updated base URL
-
withRetrieveUuidUrl
Returns a copy with a different name-to-UUID endpoint prefix.When set, this overrides
customApiBaseUrl()and the default Mojang endpoint. The player name is appended to the given URL.- Parameters:
url- the custom retrieve-UUID URL prefix, ornull/blank to clear it- Returns:
- a new config with the updated retrieve-UUID URL
-
withRetrieveNameUrl
Returns a copy with a different UUID-to-name endpoint prefix.When set, this overrides
customApiBaseUrl()and the default Minecraft Services endpoint. The UUID string is appended to the given URL.- Parameters:
url- the custom retrieve-name URL prefix, ornull/blank to clear it- Returns:
- a new config with the updated retrieve-name URL
-
nameToUuidUrl
-
uuidToNameUrl
-
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). -
customApiBaseUrl
Returns the value of thecustomApiBaseUrlrecord component.- Returns:
- the value of the
customApiBaseUrlrecord component
-
retrieveUuidUrl
Returns the value of theretrieveUuidUrlrecord component.- Returns:
- the value of the
retrieveUuidUrlrecord component
-
retrieveNameUrl
Returns the value of theretrieveNameUrlrecord component.- Returns:
- the value of the
retrieveNameUrlrecord component
-