Class LangBuilder


  • public final class LangBuilder
    extends Object
    A builder for creating Lang objects.
    Since:
    1.0.0
    • Constructor Detail

      • LangBuilder

        public LangBuilder()
        Constructs a new LangBuilder object.
        Since:
        1.0.0
    • Method Detail

      • getDefines

        public Map<String,​String> getDefines()
        Returns all defines in this LangBuilder object.
        Returns:
        all defines in this LangBuilder object
        Since:
        1.0.0
      • addDefine

        public LangBuilder addDefine​(String key,
                                     String value)
        Adds a define to this LangBuilder object.
        Parameters:
        key - the key of the define
        value - the value of the define
        Returns:
        this LangBuilder object
        Throws:
        NullPointerException - if key or value is null
        IllegalArgumentException - if key is not a valid identifier
        Since:
        1.0.0
      • getCategories

        public List<CategoryBuilder> getCategories()
        Returns a list of all categories in this LangBuilder object.
        Returns:
        a list of all categories in this LangBuilder object
        Since:
        1.0.0
      • addCategory

        public LangBuilder addCategory​(CategoryBuilder category)
        Adds a category to this LangBuilder object.
        Parameters:
        category - the category to add
        Returns:
        this LangBuilder object
        Throws:
        NullPointerException - if category is null
        Since:
        1.0.0
      • getAssets

        public List<AssetBuilder> getAssets()
        Returns a list of all assets in this LangBuilder object.
        Returns:
        a list of all assets in this LangBuilder object
        Since:
        1.0.0
      • addAsset

        public LangBuilder addAsset​(AssetBuilder asset)
        Adds an asset to this LangBuilder object.
        Parameters:
        asset - the asset to add
        Returns:
        this LangBuilder object
        Throws:
        NullPointerException - if asset is null
        Since:
        1.0.0
      • getAssociations

        public List<AssociationBuilder> getAssociations()
        Returns a list of all associations in this LangBuilder object.
        Returns:
        a list of all associations in this LangBuilder object
        Since:
        1.0.0
      • addAssociation

        public LangBuilder addAssociation​(AssociationBuilder association)
        Adds an association to this LangBuilder object.
        Parameters:
        association - the association to add
        Returns:
        this LangBuilder object
        Throws:
        NullPointerException - if association is null
        Since:
        1.0.0
      • getLicense

        public String getLicense()
        Returns the license of this LangBuilder object, or null if no license has been set.
        Returns:
        the license of this LangBuilder object, or null if no license has been set
        Since:
        1.0.0
      • setLicense

        public LangBuilder setLicense​(String license)
        Sets the license of this LangBuilder object.
        Parameters:
        license - the license to set
        Returns:
        this LangBuilder object
        Throws:
        NullPointerException - if license is null
        Since:
        1.0.0
      • getNotice

        public String getNotice()
        Returns the notice of this LangBuilder object, or null if no notice has been set.
        Returns:
        the notice of this LangBuilder object, or null if no notice has been set
        Since:
        1.0.0
      • setNotice

        public LangBuilder setNotice​(String notice)
        Sets the notice of this LangBuilder object.
        Parameters:
        notice - the notice to set
        Returns:
        this LangBuilder object
        Throws:
        NullPointerException - if notice is null
        Since:
        1.0.0
      • fromJson

        public static LangBuilder fromJson​(JsonObject jsonLang,
                                           Map<String,​byte[]> svgIcons,
                                           Map<String,​byte[]> pngIcons)
        Creates a new LangBuilder from a JsonObject.
        Parameters:
        jsonLang - the JsonObject
        svgIcons - the SVG icons of the language
        pngIcons - the PNG icons of the language
        Returns:
        a new LangBuilder
        Throws:
        NullPointerException - if jsonLang, svgIcons, or pngIcons is null
        Since:
        1.0.0
      • fromJson

        public static LangBuilder fromJson​(JsonObject jsonLang,
                                           String license,
                                           String notice)
        Creates a new LangBuilder from a JsonObject.
        Parameters:
        jsonLang - the JsonObject
        license - the license of the language, or null
        notice - the notice of the language, or null
        Returns:
        a new LangBuilder
        Throws:
        NullPointerException - if jsonLang is null
        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 new LangBuilder from a JsonObject.
        Parameters:
        jsonLang - the JsonObject
        svgIcons - the SVG icons of the language
        pngIcons - the PNG icons of the language
        license - the license of the language, or null
        notice - the notice of the language, or null
        Returns:
        a new LangBuilder
        Throws:
        NullPointerException - if jsonLang, svgIcons, or pngIcons is null
        Since:
        1.0.0