- java.lang.Object
-
- org.mal_lang.langspec.builders.AttackStepBuilder
-
public final class AttackStepBuilder extends Object
A builder for creatingAttackStepobjects.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description AttackStepBuilder(String name, AttackStepType type, Risk risk, TtcExpression ttc, StepsBuilder requires, StepsBuilder reaches)Constructs a newAttackStepBuilderobject.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AttackStepBuilderaddTag(String tag)Adds a tag to thisAttackStepBuilderobject.static AttackStepBuilderfromJson(JsonObject jsonAttackStep)Creates a newAttackStepBuilderfrom aJsonObject.MetaBuildergetMeta()Returns the meta info of thisAttackStepBuilderobject.StringgetName()Returns the name of thisAttackStepBuilderobject.StepsBuildergetReaches()Returns the reaches steps of thisAttackStepBuilderobject, ornullif no reaches steps has been set.StepsBuildergetRequires()Returns the requires steps of thisAttackStepBuilderobject, ornullif no requires steps have been set.RiskgetRisk()Returns the risk of thisAttackStepBuilderobject, ornullif no risk has been set.List<String>getTags()Returns a list of all tags in thisAttackStepBuilderobject.TtcExpressiongetTtc()Returns the TTC of thisAttackStepBuilderobject, ornullif no TTC has been set.AttackStepTypegetType()Returns the type of thisAttackStepBuilderobject.
-
-
-
Constructor Detail
-
AttackStepBuilder
public AttackStepBuilder(String name, AttackStepType type, Risk risk, TtcExpression ttc, StepsBuilder requires, StepsBuilder reaches)
Constructs a newAttackStepBuilderobject.- Parameters:
name- the name of the attack steptype- the type of the attack steprisk- the risk of the attack step, ornullttc- the TTC of the attack step, ornullrequires- the requires steps of the attack step, ornullreaches- the reaches steps of the attack step, ornull- Throws:
NullPointerException- ifnameortypeisnullIllegalArgumentException- ifnameis not a valid identifier- Since:
- 1.0.0
-
-
Method Detail
-
getName
public String getName()
Returns the name of thisAttackStepBuilderobject.- Returns:
- the name of this
AttackStepBuilderobject - Since:
- 1.0.0
-
getMeta
public MetaBuilder getMeta()
Returns the meta info of thisAttackStepBuilderobject.- Returns:
- the meta info of this
AttackStepBuilderobject - Since:
- 1.0.0
-
getType
public AttackStepType getType()
Returns the type of thisAttackStepBuilderobject.- Returns:
- the type of this
AttackStepBuilderobject - Since:
- 1.0.0
-
getTags
public List<String> getTags()
Returns a list of all tags in thisAttackStepBuilderobject.- Returns:
- a list of all tags in this
AttackStepBuilderobject - Since:
- 1.0.0
-
addTag
public AttackStepBuilder addTag(String tag)
Adds a tag to thisAttackStepBuilderobject.- Parameters:
tag- the tag to add- Returns:
- this
AttackStepBuilderobject - Throws:
NullPointerException- iftagisnullIllegalArgumentException- iftagis not a valid identifier- Since:
- 1.0.0
-
getRisk
public Risk getRisk()
Returns the risk of thisAttackStepBuilderobject, ornullif no risk has been set.- Returns:
- the risk of this
AttackStepBuilderobject, ornullif no risk has been set - Since:
- 1.0.0
-
getTtc
public TtcExpression getTtc()
Returns the TTC of thisAttackStepBuilderobject, ornullif no TTC has been set.- Returns:
- the TTC of this
AttackStepBuilderobject, ornullif no TTC has been set - Since:
- 1.0.0
-
getRequires
public StepsBuilder getRequires()
Returns the requires steps of thisAttackStepBuilderobject, ornullif no requires steps have been set.- Returns:
- the requires steps of this
AttackStepBuilderobject, ornullif no requires steps have been set - Since:
- 1.0.0
-
getReaches
public StepsBuilder getReaches()
Returns the reaches steps of thisAttackStepBuilderobject, ornullif no reaches steps has been set.- Returns:
- the reaches steps of this
AttackStepBuilderobject, ornullif no reaches steps has been set - Since:
- 1.0.0
-
fromJson
public static AttackStepBuilder fromJson(JsonObject jsonAttackStep)
Creates a newAttackStepBuilderfrom aJsonObject.- Parameters:
jsonAttackStep- theJsonObject- Returns:
- a new
AttackStepBuilder - Throws:
NullPointerException- ifjsonAttackStepisnull- Since:
- 1.0.0
-
-