Class InvisibleGlobalWhenCondition
- java.lang.Object
-
- org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTElement
-
- org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTWhenCondition
-
- org.jenkinsci.plugins.pipeline.modeldefinition.ast.InvisibleGlobalWhenCondition
-
- All Implemented Interfaces:
ModelASTMarkerInterface
,ModelASTWhenContent
public class InvisibleGlobalWhenCondition extends ModelASTWhenCondition
Special case of aModelASTWhenCondition
generated for a globally defined when condition.
-
-
Constructor Summary
Constructors Constructor Description InvisibleGlobalWhenCondition()
Used to create invisible when conditions without base stage information, used for the "allOf" conditional generated when a stage already has when conditions.InvisibleGlobalWhenCondition(String stageName, ModelASTStageBase stage)
Used to create invisible when conditions with a base stage for comparison and querying.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
ModelASTStageBase
getStage()
String
getStageName()
int
hashCode()
void
removeSourceLocation()
Removes the source location value from this element.String
toGroovy()
Translates this element and any children it may have into Pipeline Config-formatted Groovy, without any indentations.net.sf.json.JSONObject
toJSON()
Translates this element and any children it may have into JSON conforming to the schema.void
validate(ModelValidator validator)
Called to do whatever validation is necessary for this element.-
Methods inherited from class org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTWhenCondition
getArgs, getChildren, getName, setArgs, setChildren, setName, toString
-
Methods inherited from class org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTElement
getSourceLocation, nullIfEmpty, removeSourceLocationsFrom, removeSourceLocationsFrom, removeSourceLocationsFrom, removeSourceLocationsFrom, setSourceLocation, toGroovy, toGroovy, toGroovyArgList, toGroovyArgList, toGroovyBlock, toGroovyBlock, toGroovyBlock, toGroovyCheckEmpty, toJSON, toJSONArray, toJSONArray, toJSONCheckEmpty, toJSONObject, validate, validate, validate
-
-
-
-
Constructor Detail
-
InvisibleGlobalWhenCondition
public InvisibleGlobalWhenCondition()
Used to create invisible when conditions without base stage information, used for the "allOf" conditional generated when a stage already has when conditions.
-
InvisibleGlobalWhenCondition
public InvisibleGlobalWhenCondition(String stageName, ModelASTStageBase stage)
Used to create invisible when conditions with a base stage for comparison and querying.- Parameters:
stageName
- The name of the stage this condition belongs to. Explicitly specified due to auto-generated stage names with matrices.stage
- TheModelASTStageBase
for the stage this condition belongs to, for inspection.
-
-
Method Detail
-
getStageName
public String getStageName()
-
getStage
public ModelASTStageBase getStage()
-
toJSON
@NonNull public net.sf.json.JSONObject toJSON()
Description copied from class:ModelASTElement
Translates this element and any children it may have into JSON conforming to the schema.- Specified by:
toJSON
in interfaceModelASTMarkerInterface
- Overrides:
toJSON
in classModelASTWhenCondition
- Returns:
- Generally a
JSONObject
orJSONArray
but for some leaf nodes, may be aString
or other simple class.
-
toGroovy
@NonNull public String toGroovy()
Description copied from class:ModelASTElement
Translates this element and any children it may have into Pipeline Config-formatted Groovy, without any indentations.- Specified by:
toGroovy
in interfaceModelASTMarkerInterface
- Overrides:
toGroovy
in classModelASTWhenCondition
- Returns:
- A simple
String
of Groovy code for this element and its children.
-
validate
public void validate(@NonNull ModelValidator validator)
Description copied from class:ModelASTElement
Called to do whatever validation is necessary for this element. Overridden in most cases.- Specified by:
validate
in interfaceModelASTMarkerInterface
- Overrides:
validate
in classModelASTWhenCondition
- Parameters:
validator
- AModelValidator
to use for more complicated validation.
-
removeSourceLocation
public void removeSourceLocation()
Description copied from class:ModelASTElement
Removes the source location value from this element.- Specified by:
removeSourceLocation
in interfaceModelASTMarkerInterface
- Overrides:
removeSourceLocation
in classModelASTWhenCondition
-
equals
public boolean equals(Object o)
Description copied from class:ModelASTElement
- Overrides:
equals
in classModelASTWhenCondition
-
hashCode
public int hashCode()
Description copied from class:ModelASTElement
- Overrides:
hashCode
in classModelASTWhenCondition
-
-