Module be.yildizgames.common.client
Class TranslationKey
- java.lang.Object
-
- be.yildizgames.common.client.translation.TranslationKey
-
public class TranslationKey extends Object
A TranslationKey is a value meant to be translated, it is composed of a key, and optional arguments.The class is mutable to improve performances, but only accessible from its package.
- Author:
- Grégory Van den Borre specfield key:String:TranslationKey to translate. specfield args:Object[]:Optional arguments.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTranslationKey.MultiKeyA multi key is composed of several keys to provide the possibility to use several translation in one go.
-
Method Summary
Modifier and Type Method Description booleanequals(Object o)static TranslationKey.MultiKeyget(TranslationKey... keys)Create a new instance of MultiKey to use several translation at once.static TranslationKeyget(String key)Create a new instance of TranslationKey with a key and no arguments.static TranslationKeyget(String key, Object... args)Create a new instance of TranslationKey with a key and arguments.static TranslationKey.MultiKeyget(List<TranslationKey> keys)inthashCode()booleanisEmpty()Check if the key is empty.
-
-
-
Method Detail
-
get
public static TranslationKey get(String key)
Create a new instance of TranslationKey with a key and no arguments.- Parameters:
key- TranslationKey to translate.- Returns:
- The build TranslationKey.
-
get
public static TranslationKey get(String key, Object... args)
Create a new instance of TranslationKey with a key and arguments.- Parameters:
key- TranslationKey to translate.args- Arguments to use for translation.- Returns:
- The build TranslationKey.
-
get
public static TranslationKey.MultiKey get(TranslationKey... keys)
Create a new instance of MultiKey to use several translation at once.- Parameters:
keys- Keys to translate, must be at least one, and no null values is allowed.- Returns:
- The build MultiKey.
-
get
public static TranslationKey.MultiKey get(List<TranslationKey> keys)
-
isEmpty
public boolean isEmpty()
Check if the key is empty.- Returns:
trueif the key is empty.
-
-