Package com.atlassian.bamboo.validation
Interface ValidationService
-
- All Known Implementing Classes:
ValidationServiceImpl
public interface ValidationService
Methods for validation of standard fields
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ValidationService.ValidationType
-
Field Summary
Fields Modifier and Type Field Description static String
CHAIN_KEY_REGEXP
Regular expression matching a fullChain
key.static String
FULL_JOB_KEY_REGEXP
Regular expression matching a full job key.static String
PARTIAL_JOB_KEY_REGEXP
Regular expression matching a partial job key.static String
PROJECT_KEY_REGEXP
Regular expression matching aProject
key.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull ErrorCollection
validateChainKey(@NotNull String fieldName, @Nullable String chainKey, ValidationFunction... functions)
@NotNull ErrorCollection
validateDescription(@NotNull String fieldName, @Nullable String description)
Validate the description field of any object.@NotNull ErrorCollection
validateJobKey(@NotNull String fieldName, @Nullable String jobKey, ValidationFunction... functions)
@NotNull ErrorCollection
validateKey(@NotNull String fieldName, @NotNull ValidationService.ValidationType type, @Nullable String key, ValidationFunction... functions)
Validate any String against Bamboo's generic rules for keys.@NotNull ErrorCollection
validateName(@NotNull String fieldName, @NotNull String errorPrefix, @Nullable String name)
Validate any String against Bamboo's generic rules for names.@NotNull ErrorCollection
validateProjectKey(@NotNull String fieldName, @Nullable String projectKey, ValidationFunction... functions)
Verify any String that it is a validProject
key.
-
-
-
Field Detail
-
FULL_JOB_KEY_REGEXP
static final String FULL_JOB_KEY_REGEXP
Regular expression matching a full job key.Matches exactly three groups of an uppercase letter followed by one or more uppercase alphanumeric characters, with each group separated by a hyphen (-).
Examples:
AB-CDE-FG1
- See Also:
- Constant Field Values
-
CHAIN_KEY_REGEXP
static final String CHAIN_KEY_REGEXP
Regular expression matching a fullChain
key. Matches exactly two groups of an uppercase letter followed by one or more uppercase alphanumeric characters, with each group separated by a hyphen (-). Examples: AB-CDE- See Also:
- Constant Field Values
-
PROJECT_KEY_REGEXP
static final String PROJECT_KEY_REGEXP
Regular expression matching aProject
key.Matches an uppercase letter followed by one or more uppercase alphanumeric characters.
Examples:
PROJ1
-
PARTIAL_JOB_KEY_REGEXP
static final String PARTIAL_JOB_KEY_REGEXP
Regular expression matching a partial job key.Matches an uppercase letter followed by one or more uppercase alphanumeric characters.
Examples:
ABC1
- See Also:
- Constant Field Values
-
-
Method Detail
-
validateKey
@NotNull @NotNull ErrorCollection validateKey(@NotNull @NotNull String fieldName, @NotNull @NotNull ValidationService.ValidationType type, @Nullable @Nullable String key, ValidationFunction... functions)
Validate any String against Bamboo's generic rules for keys.- Parameters:
fieldName
- the name of the field to add the errors to.type
- theValidationService.ValidationType
the key pertains to.key
- the actual string to validate.functions
- additional validation functions to run if all generic rules are satisfied. Functions are run in the order they are provided. If a function adds an error to the error collection, subsequent functions will not be run.- See Also:
ValidationFunctionFactory
-
validateJobKey
@NotNull @NotNull ErrorCollection validateJobKey(@NotNull @NotNull String fieldName, @Nullable @Nullable String jobKey, ValidationFunction... functions)
- Parameters:
fieldName
- the name of the field to add the errors to.jobKey
- the actual string to validate.functions
- additional validation functions to run if all generic rules are satisfied. Functions are run in the order they are provided. If a function adds an error to the error collection, subsequent functions will not be run.- See Also:
ValidationFunctionFactory
-
validateChainKey
@NotNull @NotNull ErrorCollection validateChainKey(@NotNull @NotNull String fieldName, @Nullable @Nullable String chainKey, ValidationFunction... functions)
- Parameters:
fieldName
- the name of the field to add the errors to.chainKey
- the actual string to validate.functions
- additional validation functions to run if all generic rules are satisfied. Functions are run in the order they are provided. If a function adds an error to the error collection, subsequent functions will not be run.- See Also:
ValidationFunctionFactory
-
validateProjectKey
@NotNull @NotNull ErrorCollection validateProjectKey(@NotNull @NotNull String fieldName, @Nullable @Nullable String projectKey, ValidationFunction... functions)
Verify any String that it is a validProject
key.- Parameters:
fieldName
- the name of the field to add the errors toprojectKey
- the actual string to validatefunctions
- additional validation functions to run if all generic rules are satisfied. Functions are run in the order they are provided. If a function adds an error to the error collection, subsequent functions will not be run.- See Also:
ValidationFunctionFactory
-
validateName
@NotNull @NotNull ErrorCollection validateName(@NotNull @NotNull String fieldName, @NotNull @NotNull String errorPrefix, @Nullable @Nullable String name)
Validate any String against Bamboo's generic rules for names.- Parameters:
fieldName
- the name of the field to add the errors toerrorPrefix
- the prefix to put in front of the standardised error keys. (e.g. "plan", "chain")name
- the actual string to validate
-
validateDescription
@NotNull @NotNull ErrorCollection validateDescription(@NotNull @NotNull String fieldName, @Nullable @Nullable String description)
Validate the description field of any object. All it really does is check length- Parameters:
fieldName
- the name of the field to add the errors todescription
- the actual text to validate
-
-