Interface JsonNodeValidator<T extends tools.jackson.databind.JsonNode>
- Type Parameters:
T- the type of theJsonNode
- All Superinterfaces:
ObjectComponent<JsonNodeValidator<T>, T>, ValidatorComponent<JsonNodeValidator<T>, T>
public interface JsonNodeValidator<T extends tools.jackson.databind.JsonNode>
extends ValidatorComponent<JsonNodeValidator<T>, T>, ObjectComponent<JsonNodeValidator<T>, T>
Validates the state of a JsonNode.
-
Method Summary
Modifier and TypeMethodDescriptionJsonNodeValidator<tools.jackson.databind.node.ArrayNode> isArray()Ensures that the node contains an array.JsonNodeValidator<tools.jackson.databind.node.DecimalNode> Ensures that the node contains aBigDecimal.JsonNodeValidator<tools.jackson.databind.node.BigIntegerNode> Ensures that the node contains aBigInteger.JsonNodeValidator<tools.jackson.databind.node.BooleanNode> Ensures that the node contains a Boolean.JsonNodeValidator<tools.jackson.databind.node.ContainerNode<?>> Ensures that the node contains an array or object.JsonNodeValidator<tools.jackson.databind.node.NumericNode> Ensures that the node contains afloatordouble.JsonNodeValidator<tools.jackson.databind.node.NumericNode> Ensures that the node contains abyte,short,intorlong.JsonNodeValidator<tools.jackson.databind.node.MissingNode> Ensures that the value references a missing node.JsonNodeValidator<tools.jackson.databind.node.NumericNode> isNumber()Ensures that the node contains aNumber.JsonNodeValidator<tools.jackson.databind.node.ObjectNode> isObject()Ensures that the node contains an object.JsonNodeValidator<tools.jackson.databind.node.StringNode> isString()Ensures that the node contains a String.JsonNodeValidator<tools.jackson.databind.node.ValueNode> isValue()Ensures that the node contains a binary value, boolean, null, number or string.JsonNodeValidator<tools.jackson.databind.JsonNode> Returns a validator for the node's property.size()Returns a validator over the node'ssize.Methods declared in interface ObjectComponent
getValue, isEqualTo, isEqualTo, isInstanceOf, isInstanceOf, isNotEqualTo, isNotEqualTo, isNotInstanceOf, isNotInstanceOf, isNotNull, isNull, isReferenceEqualTo, isReferenceNotEqualToMethods declared in interface ValidatorComponent
and, elseGetFailures, elseThrow, getContext, getContextAsString, getName, getValueOrDefault, validationFailed, withContext
-
Method Details
-
property
Returns a validator for the node's property.- Parameters:
name- the name of a property- Returns:
- a validator for the property
- Throws:
NullPointerException- if the value ornameare nullIllegalArgumentException- if the node does not contain the property
-
size
Returns a validator over the node'ssize.- Returns:
- a validator over the node's
size - Throws:
NullPointerException- if the value is null
-
isNumber
JsonNodeValidator<tools.jackson.databind.node.NumericNode> isNumber()Ensures that the node contains aNumber.- Returns:
- this
- Throws:
NullPointerException- if the value is nullIllegalArgumentException- if the node does not contain a number
-
isIntegralNumber
JsonNodeValidator<tools.jackson.databind.node.NumericNode> isIntegralNumber()Ensures that the node contains abyte,short,intorlong.- Returns:
- this
- Throws:
NullPointerException- if the value is nullIllegalArgumentException- if the node does not contain an integral number
-
isFloatingPointNumber
JsonNodeValidator<tools.jackson.databind.node.NumericNode> isFloatingPointNumber()Ensures that the node contains afloatordouble.- Returns:
- this
- Throws:
NullPointerException- if the value is nullIllegalArgumentException- if the node does not contain a decimal number
-
isBigInteger
JsonNodeValidator<tools.jackson.databind.node.BigIntegerNode> isBigInteger()Ensures that the node contains aBigInteger.- Returns:
- this
- Throws:
NullPointerException- if the value is nullIllegalArgumentException- if the node does not contain aBigInteger
-
isBigDecimal
JsonNodeValidator<tools.jackson.databind.node.DecimalNode> isBigDecimal()Ensures that the node contains aBigDecimal.- Returns:
- this
- Throws:
NullPointerException- if the value is nullIllegalArgumentException- if the node does not contain aBigDecimal
-
isMissing
JsonNodeValidator<tools.jackson.databind.node.MissingNode> isMissing()Ensures that the value references a missing node.- Returns:
- this
- Throws:
NullPointerException- if the value is nullIllegalArgumentException- if the value does not represent a missing node- See Also:
-
isValue
JsonNodeValidator<tools.jackson.databind.node.ValueNode> isValue()Ensures that the node contains a binary value, boolean, null, number or string.- Returns:
- this
- Throws:
NullPointerException- if the value is nullIllegalArgumentException- if the value is not a binary value, boolean, null, number or string- See Also:
-
isContainer
JsonNodeValidator<tools.jackson.databind.node.ContainerNode<?>> isContainer()Ensures that the node contains an array or object.- Returns:
- this
- Throws:
NullPointerException- if the value is nullIllegalArgumentException- if the value is a "missing" or a value node- See Also:
-
isArray
JsonNodeValidator<tools.jackson.databind.node.ArrayNode> isArray()Ensures that the node contains an array.- Returns:
- this
- Throws:
NullPointerException- if the value is nullIllegalArgumentException- if the value is not an array- See Also:
-
isObject
JsonNodeValidator<tools.jackson.databind.node.ObjectNode> isObject()Ensures that the node contains an object.- Returns:
- this
- Throws:
NullPointerException- if the value is nullIllegalArgumentException- if the value is not an object- See Also:
-
isString
JsonNodeValidator<tools.jackson.databind.node.StringNode> isString()Ensures that the node contains a String.- Returns:
- this
- Throws:
NullPointerException- if the value is nullIllegalArgumentException- if the value is not a String- See Also:
-
isBoolean
JsonNodeValidator<tools.jackson.databind.node.BooleanNode> isBoolean()Ensures that the node contains a Boolean.- Returns:
- this
- Throws:
NullPointerException- if the value is nullIllegalArgumentException- if the value is not a Boolean- See Also:
-