- java.lang.Object
-
- org.mal_lang.langspec.builders.LangBuilder
-
-
Constructor Summary
Constructors Constructor Description LangBuilder()Constructs a newLangBuilderobject.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LangBuilderaddAsset(AssetBuilder asset)Adds an asset to thisLangBuilderobject.LangBuilderaddAssociation(AssociationBuilder association)Adds an association to thisLangBuilderobject.LangBuilderaddCategory(CategoryBuilder category)Adds a category to thisLangBuilderobject.LangBuilderaddDefine(String key, String value)Adds a define to thisLangBuilderobject.static LangBuilderfromJson(JsonObject jsonLang)Creates a newLangBuilderfrom aJsonObject.static LangBuilderfromJson(JsonObject jsonLang, String license, String notice)Creates a newLangBuilderfrom aJsonObject.static LangBuilderfromJson(JsonObject jsonLang, Map<String,byte[]> svgIcons, Map<String,byte[]> pngIcons)Creates a newLangBuilderfrom aJsonObject.static LangBuilderfromJson(JsonObject jsonLang, Map<String,byte[]> svgIcons, Map<String,byte[]> pngIcons, String license, String notice)Creates a newLangBuilderfrom aJsonObject.List<AssetBuilder>getAssets()Returns a list of all assets in thisLangBuilderobject.List<AssociationBuilder>getAssociations()Returns a list of all associations in thisLangBuilderobject.List<CategoryBuilder>getCategories()Returns a list of all categories in thisLangBuilderobject.Map<String,String>getDefines()Returns all defines in thisLangBuilderobject.StringgetLicense()Returns the license of thisLangBuilderobject, ornullif no license has been set.StringgetNotice()Returns the notice of thisLangBuilderobject, ornullif no notice has been set.LangBuildersetLicense(String license)Sets the license of thisLangBuilderobject.LangBuildersetNotice(String notice)Sets the notice of thisLangBuilderobject.
-
-
-
Method Detail
-
getDefines
public Map<String,String> getDefines()
Returns all defines in thisLangBuilderobject.- Returns:
- all defines in this
LangBuilderobject - Since:
- 1.0.0
-
addDefine
public LangBuilder addDefine(String key, String value)
Adds a define to thisLangBuilderobject.- Parameters:
key- the key of the definevalue- the value of the define- Returns:
- this
LangBuilderobject - Throws:
NullPointerException- ifkeyorvalueisnullIllegalArgumentException- ifkeyis not a valid identifier- Since:
- 1.0.0
-
getCategories
public List<CategoryBuilder> getCategories()
Returns a list of all categories in thisLangBuilderobject.- Returns:
- a list of all categories in this
LangBuilderobject - Since:
- 1.0.0
-
addCategory
public LangBuilder addCategory(CategoryBuilder category)
Adds a category to thisLangBuilderobject.- Parameters:
category- the category to add- Returns:
- this
LangBuilderobject - Throws:
NullPointerException- ifcategoryisnull- Since:
- 1.0.0
-
getAssets
public List<AssetBuilder> getAssets()
Returns a list of all assets in thisLangBuilderobject.- Returns:
- a list of all assets in this
LangBuilderobject - Since:
- 1.0.0
-
addAsset
public LangBuilder addAsset(AssetBuilder asset)
Adds an asset to thisLangBuilderobject.- Parameters:
asset- the asset to add- Returns:
- this
LangBuilderobject - Throws:
NullPointerException- ifassetisnull- Since:
- 1.0.0
-
getAssociations
public List<AssociationBuilder> getAssociations()
Returns a list of all associations in thisLangBuilderobject.- Returns:
- a list of all associations in this
LangBuilderobject - Since:
- 1.0.0
-
addAssociation
public LangBuilder addAssociation(AssociationBuilder association)
Adds an association to thisLangBuilderobject.- Parameters:
association- the association to add- Returns:
- this
LangBuilderobject - Throws:
NullPointerException- ifassociationisnull- Since:
- 1.0.0
-
getLicense
public String getLicense()
Returns the license of thisLangBuilderobject, ornullif no license has been set.- Returns:
- the license of this
LangBuilderobject, ornullif no license has been set - Since:
- 1.0.0
-
setLicense
public LangBuilder setLicense(String license)
Sets the license of thisLangBuilderobject.- Parameters:
license- the license to set- Returns:
- this
LangBuilderobject - Throws:
NullPointerException- iflicenseisnull- Since:
- 1.0.0
-
getNotice
public String getNotice()
Returns the notice of thisLangBuilderobject, ornullif no notice has been set.- Returns:
- the notice of this
LangBuilderobject, ornullif no notice has been set - Since:
- 1.0.0
-
setNotice
public LangBuilder setNotice(String notice)
Sets the notice of thisLangBuilderobject.- Parameters:
notice- the notice to set- Returns:
- this
LangBuilderobject - Throws:
NullPointerException- ifnoticeisnull- Since:
- 1.0.0
-
fromJson
public static LangBuilder fromJson(JsonObject jsonLang)
Creates a newLangBuilderfrom aJsonObject.- Parameters:
jsonLang- theJsonObject- Returns:
- a new
LangBuilder - Throws:
NullPointerException- ifjsonLangisnull- Since:
- 1.0.0
-
fromJson
public static LangBuilder fromJson(JsonObject jsonLang, Map<String,byte[]> svgIcons, Map<String,byte[]> pngIcons)
Creates a newLangBuilderfrom aJsonObject.- Parameters:
jsonLang- theJsonObjectsvgIcons- the SVG icons of the languagepngIcons- the PNG icons of the language- Returns:
- a new
LangBuilder - Throws:
NullPointerException- ifjsonLang,svgIcons, orpngIconsisnull- Since:
- 1.0.0
-
fromJson
public static LangBuilder fromJson(JsonObject jsonLang, String license, String notice)
Creates a newLangBuilderfrom aJsonObject.- Parameters:
jsonLang- theJsonObjectlicense- the license of the language, ornullnotice- the notice of the language, ornull- Returns:
- a new
LangBuilder - Throws:
NullPointerException- ifjsonLangisnull- Since:
- 1.0.0
-
fromJson
public static LangBuilder fromJson(JsonObject jsonLang, Map<String,byte[]> svgIcons, Map<String,byte[]> pngIcons, String license, String notice)
Creates a newLangBuilderfrom aJsonObject.- Parameters:
jsonLang- theJsonObjectsvgIcons- the SVG icons of the languagepngIcons- the PNG icons of the languagelicense- the license of the language, ornullnotice- the notice of the language, ornull- Returns:
- a new
LangBuilder - Throws:
NullPointerException- ifjsonLang,svgIcons, orpngIconsisnull- Since:
- 1.0.0
-
-