Class ValidationUtils
java.lang.Object
com.atlassian.bamboo.specs.api.validators.common.ValidationUtils
Various utility methods for validating data of Bamboo Specs.
Validation methods from this class prefixed with validate
return validation problems and do not
throw any exception. For helper methods which throw exceptions on validation failures, use
ImporterUtils
.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
containsBambooVariable
(@Nullable String value) static boolean
repositoryUriContainsPassword
(URI repositoryUri) static Optional<ValidationProblem>
validateBoolean
(@NotNull ValidationContext validationContext, @Nullable String value) static @NotNull List<ValidationProblem>
validateDescription
(@NotNull ValidationContext validationContext, @Nullable String description) static <E extends Enum<E>>
Optional<ValidationProblem>validateEnum
(@NotNull ValidationContext validationContext, @Nullable String value, @NotNull Class<E> enumClass) static Optional<ValidationProblem>
validateLong
(@NotNull ValidationContext validationContext, @Nullable String value) static @NotNull List<ValidationProblem>
validateName
(@NotNull ValidationContext validationContext, @Nullable String name) static @NotNull List<ValidationProblem>
validateName
(@NotNull ValidationContext validationContext, @Nullable String name, boolean required) static Optional<ValidationProblem>
validateNotContainsRelaxedXssRelatedCharacters
(@NotNull ValidationContext validationContext, @Nullable String value) static Optional<ValidationProblem>
validateNotContainsShellInjectionRelatedCharacters
(@NotNull ValidationContext validationContext, @Nullable String value) static Optional<ValidationProblem>
validateNotContainsXssRelatedCharacters
(@NotNull ValidationContext validationContext, @Nullable String value) static Optional<ValidationProblem>
validatePositive
(@NotNull ValidationContext validationContext, int value) static Optional<ValidationProblem>
validatePositive
(@NotNull ValidationContext validationContext, long value) static Optional<ValidationProblem>
validateRequired
(@NotNull ValidationContext validationContext, @Nullable Object value) static Optional<ValidationProblem>
validateRequiredBoolean
(@NotNull ValidationContext validationContext, @Nullable String value) static <E extends Enum<E>>
Optional<ValidationProblem>validateRequiredEnum
(@NotNull ValidationContext validationContext, @Nullable String value, @NotNull Class<E> enumClass) static Optional<ValidationProblem>
validateRequiredLong
(@NotNull ValidationContext validationContext, @Nullable String value) static Optional<ValidationProblem>
validateRequiredString
(@NotNull ValidationContext validationContext, @Nullable String value) static Optional<ValidationProblem>
validateRequiredString
(@NotNull ValidationContext validationContext, @Nullable String value, boolean requireNonBlank) static Optional<ValidationProblem>
validateUrl
(@NotNull ValidationContext validationContext, @Nullable String urlString, @NotNull Set<String> supportedSchemes)
-
Method Details
-
containsBambooVariable
-
repositoryUriContainsPassword
-
validateRequired
public static Optional<ValidationProblem> validateRequired(@NotNull @NotNull ValidationContext validationContext, @Nullable @Nullable Object value) -
validateRequiredString
public static Optional<ValidationProblem> validateRequiredString(@NotNull @NotNull ValidationContext validationContext, @Nullable @Nullable String value) -
validateRequiredString
public static Optional<ValidationProblem> validateRequiredString(@NotNull @NotNull ValidationContext validationContext, @Nullable @Nullable String value, boolean requireNonBlank) -
validateBoolean
public static Optional<ValidationProblem> validateBoolean(@NotNull @NotNull ValidationContext validationContext, @Nullable @Nullable String value) -
validateRequiredBoolean
public static Optional<ValidationProblem> validateRequiredBoolean(@NotNull @NotNull ValidationContext validationContext, @Nullable @Nullable String value) -
validateLong
public static Optional<ValidationProblem> validateLong(@NotNull @NotNull ValidationContext validationContext, @Nullable @Nullable String value) -
validateRequiredLong
public static Optional<ValidationProblem> validateRequiredLong(@NotNull @NotNull ValidationContext validationContext, @Nullable @Nullable String value) -
validateEnum
public static <E extends Enum<E>> Optional<ValidationProblem> validateEnum(@NotNull @NotNull ValidationContext validationContext, @Nullable @Nullable String value, @NotNull @NotNull Class<E> enumClass) -
validateRequiredEnum
public static <E extends Enum<E>> Optional<ValidationProblem> validateRequiredEnum(@NotNull @NotNull ValidationContext validationContext, @Nullable @Nullable String value, @NotNull @NotNull Class<E> enumClass) -
validatePositive
public static Optional<ValidationProblem> validatePositive(@NotNull @NotNull ValidationContext validationContext, long value) -
validatePositive
public static Optional<ValidationProblem> validatePositive(@NotNull @NotNull ValidationContext validationContext, int value) -
validateUrl
public static Optional<ValidationProblem> validateUrl(@NotNull @NotNull ValidationContext validationContext, @Nullable @Nullable String urlString, @NotNull @NotNull Set<String> supportedSchemes) -
validateNotContainsXssRelatedCharacters
public static Optional<ValidationProblem> validateNotContainsXssRelatedCharacters(@NotNull @NotNull ValidationContext validationContext, @Nullable @Nullable String value) -
validateNotContainsRelaxedXssRelatedCharacters
public static Optional<ValidationProblem> validateNotContainsRelaxedXssRelatedCharacters(@NotNull @NotNull ValidationContext validationContext, @Nullable @Nullable String value) -
validateNotContainsShellInjectionRelatedCharacters
public static Optional<ValidationProblem> validateNotContainsShellInjectionRelatedCharacters(@NotNull @NotNull ValidationContext validationContext, @Nullable @Nullable String value) -
validateName
@NotNull public static @NotNull List<ValidationProblem> validateName(@NotNull @NotNull ValidationContext validationContext, @Nullable @Nullable String name) -
validateName
@NotNull public static @NotNull List<ValidationProblem> validateName(@NotNull @NotNull ValidationContext validationContext, @Nullable @Nullable String name, boolean required) -
validateDescription
@NotNull public static @NotNull List<ValidationProblem> validateDescription(@NotNull @NotNull ValidationContext validationContext, @Nullable @Nullable String description)
-