Class ImporterUtils
java.lang.Object
com.atlassian.bamboo.specs.api.validators.common.ImporterUtils
Utility validation methods for importing Bamboo Specs.
Methods from this class prefixed with check throw exceptions on failures. For validation utility
methods which return validation problems instead of throwing, use ValidationUtils.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckArgument(@NotNull ValidationContext validationContext, boolean expression, Object errorMessage) static voidcheckNoErrors(@NotNull List<ValidationProblem> errors) static voidcheckNoErrors(@NotNull Optional<ValidationProblem> error) static StringcheckNotBlank(@NotNull ValidationContext validationContext, @NotNull String argumentName, @Nullable String o) Used to extra validate argument that shouldn't be blank.static StringcheckNotBlank(@NotNull String argumentName, @Nullable String o) Used to extra validate argument that shouldn't be blank.static StringcheckNotEmpty(@NotNull ValidationContext validationContext, @NotNull String argumentName, @Nullable String s) static StringcheckNotEmpty(@NotNull String argumentName, @Nullable String s) static voidcheckNotNegative(@NotNull ValidationContext validationContext, @NotNull String argumentName, int value) Used during building properties to check that a number is a non-negative integer.static voidcheckNotNegative(@NotNull String argumentName, int value) Used during building properties to check that a number is a non-negative integer.static <T> TcheckNotNull(@NotNull ValidationContext validationContext, @NotNull String argumentName, T o) Used to extra validate argument that shouldn't be null to throw our exception instead of NPE.static <T> TcheckNotNull(@NotNull String argumentName, T o) Used to extra validate argument that shouldn't be null to throw our exception instead of NPE.static voidcheckPluginKey(@NotNull ValidationContext validationContext, @NotNull AtlassianModuleProperties actual, @NotNull AtlassianModuleProperties expected) static voidcheckPositive(@NotNull ValidationContext validationContext, @NotNull String argumentName, int value) Used during building properties to check that a number is a positive integer.static voidcheckPositive(@NotNull ValidationContext validationContext, @NotNull String argumentName, long value) Used during building properties to check that a number is a positive integer.static voidcheckPositive(@NotNull String argumentName, int value) Used during building properties to check that a number is a positive integer.static voidcheckPositive(@NotNull String argumentName, long value) Used during building properties to check that a number is a positive integer.static voidcheckRequired(@NotNull ValidationContext validationContext, @NotNull String propertyName, @Nullable Object o) Used during building properties object when some property is missing.static voidcheckRequired(@NotNull ValidationContext validationContext, @Nullable Object o) Used during building properties object when some property is missing.static voidcheckRequiredNotBlank(@NotNull ValidationContext validationContext, @Nullable String s) Used during building properties object when some property is missing.static voidcheckThat(@NotNull ValidationContext validationContext, boolean condition, @NotNull String messageFormat, @NotNull Object... messageArgs) static void
-
Method Details
-
checkPluginKey
public static void checkPluginKey(@NotNull @NotNull ValidationContext validationContext, @NotNull @NotNull AtlassianModuleProperties actual, @NotNull @NotNull AtlassianModuleProperties expected) throws PropertiesValidationException - Throws:
PropertiesValidationException
-
checkThat
public static void checkThat(@NotNull @NotNull ValidationContext validationContext, boolean condition, @NotNull @NotNull String messageFormat, @NotNull @NotNull Object... messageArgs) throws PropertiesValidationException - Throws:
PropertiesValidationException
-
checkThat
public static void checkThat(@NotNull @NotNull String message, @NotNull @org.jetbrains.annotations.NotNull boolean condition) throws PropertiesValidationException - Throws:
PropertiesValidationException
-
checkNoErrors
public static void checkNoErrors(@NotNull @NotNull List<ValidationProblem> errors) throws PropertiesValidationException - Throws:
PropertiesValidationException
-
checkNoErrors
public static void checkNoErrors(@NotNull @NotNull Optional<ValidationProblem> error) throws PropertiesValidationException - Throws:
PropertiesValidationException
-
checkRequired
public static void checkRequired(@NotNull @NotNull ValidationContext validationContext, @Nullable @Nullable Object o) throws PropertiesValidationException Used during building properties object when some property is missing.- Throws:
PropertiesValidationException
-
checkRequired
public static void checkRequired(@NotNull @NotNull ValidationContext validationContext, @NotNull @NotNull String propertyName, @Nullable @Nullable Object o) throws PropertiesValidationException Used during building properties object when some property is missing.- Throws:
PropertiesValidationException
-
checkRequiredNotBlank
public static void checkRequiredNotBlank(@NotNull @NotNull ValidationContext validationContext, @Nullable @Nullable String s) throws PropertiesValidationException Used during building properties object when some property is missing.- Throws:
PropertiesValidationException
-
checkNotNull
public static <T> T checkNotNull(@NotNull @NotNull String argumentName, @Nullable T o) throws PropertiesValidationException Used to extra validate argument that shouldn't be null to throw our exception instead of NPE.- Throws:
PropertiesValidationException
-
checkNotNull
public static <T> T checkNotNull(@NotNull @NotNull ValidationContext validationContext, @NotNull @NotNull String argumentName, @Nullable T o) throws PropertiesValidationException Used to extra validate argument that shouldn't be null to throw our exception instead of NPE.- Throws:
PropertiesValidationException
-
checkNotEmpty
public static String checkNotEmpty(@NotNull @NotNull String argumentName, @Nullable @Nullable String s) throws PropertiesValidationException - Throws:
PropertiesValidationException
-
checkNotEmpty
public static String checkNotEmpty(@NotNull @NotNull ValidationContext validationContext, @NotNull @NotNull String argumentName, @Nullable @Nullable String s) throws PropertiesValidationException - Throws:
PropertiesValidationException
-
checkArgument
public static void checkArgument(@NotNull @NotNull ValidationContext validationContext, boolean expression, Object errorMessage) -
checkNotBlank
public static String checkNotBlank(@NotNull @NotNull String argumentName, @Nullable @Nullable String o) throws PropertiesValidationException Used to extra validate argument that shouldn't be blank.- Throws:
PropertiesValidationException
-
checkNotBlank
public static String checkNotBlank(@NotNull @NotNull ValidationContext validationContext, @NotNull @NotNull String argumentName, @Nullable @Nullable String o) throws PropertiesValidationException Used to extra validate argument that shouldn't be blank.- Throws:
PropertiesValidationException
-
checkNotNegative
public static void checkNotNegative(@NotNull @NotNull String argumentName, int value) throws PropertiesValidationException Used during building properties to check that a number is a non-negative integer.- Throws:
PropertiesValidationException
-
checkNotNegative
public static void checkNotNegative(@NotNull @NotNull ValidationContext validationContext, @NotNull @NotNull String argumentName, int value) throws PropertiesValidationException Used during building properties to check that a number is a non-negative integer.- Throws:
PropertiesValidationException
-
checkPositive
public static void checkPositive(@NotNull @NotNull String argumentName, int value) throws PropertiesValidationException Used during building properties to check that a number is a positive integer.- Throws:
PropertiesValidationException
-
checkPositive
public static void checkPositive(@NotNull @NotNull String argumentName, long value) throws PropertiesValidationException Used during building properties to check that a number is a positive integer.- Throws:
PropertiesValidationException
-
checkPositive
public static void checkPositive(@NotNull @NotNull ValidationContext validationContext, @NotNull @NotNull String argumentName, int value) throws PropertiesValidationException Used during building properties to check that a number is a positive integer.- Throws:
PropertiesValidationException
-
checkPositive
public static void checkPositive(@NotNull @NotNull ValidationContext validationContext, @NotNull @NotNull String argumentName, long value) throws PropertiesValidationException Used during building properties to check that a number is a positive integer.- Throws:
PropertiesValidationException
-