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