package strikt.jackson
Methods
has
infix fun <T> Assertion.Builder
Receiver
Name | Description |
---|---|
Assertion.Builder
|
Parameters
Name | Description |
---|---|
fieldName: String
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
path
infix fun <T> Assertion.Builder
Maps the subject node of the assertion builder to the node accessed by fieldName.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
Parameters
Name | Description |
---|---|
fieldName: String
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
an assertion builder whose subject is the named field. If the path is invalid the subject of the returned assertion builder will be a com.fasterxml.jackson.databind.node.MissingNode. |
at
infix fun <T> Assertion.Builder
Maps the subject node of the assertion builder to the node accessed by pointer.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
Parameters
Name | Description |
---|---|
pointer: String
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
an assertion builder whose subject is the node at pointer. If pointer is invalid the subject of the returned assertion builder will be a com.fasterxml.jackson.databind.node.MissingNode. |
at
infix fun <T> Assertion.Builder
Maps the subject node of the assertion builder to the node accessed by pointer.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
Parameters
Name | Description |
---|---|
pointer: JsonPointer
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
an assertion builder whose subject is the node at pointer. If pointer is invalid the subject of the returned assertion builder will be a com.fasterxml.jackson.databind.node.MissingNode. |
isObject
fun <T> Assertion.Builder
Asserts that the subject node is a JSON object.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
an assertion builder over the same subject that is now known to be an ObjectNode. |
isArray
fun <T> Assertion.Builder
Asserts that the subject node is a JSON array.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
an assertion builder over the same subject that is now known to be an ArrayNode. |
isTextual
fun <T> Assertion.Builder
Asserts that the subject node is a JSON text node.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
an assertion builder over the same subject that is now known to be a TextNode. |
isNumber
fun <T> Assertion.Builder
Asserts that the subject node is a JSON numeric node.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
an assertion builder over the same subject that is now known to be a NumericNode. |
isBoolean
fun <T> Assertion.Builder
Asserts that the subject node is a JSON boolean node.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
an assertion builder over the same subject that is now known to be a BooleanNode. |
isMissing
fun <T> Assertion.Builder
Asserts that the subject node is a JSON missing node.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
an assertion builder over the same subject that is now known to be a MissingNode. |
textValue
fun <T> Assertion.Builder
Maps the assertion to an assertion on the subject node's text value.
Be aware that if the node is not a text node this will map to an assertion on
null
.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
numberValue
fun <T> Assertion.Builder
Maps the assertion to an assertion on the subject node's number value.
Be aware that if the node is not a numeric node this will map to an assertion
on null
.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
booleanValue
fun <T> Assertion.Builder
Maps the assertion to an assertion on the subject node's boolean value.
Be aware that if the node is not a boolean node this will map to an assertion
on false
.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
findValuesAsText
fun <T> Assertion.Builder
><List<String>>
Maps the assertion to an assertion on the text values of fieldName in each child of the current node.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
Parameters
Name | Description |
---|---|
fieldName: String
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
hasNodeType
infix fun <T> Assertion.Builder
Asserts that the subject node's JsonNode.getNodeType method returns nodeType.
Convenient aliases for this assertion exist for common node types that also narrow the subject type of the resulting assertion builder.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
Parameters
Name | Description |
---|---|
nodeType: JsonNodeType
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
hasSize
infix fun Assertion.Builder
Asserts that a JSON array's size is equal to expected.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
Parameters
Name | Description |
---|---|
expected: Int
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
size
fun Assertion.Builder
Maps an assertion on a JSON array to an assertion on its size.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
textValues
fun Assertion.Builder
Maps an assertion on a JSON array to an assertion on the text values of all nodes in the array.
Receiver
Name | Description |
---|---|
Assertion.Builder
|
ReturnValue
Name | Description |
---|---|
Assertion.Builder
|
Asserts that the subject node has a field named fieldName.