Class Lang


  • public final class Lang
    extends Object
    Immutable class representing a MAL language.
    Since:
    1.0.0
    • Method Detail

      • hasDefine

        public boolean hasDefine​(String key)
        Returns whether key is the key of a define in this Lang object.
        Parameters:
        key - the key of the define
        Returns:
        whether key is the key of a define in this Lang object
        Throws:
        NullPointerException - if key is null
        Since:
        1.0.0
      • getDefine

        public String getDefine​(String key)
        Returns the value of the define with the key key in this Lang object.
        Parameters:
        key - the key of the define
        Returns:
        the value of the define with the key key in this Lang object
        Throws:
        NullPointerException - if key is null
        IllegalArgumentException - if key is not the key of a define in this Lang object
        Since:
        1.0.0
      • getDefines

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

        public boolean hasCategory​(String name)
        Returns whether name is the name of a category in this Lang object.
        Parameters:
        name - the name of the category
        Returns:
        whether name is the name of a category in this Lang object
        Throws:
        NullPointerException - if name is null
        Since:
        1.0.0
      • getCategory

        public Category getCategory​(String name)
        Returns the category with the name name in this Lang object.
        Parameters:
        name - the name of the category
        Returns:
        the category with the name name in this Lang object
        Throws:
        NullPointerException - if name is null
        IllegalArgumentException - if name is not the name of a category in this Lang object
        Since:
        1.0.0
      • getCategories

        public List<Category> getCategories()
        Returns a list of all categories in this Lang object.
        Returns:
        a list of all categories in this Lang object
        Since:
        1.0.0
      • hasAsset

        public boolean hasAsset​(String name)
        Returns whether name is the name of an asset in this Lang object.
        Parameters:
        name - the name of the asset
        Returns:
        whether name is the name of an asset in this Lang object
        Throws:
        NullPointerException - if name is null
        Since:
        1.0.0
      • getAsset

        public Asset getAsset​(String name)
        Returns the asset with the name name in this Lang object.
        Parameters:
        name - the name of the asset
        Returns:
        the asset with the name name in this Lang object
        Throws:
        NullPointerException - if name is null
        IllegalArgumentException - if name is not the name of an asset in this Lang object
        Since:
        1.0.0
      • getAssets

        public List<Asset> getAssets()
        Returns a list of all assets in this Lang object.
        Returns:
        a list of all assets in this Lang object
        Since:
        1.0.0
      • getAssociations

        public List<Association> getAssociations()
        Returns a list of all associations in this Lang object.
        Returns:
        a list of all associations in this Lang object
        Since:
        1.0.0
      • hasLicense

        public boolean hasLicense()
        Returns whether this Lang object has a license.
        Returns:
        whether this Lang object has a license
        Since:
        1.0.0
      • getLicense

        public String getLicense()
        Returns the license of this Lang object.
        Returns:
        the license of this Lang object
        Throws:
        UnsupportedOperationException - if this Lang object does not have a license
        Since:
        1.0.0
      • hasNotice

        public boolean hasNotice()
        Returns whether this Lang object has a notice.
        Returns:
        whether this Lang object has a notice
        Since:
        1.0.0
      • getNotice

        public String getNotice()
        Returns the notice of this Lang object.
        Returns:
        the notice of this Lang object
        Throws:
        UnsupportedOperationException - if this Lang object does not have a notice
        Since:
        1.0.0
      • toJson

        public JsonObject toJson()
        Returns the JSON representation of this Lang object.
        Returns:
        the JSON representation of this Lang object
        Since:
        1.0.0