Interface LocalizationKey
public interface LocalizationKey
Represents a localization key used for retrieving localized messages.
By default, the key is derived from Object.toString() and is converted
to lowercase with '$' replaced by '.'.
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NotNull Stringkey()Returns the key for this localization.static LocalizationKeyCreates a new LocalizationKey with the specified key.static LocalizationKeyCreates a new LocalizationKey with the specified key and parameters.default String[]Returns the parameters associated with this localization key.
-
Method Details
-
of
Creates a new LocalizationKey with the specified key.If you want to use parameters, use
of(String, String...)instead.- Parameters:
key- the key for the localization- Returns:
- a new LocalizationKey instance
-
of
Creates a new LocalizationKey with the specified key and parameters.- Parameters:
key- the key for the localizationparameters- the parameters to be used in the localization- Returns:
- a new LocalizationKey instance with parameters
-
key
Returns the key for this localization.- Returns:
- the key as a lowercase string with '$' replaced by '.'
-
parameters
Returns the parameters associated with this localization key. If no parameters are defined, an empty array is returned.You can use the
Parametersannotation to define parameters for a localization key.- Returns:
- an array of parameters
-