in jackson/src/main/java/com/spotify/hamcrest/jackson/IsJsonObject.java [85:111]
private static Matcher<JsonNode> createNodeMatcher(final JsonNode value) {
final JsonNodeType nodeType = value.getNodeType();
switch (nodeType) {
case ARRAY:
return IsJsonArray.jsonArray((ArrayNode) value);
case BINARY:
throw new UnsupportedOperationException(
"Expected value contains a binary node, which is not implemented.");
case BOOLEAN:
return IsJsonBoolean.jsonBoolean((BooleanNode) value);
case MISSING:
return IsJsonMissing.jsonMissing((MissingNode) value);
case NULL:
return IsJsonNull.jsonNull((NullNode) value);
case NUMBER:
return IsJsonNumber.jsonNumber((NumericNode) value);
case OBJECT:
return IsJsonObject.jsonObject((ObjectNode) value);
case POJO:
throw new UnsupportedOperationException(
"Expected value contains a POJO node, which is not implemented.");
case STRING:
return IsJsonText.jsonText((TextNode) value);
default:
throw new UnsupportedOperationException("Unsupported node type " + nodeType);
}
}