Class Asset


  • public final class Asset
    extends Object
    Immutable class representing an asset in a MAL language.
    Since:
    1.0.0
    • Method Detail

      • getName

        public String getName()
        Returns the name of this Asset object.
        Returns:
        the name of this Asset object
        Since:
        1.0.0
      • getMeta

        public Meta getMeta()
        Returns the meta info of this Asset object.
        Returns:
        the meta info of this Asset object
        Since:
        1.0.0
      • getCategory

        public Category getCategory()
        Returns the category of this Asset object.
        Returns:
        the category of this Asset object
        Since:
        1.0.0
      • isAbstract

        public boolean isAbstract()
        Returns whether this Asset object is abstract.
        Returns:
        whether this Asset object is abstract
        Since:
        1.0.0
      • hasSuperAsset

        public boolean hasSuperAsset()
        Returns whether this Asset object has a super asset.
        Returns:
        whether this Asset object has a super asset
        Since:
        1.0.0
      • getSuperAsset

        public Asset getSuperAsset()
        Returns the super asset of this Asset object.
        Returns:
        the super asset of this Asset object
        Throws:
        UnsupportedOperationException - if this Asset object does not have a super asset
        Since:
        1.0.0
      • hasLocalField

        public boolean hasLocalField​(String name)
        Returns whether name is the name of a local field in this Asset object.
        Parameters:
        name - the name of the local field
        Returns:
        whether name is the name of a local field in this Asset object
        Throws:
        NullPointerException - if name is null
        Since:
        1.0.0
      • getLocalField

        public Field getLocalField​(String name)
        Returns the local field with the name name in this Asset object.
        Parameters:
        name - the name of the local field
        Returns:
        the local field with the name name in this Asset object
        Throws:
        NullPointerException - if name is null
        IllegalArgumentException - if name is not the name of a local field in this Asset object
        Since:
        1.0.0
      • getLocalFields

        public List<Field> getLocalFields()
        Returns a list of all local fields in this Asset object.
        Returns:
        a list of all local fields in this Asset object
        Since:
        1.0.0
      • hasField

        public boolean hasField​(String name)
        Returns whether name is the name of a field in this Asset object.
        Parameters:
        name - the name of the field
        Returns:
        whether name is the name of a field in this Asset object
        Throws:
        NullPointerException - if name is null
        Since:
        1.0.0
      • getField

        public Field getField​(String name)
        Returns the field with the name name in this Asset object.
        Parameters:
        name - the name of the field
        Returns:
        the field with the name name in this Asset object
        Throws:
        NullPointerException - if name is null
        IllegalArgumentException - if name is not the name of a field in this Asset object
        Since:
        1.0.0
      • getFields

        public List<Field> getFields()
        Returns a list of all fields in this Asset object.
        Returns:
        a list of all fields in this Asset object
        Since:
        1.0.0
      • hasLocalVariable

        public boolean hasLocalVariable​(String name)
        Returns whether name is the name of a local variable in this Asset object.
        Parameters:
        name - the name of the local variable
        Returns:
        whether name is the name of a local variable in this Asset object
        Throws:
        NullPointerException - if name is null
        Since:
        1.0.0
      • getLocalVariable

        public Variable getLocalVariable​(String name)
        Returns the local variable with the name name in this Asset object.
        Parameters:
        name - the name of the local variable
        Returns:
        the local variable with the name name in this Asset object
        Throws:
        NullPointerException - if name is null
        IllegalArgumentException - if name is not the name of a local variable in this Asset object
        Since:
        1.0.0
      • getLocalVariables

        public List<Variable> getLocalVariables()
        Returns a list of all local variables in this Asset object.
        Returns:
        a list of all local variables in this Asset object
        Since:
        1.0.0
      • hasVariable

        public boolean hasVariable​(String name)
        Returns whether name is the name of a variable in this Asset object.
        Parameters:
        name - the name of the variable
        Returns:
        whether name is the name of a variable in this Asset object
        Throws:
        NullPointerException - if name is null
        Since:
        1.0.0
      • getVariable

        public Variable getVariable​(String name)
        Returns the variable with the name name in this Asset object.
        Parameters:
        name - the name of the variable
        Returns:
        the variable with the name name in this Asset object
        Throws:
        NullPointerException - if name is null
        IllegalArgumentException - if name is not the name of a variable in this Asset object
        Since:
        1.0.0
      • getVariables

        public List<Variable> getVariables()
        Returns a list of all variables in this Asset object.
        Returns:
        a list of all variables in this Asset object
        Since:
        1.0.0
      • hasLocalAttackStep

        public boolean hasLocalAttackStep​(String name)
        Returns whether name is the name of a local attack step in this Asset object.
        Parameters:
        name - the name of the local attack step
        Returns:
        whether name is the name of a local attack step in this Asset object
        Throws:
        NullPointerException - if name is null
        Since:
        1.0.0
      • getLocalAttackStep

        public AttackStep getLocalAttackStep​(String name)
        Returns the local attack step with the name name in this Asset object.
        Parameters:
        name - the name of the local attack step
        Returns:
        the local attack step with the name name in this Asset object
        Throws:
        NullPointerException - if name is null
        IllegalArgumentException - if name is not the name of a local attack step in this Asset object
        Since:
        1.0.0
      • getLocalAttackSteps

        public List<AttackStep> getLocalAttackSteps()
        Returns a list of all local attack steps in this Asset object.
        Returns:
        a list of all local attack steps in this Asset object
        Since:
        1.0.0
      • hasAttackStep

        public boolean hasAttackStep​(String name)
        Returns whether name is the name of an attack step in this Asset object.
        Parameters:
        name - the name of the attack step
        Returns:
        whether name is the name of an attack step in this Asset object
        Throws:
        NullPointerException - if name is null
        Since:
        1.0.0
      • getAttackStep

        public AttackStep getAttackStep​(String name)
        Returns the attack step with the name name in this Asset object.
        Parameters:
        name - the name of the attack step
        Returns:
        the attack step with the name name in this Asset object
        Throws:
        NullPointerException - if name is null
        IllegalArgumentException - if name is not the name of an attack step in this Asset object
        Since:
        1.0.0
      • getAttackSteps

        public List<AttackStep> getAttackSteps()
        Returns a list of all attack steps in this Asset object.
        Returns:
        a list of all attack steps in this Asset object
        Since:
        1.0.0
      • hasLocalSvgIcon

        public boolean hasLocalSvgIcon()
        Returns whether this Asset object has a local SVG icon.
        Returns:
        whether this Asset object has a local SVG icon
        Since:
        1.0.0
      • getLocalSvgIcon

        public byte[] getLocalSvgIcon()
        Returns the local SVG icon of this Asset object.
        Returns:
        the local SVG icon of this Asset object
        Throws:
        UnsupportedOperationException - if this Asset object does not have a local SVG icon
        Since:
        1.0.0
      • hasSvgIcon

        public boolean hasSvgIcon()
        Returns whether this Asset object has an SVG icon.
        Returns:
        whether this Asset object has an SVG icon
        Since:
        1.0.0
      • getSvgIcon

        public byte[] getSvgIcon()
        Returns the SVG icon of this Asset object.
        Returns:
        the SVG icon of this Asset object
        Throws:
        UnsupportedOperationException - if this Asset object does not have an SVG icon
        Since:
        1.0.0
      • hasLocalPngIcon

        public boolean hasLocalPngIcon()
        Returns whether this Asset object has a local PNG icon.
        Returns:
        whether this Asset object has a local PNG icon
        Since:
        1.0.0
      • getLocalPngIcon

        public byte[] getLocalPngIcon()
        Returns the local PNG icon of this Asset object.
        Returns:
        the local PNG icon of this Asset object
        Throws:
        UnsupportedOperationException - if this Asset object does not have a local PNG icon
        Since:
        1.0.0
      • hasPngIcon

        public boolean hasPngIcon()
        Returns whether this Asset object has an PNG icon.
        Returns:
        whether this Asset object has an PNG icon
        Since:
        1.0.0
      • getPngIcon

        public byte[] getPngIcon()
        Returns the PNG icon of this Asset object.
        Returns:
        the PNG icon of this Asset object
        Throws:
        UnsupportedOperationException - if this Asset object does not have an PNG icon
        Since:
        1.0.0
      • isSubTypeOf

        public boolean isSubTypeOf​(Asset other)
        Returns whether this Asset object is a sub type of other.
        Parameters:
        other - another Asset object
        Returns:
        whether this Asset object is a sub type of other
        Throws:
        NullPointerException - if other is null
        Since:
        1.0.0
      • leastUpperBound

        public static Asset leastUpperBound​(Asset asset1,
                                            Asset asset2)
        Returns the least upper bound of asset1 and asset2, or null if asset1 and asset2 have no upper bound.
        Parameters:
        asset1 - an Asset object
        asset2 - an Asset object
        Returns:
        the least upper bound of asset1 and asset2, or null if asset1 and asset2 have no upper bound
        Throws:
        NullPointerException - if asset1 or asset2 is null
        Since:
        1.0.0