Class JsonBackedLanguage
java.lang.Object
be.seeseemelk.mockbukkit.adventure.JsonBackedLanguage
- All Implemented Interfaces:
Language
-
Nested Class Summary
Nested classes/interfaces inherited from interface be.seeseemelk.mockbukkit.adventure.Language
Language.LanguageType -
Constructor Summary
ConstructorsConstructorDescriptionJsonBackedLanguage(com.google.gson.JsonObject jsonObject) Accepts the following data of json objects: -
Method Summary
-
Constructor Details
-
JsonBackedLanguage
public JsonBackedLanguage(com.google.gson.JsonObject jsonObject) Accepts the following data of json objects:{ "rightToLeft": true "translations": { "foo": "translated foo" ... } }- Parameters:
jsonObject- A json object containing all the necessary data and in the right format
-
-
Method Details
-
getOrDefault
- Specified by:
getOrDefaultin interfaceLanguage- Parameters:
key- The translation keyfallback- Fallback translation- Returns:
- A translated message
-
has
-
isRightToLeft
public boolean isRightToLeft()- Specified by:
isRightToLeftin interfaceLanguage- Returns:
- Whether the language is rad from right to left
-