Record Class LanguageSetting
- Record Components:
name
- the raw language or locale tag string, nevernull
This record encapsulates a string such as en-US
or fr-FR
,
typically sourced from the plugin's config.yml
. It is used by
localization components such as LanguageProvider
and downstream
language or formatting tools to select appropriate resource files, and may
also be queried for the locale setting. This allows server operators to include
only one setting for both language file and locale in the plugin config.yml
file, assuming the chosen setting conforms to a valid IETF language tag.
The name
field is expected to follow the IETF BCP 47 language tag format
(e.g., en-US
, de-DE
), although enforcement is deferred to consumers,
to allow custom language file names that do not interfere with existing or provided
language file names.
-
Constructor Summary
ConstructorsConstructorDescriptionLanguageSetting
(@NotNull String name) Creates an instance of aLanguageSetting
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.@NotNull String
name()
Returns the value of thename
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
LanguageSetting
Creates an instance of aLanguageSetting
record class.- Parameters:
name
- the value for thename
record component
-
-
Method Details
-
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)
. -
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-