public class BambooYamlParserUtils extends Object
BambooYamlParser
,
BambooYamlDefinition
Modifier and Type | Class and Description |
---|---|
static class |
BambooYamlParserUtils.BaseNode |
static class |
BambooYamlParserUtils.ListNode<T extends BambooYamlParserUtils.Node>
Node containing a list of child nodes.
|
static class |
BambooYamlParserUtils.MapNode
Node representing a dictionary-like YAML structure.
|
static interface |
BambooYamlParserUtils.Node
Structure representing parsed YAML document.
|
static class |
BambooYamlParserUtils.StringNode
Node containing single string value.
|
Modifier and Type | Method and Description |
---|---|
static BambooYamlParserUtils.Node |
asNode(Object obj,
com.atlassian.bamboo.specs.api.validators.common.ValidationContext validationContext)
Transforms object generated by snakeyaml into a
BambooYamlParserUtils.Node structure. |
static <T> List<T> |
checkListNotEmpty(com.atlassian.bamboo.specs.api.validators.common.ValidationContext validationContext,
List<T> list)
Checks that a list is not empty.
|
static <T extends BambooYamlParserUtils.Node> |
checkListType(List<? extends BambooYamlParserUtils.Node> list,
Class<T> expectedType)
Check that all elements of the given list are of expected type.
|
static Map<String,Object> |
checkMapType(com.atlassian.bamboo.specs.api.validators.common.ValidationContext validationContext,
Map<?,?> value)
|
static <K,V> Map<K,V> |
checkMapType(com.atlassian.bamboo.specs.api.validators.common.ValidationContext validationContext,
Map<?,?> value,
Class<K> expectedKeyType,
Class<V> expectedValueType)
Checks that all keys and values of a map are of expected types.
|
static <T> T |
checkPresent(com.atlassian.bamboo.specs.api.validators.common.ValidationContext validationContext,
Optional<T> value)
Check that the given optional is present.
|
static <T> T |
checkRequired(com.atlassian.bamboo.specs.api.validators.common.ValidationContext validationContext,
T value)
Check that the given value is not null.
|
static String |
checkStringNotBlank(com.atlassian.bamboo.specs.api.validators.common.ValidationContext validationContext,
String value)
Checks that a string is not blank.
|
static <T extends BambooYamlParserUtils.Node> |
checkType(BambooYamlParserUtils.Node node,
Class<T> expectedType)
Check that the given node is of expected type.
|
static <T> T |
checkType(com.atlassian.bamboo.specs.api.validators.common.ValidationContext validationContext,
Object value,
Class<T> expectedType)
Check that the given value is of expected type.
|
@NotNull public static BambooYamlParserUtils.Node asNode(@Nullable Object obj, @NotNull com.atlassian.bamboo.specs.api.validators.common.ValidationContext validationContext)
BambooYamlParserUtils.Node
structure.
This method will cast the property to a string if it's a scalar (non-collection), e.g. Integer
or
Boolean
.
obj
- snakeyaml resultvalidationContext
- root validation contextBambooYamlParserUtils.Node
structure@Contract(value="_, null -> fail; _, !null -> !null") public static <T> T checkRequired(@NotNull com.atlassian.bamboo.specs.api.validators.common.ValidationContext validationContext, @Nullable T value)
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
- on check failure@NotNull public static <T> T checkPresent(@NotNull com.atlassian.bamboo.specs.api.validators.common.ValidationContext validationContext, @NotNull Optional<T> value)
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
- on check failure@NotNull public static <T> T checkType(@NotNull com.atlassian.bamboo.specs.api.validators.common.ValidationContext validationContext, @Nullable Object value, @NotNull Class<T> expectedType)
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
- on check failure@NotNull public static <T extends BambooYamlParserUtils.Node> T checkType(@NotNull BambooYamlParserUtils.Node node, @NotNull Class<T> expectedType)
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
- on check failure@NotNull public static <T extends BambooYamlParserUtils.Node> List<T> checkListType(@NotNull List<? extends BambooYamlParserUtils.Node> list, @NotNull Class<T> expectedType)
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
- on check failure@NotNull public static Map<String,Object> checkMapType(@NotNull com.atlassian.bamboo.specs.api.validators.common.ValidationContext validationContext, @NotNull Map<?,?> value)
@NotNull public static <K,V> Map<K,V> checkMapType(@NotNull com.atlassian.bamboo.specs.api.validators.common.ValidationContext validationContext, @NotNull Map<?,?> value, @NotNull Class<K> expectedKeyType, @NotNull Class<V> expectedValueType)
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
- on check failure@NotNull public static String checkStringNotBlank(@NotNull com.atlassian.bamboo.specs.api.validators.common.ValidationContext validationContext, @Nullable String value)
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
- on check failure@NotNull public static <T> List<T> checkListNotEmpty(@NotNull com.atlassian.bamboo.specs.api.validators.common.ValidationContext validationContext, @Nullable List<T> list)
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
- on check failureCopyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.