public final class ImporterUtils extends Object
Methods from this class prefixed with check
throw exceptions on failures. For validation utility
methods which return validation problems instead of throwing, use ValidationUtils
.
Modifier and Type | Method and Description |
---|---|
static void |
checkArgument(ValidationContext validationContext,
boolean expression,
Object errorMessage) |
static void |
checkNoErrors(List<ValidationProblem> errors) |
static void |
checkNoErrors(Optional<ValidationProblem> error) |
static String |
checkNotBlank(String argumentName,
String o)
Used to extra validate argument that shouldn't be blank.
|
static String |
checkNotBlank(ValidationContext validationContext,
String argumentName,
String o)
Used to extra validate argument that shouldn't be blank.
|
static String |
checkNotEmpty(String argumentName,
String s) |
static String |
checkNotEmpty(ValidationContext validationContext,
String argumentName,
String s) |
static void |
checkNotNegative(String argumentName,
int value)
Used during building properties to check that a number is a non-negative integer.
|
static void |
checkNotNegative(ValidationContext validationContext,
String argumentName,
int value)
Used during building properties to check that a number is a non-negative integer.
|
static <T> T |
checkNotNull(String argumentName,
T o)
Used to extra validate argument that shouldn't be null to throw our exception instead of NPE.
|
static <T> T |
checkNotNull(ValidationContext validationContext,
String argumentName,
T o)
Used to extra validate argument that shouldn't be null to throw our exception instead of NPE.
|
static void |
checkPluginKey(ValidationContext validationContext,
AtlassianModuleProperties actual,
AtlassianModuleProperties expected) |
static void |
checkPositive(String argumentName,
int value)
Used during building properties to check that a number is a positive integer.
|
static void |
checkPositive(String argumentName,
long value)
Used during building properties to check that a number is a positive integer.
|
static void |
checkPositive(ValidationContext validationContext,
String argumentName,
int value)
Used during building properties to check that a number is a positive integer.
|
static void |
checkPositive(ValidationContext validationContext,
String argumentName,
long value)
Used during building properties to check that a number is a positive integer.
|
static void |
checkRequired(ValidationContext validationContext,
Object o)
Used during building properties object when some property is missing.
|
static void |
checkRequired(ValidationContext validationContext,
String propertyName,
Object o)
Used during building properties object when some property is missing.
|
static void |
checkRequiredNotBlank(ValidationContext validationContext,
String s)
Used during building properties object when some property is missing.
|
static void |
checkThat(String message,
boolean condition) |
static void |
checkThat(ValidationContext validationContext,
boolean condition,
String messageFormat,
Object... messageArgs) |
public static void checkPluginKey(@NotNull ValidationContext validationContext, @NotNull AtlassianModuleProperties actual, @NotNull AtlassianModuleProperties expected) throws PropertiesValidationException
PropertiesValidationException
public static void checkThat(@NotNull ValidationContext validationContext, boolean condition, @NotNull String messageFormat, @NotNull Object... messageArgs) throws PropertiesValidationException
PropertiesValidationException
public static void checkThat(@NotNull String message, @NotNull boolean condition) throws PropertiesValidationException
PropertiesValidationException
public static void checkNoErrors(@NotNull List<ValidationProblem> errors) throws PropertiesValidationException
PropertiesValidationException
public static void checkNoErrors(@NotNull Optional<ValidationProblem> error) throws PropertiesValidationException
PropertiesValidationException
public static void checkRequired(@NotNull ValidationContext validationContext, @Nullable Object o) throws PropertiesValidationException
PropertiesValidationException
public static void checkRequired(@NotNull ValidationContext validationContext, @NotNull String propertyName, @Nullable Object o) throws PropertiesValidationException
PropertiesValidationException
public static void checkRequiredNotBlank(@NotNull ValidationContext validationContext, @Nullable String s) throws PropertiesValidationException
PropertiesValidationException
public static <T> T checkNotNull(@NotNull String argumentName, @Nullable T o) throws PropertiesValidationException
PropertiesValidationException
public static <T> T checkNotNull(@NotNull ValidationContext validationContext, @NotNull String argumentName, @Nullable T o) throws PropertiesValidationException
PropertiesValidationException
public static String checkNotEmpty(@NotNull String argumentName, @Nullable String s) throws PropertiesValidationException
PropertiesValidationException
public static String checkNotEmpty(@NotNull ValidationContext validationContext, @NotNull String argumentName, @Nullable String s) throws PropertiesValidationException
PropertiesValidationException
public static void checkArgument(@NotNull ValidationContext validationContext, boolean expression, Object errorMessage)
public static String checkNotBlank(@NotNull String argumentName, @Nullable String o) throws PropertiesValidationException
PropertiesValidationException
public static String checkNotBlank(@NotNull ValidationContext validationContext, @NotNull String argumentName, @Nullable String o) throws PropertiesValidationException
PropertiesValidationException
public static void checkNotNegative(@NotNull String argumentName, int value) throws PropertiesValidationException
PropertiesValidationException
public static void checkNotNegative(@NotNull ValidationContext validationContext, @NotNull String argumentName, int value) throws PropertiesValidationException
PropertiesValidationException
public static void checkPositive(@NotNull String argumentName, int value) throws PropertiesValidationException
PropertiesValidationException
public static void checkPositive(@NotNull String argumentName, long value) throws PropertiesValidationException
PropertiesValidationException
public static void checkPositive(@NotNull ValidationContext validationContext, @NotNull String argumentName, int value) throws PropertiesValidationException
PropertiesValidationException
public static void checkPositive(@NotNull ValidationContext validationContext, @NotNull String argumentName, long value) throws PropertiesValidationException
PropertiesValidationException
Copyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.