Class AssetBuilder


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

      • AssetBuilder

        public AssetBuilder​(String name,
                            String category,
                            boolean isAbstract,
                            String superAsset)
        Constructs a new AssetBuilder object.
        Parameters:
        name - the name of the asset
        category - the category of the asset
        isAbstract - whether the asset is abstract
        superAsset - the super asset of the asset, or null
        Throws:
        NullPointerException - if name or category is null
        IllegalArgumentException - if name or category is not a valid identifier
        Since:
        1.0.0
    • Method Detail

      • getName

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

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

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

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

        public String getSuperAsset()
        Returns the super asset of this AssetBuilder object, or null if no super asset has been set.
        Returns:
        the super asset of this AssetBuilder object, or null if no super asset has been set
        Since:
        1.0.0
      • getVariables

        public List<VariableBuilder> getVariables()
        Returns a list of all variables in this AssetBuilder object.
        Returns:
        a list of all variables in this AssetBuilder object
        Since:
        1.0.0
      • addVariable

        public AssetBuilder addVariable​(VariableBuilder variable)
        Adds a variable to this AssetBuilder object.
        Parameters:
        variable - the variable to add
        Returns:
        this AssetBuilder object
        Throws:
        NullPointerException - if variable is null
        Since:
        1.0.0
      • getAttackSteps

        public List<AttackStepBuilder> getAttackSteps()
        Returns a list of all attack steps in this AssetBuilder object.
        Returns:
        a list of all attack steps in this AssetBuilder object
        Since:
        1.0.0
      • addAttackStep

        public AssetBuilder addAttackStep​(AttackStepBuilder attackStep)
        Adds an attack step to this AssetBuilder object.
        Parameters:
        attackStep - the attack step to add
        Returns:
        this AssetBuilder object
        Throws:
        NullPointerException - if attackStep is null
        Since:
        1.0.0
      • getSvgIcon

        public byte[] getSvgIcon()
        Returns the SVG icon of this AssetBuilder object, or null if no SVG icon has been set.
        Returns:
        the SVG icon of this AssetBuilder object, or null if no SVG icon has been set
        Since:
        1.0.0
      • setSvgIcon

        public AssetBuilder setSvgIcon​(byte[] svgIcon)
        Sets the SVG icon of this AssetBuilder object.
        Parameters:
        svgIcon - the SVG icon to set
        Returns:
        this AssetBuilder object
        Throws:
        NullPointerException - if svgIcon is null
        Since:
        1.0.0
      • getPngIcon

        public byte[] getPngIcon()
        Returns the PNG icon of this AssetBuilder object, or null if no PNG icon has been set.
        Returns:
        the PNG icon of this AssetBuilder object, or null if no PNG icon has been set
        Since:
        1.0.0
      • setPngIcon

        public AssetBuilder setPngIcon​(byte[] pngIcon)
        Sets the PNG icon of this AssetBuilder object.
        Parameters:
        pngIcon - the PNG icon to set
        Returns:
        this AssetBuilder object
        Throws:
        NullPointerException - if pngIcon is null
        Since:
        1.0.0