public interface ValidationService
Modifier and Type | Interface and Description |
---|---|
static class |
ValidationService.ValidationType |
Modifier and Type | Field and Description |
---|---|
static String |
CHAIN_KEY_REGEXP
Regular expression matching a full
Chain 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 a
Project key. |
Modifier and Type | Method and Description |
---|---|
ErrorCollection |
validateChainKey(String fieldName,
String chainKey,
ValidationFunction... functions)
|
ErrorCollection |
validateDescription(String fieldName,
String description)
Validate the description field of any object.
|
ErrorCollection |
validateJobKey(String fieldName,
String jobKey,
ValidationFunction... functions)
|
ErrorCollection |
validateKey(String fieldName,
ValidationService.ValidationType type,
String key,
ValidationFunction... functions)
Validate any String against Bamboo's generic rules for keys.
|
ErrorCollection |
validateName(String fieldName,
String errorPrefix,
String name)
Validate any String against Bamboo's generic rules for names.
|
ErrorCollection |
validateProjectKey(String fieldName,
String projectKey,
ValidationFunction... functions)
Verify any String that it is a valid
Project key. |
static final String FULL_JOB_KEY_REGEXP
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
static final String CHAIN_KEY_REGEXP
Chain
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-CDEstatic final String PROJECT_KEY_REGEXP
Project
key.
Matches an uppercase letter followed by one or more uppercase alphanumeric characters.
Examples:
PROJ1
static final String PARTIAL_JOB_KEY_REGEXP
Matches an uppercase letter followed by one or more uppercase alphanumeric characters.
Examples:
ABC1
@NotNull ErrorCollection validateKey(@NotNull String fieldName, @NotNull ValidationService.ValidationType type, @Nullable String key, ValidationFunction... functions)
fieldName
- the name of the field to add the errors to.type
- the ValidationService.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.ValidationFunctionFactory
@NotNull ErrorCollection validateJobKey(@NotNull String fieldName, @Nullable String jobKey, ValidationFunction... functions)
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.ValidationFunctionFactory
@NotNull ErrorCollection validateChainKey(@NotNull String fieldName, @Nullable String chainKey, ValidationFunction... functions)
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.ValidationFunctionFactory
@NotNull ErrorCollection validateProjectKey(@NotNull String fieldName, @Nullable String projectKey, ValidationFunction... functions)
Project
key.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.ValidationFunctionFactory
@NotNull ErrorCollection validateName(@NotNull String fieldName, @NotNull String errorPrefix, @Nullable String name)
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@NotNull ErrorCollection validateDescription(@NotNull String fieldName, @Nullable String description)
fieldName
- the name of the field to add the errors todescription
- the actual text to validateCopyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.