Class ValidationContext
java.lang.Object
com.atlassian.bamboo.specs.api.validators.common.ValidationContext
This class helps to describe location of problems found by validators. Typical usage:
- no context of an error:
ValidationContext.empty()
- a single element:
ValidationContext.of("key")
- a nested hierarchy:
ValidationContext.of("Plan P").with("Stage 1").with("Job A").with("name")
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if context contains the given element.static ValidationContext
empty()
Returns an empty context.boolean
isEmpty()
Returns true if context is empty.static ValidationContext
Returns a single-element context.toString()
Returns new instance of validation context with thecontext
element appended to it.
-
Method Details
-
empty
Returns an empty context.- Returns:
- ValidationContext
-
of
Returns a single-element context.- Parameters:
context
- name- Returns:
- ValidationContext
-
with
Returns new instance of validation context with thecontext
element appended to it.- Parameters:
context
- name- Returns:
- ValidationContext
-
isEmpty
public boolean isEmpty()Returns true if context is empty.- Returns:
- boolean
-
contains
Returns true if context contains the given element.- Returns:
- boolean
-
toString
-