- java.lang.Object
-
- org.mal_lang.langspec.builders.AttackStepBuilder
-
public final class AttackStepBuilder extends Object
A builder for creatingAttackStep
objects.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description AttackStepBuilder(String name, AttackStepType type, Risk risk, TtcExpression ttc, StepsBuilder requires, StepsBuilder reaches)
Constructs a newAttackStepBuilder
object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AttackStepBuilder
addTag(String tag)
Adds a tag to thisAttackStepBuilder
object.static AttackStepBuilder
fromJson(JsonObject jsonAttackStep)
Creates a newAttackStepBuilder
from aJsonObject
.MetaBuilder
getMeta()
Returns the meta info of thisAttackStepBuilder
object.String
getName()
Returns the name of thisAttackStepBuilder
object.StepsBuilder
getReaches()
Returns the reaches steps of thisAttackStepBuilder
object, ornull
if no reaches steps has been set.StepsBuilder
getRequires()
Returns the requires steps of thisAttackStepBuilder
object, ornull
if no requires steps have been set.Risk
getRisk()
Returns the risk of thisAttackStepBuilder
object, ornull
if no risk has been set.List<String>
getTags()
Returns a list of all tags in thisAttackStepBuilder
object.TtcExpression
getTtc()
Returns the TTC of thisAttackStepBuilder
object, ornull
if no TTC has been set.AttackStepType
getType()
Returns the type of thisAttackStepBuilder
object.
-
-
-
Constructor Detail
-
AttackStepBuilder
public AttackStepBuilder(String name, AttackStepType type, Risk risk, TtcExpression ttc, StepsBuilder requires, StepsBuilder reaches)
Constructs a newAttackStepBuilder
object.- Parameters:
name
- the name of the attack steptype
- the type of the attack steprisk
- the risk of the attack step, ornull
ttc
- the TTC of the attack step, ornull
requires
- the requires steps of the attack step, ornull
reaches
- the reaches steps of the attack step, ornull
- Throws:
NullPointerException
- ifname
ortype
isnull
IllegalArgumentException
- ifname
is not a valid identifier- Since:
- 1.0.0
-
-
Method Detail
-
getName
public String getName()
Returns the name of thisAttackStepBuilder
object.- Returns:
- the name of this
AttackStepBuilder
object - Since:
- 1.0.0
-
getMeta
public MetaBuilder getMeta()
Returns the meta info of thisAttackStepBuilder
object.- Returns:
- the meta info of this
AttackStepBuilder
object - Since:
- 1.0.0
-
getType
public AttackStepType getType()
Returns the type of thisAttackStepBuilder
object.- Returns:
- the type of this
AttackStepBuilder
object - Since:
- 1.0.0
-
getTags
public List<String> getTags()
Returns a list of all tags in thisAttackStepBuilder
object.- Returns:
- a list of all tags in this
AttackStepBuilder
object - Since:
- 1.0.0
-
addTag
public AttackStepBuilder addTag(String tag)
Adds a tag to thisAttackStepBuilder
object.- Parameters:
tag
- the tag to add- Returns:
- this
AttackStepBuilder
object - Throws:
NullPointerException
- iftag
isnull
IllegalArgumentException
- iftag
is not a valid identifier- Since:
- 1.0.0
-
getRisk
public Risk getRisk()
Returns the risk of thisAttackStepBuilder
object, ornull
if no risk has been set.- Returns:
- the risk of this
AttackStepBuilder
object, ornull
if no risk has been set - Since:
- 1.0.0
-
getTtc
public TtcExpression getTtc()
Returns the TTC of thisAttackStepBuilder
object, ornull
if no TTC has been set.- Returns:
- the TTC of this
AttackStepBuilder
object, ornull
if no TTC has been set - Since:
- 1.0.0
-
getRequires
public StepsBuilder getRequires()
Returns the requires steps of thisAttackStepBuilder
object, ornull
if no requires steps have been set.- Returns:
- the requires steps of this
AttackStepBuilder
object, ornull
if no requires steps have been set - Since:
- 1.0.0
-
getReaches
public StepsBuilder getReaches()
Returns the reaches steps of thisAttackStepBuilder
object, ornull
if no reaches steps has been set.- Returns:
- the reaches steps of this
AttackStepBuilder
object, ornull
if no reaches steps has been set - Since:
- 1.0.0
-
fromJson
public static AttackStepBuilder fromJson(JsonObject jsonAttackStep)
Creates a newAttackStepBuilder
from aJsonObject
.- Parameters:
jsonAttackStep
- theJsonObject
- Returns:
- a new
AttackStepBuilder
- Throws:
NullPointerException
- ifjsonAttackStep
isnull
- Since:
- 1.0.0
-
-