public final class JsonNumEquals
extends com.google.common.base.Equivalence<com.fasterxml.jackson.databind.JsonNode>
Equivalence
strategy for JSON Schema equality
JsonNode
does a pretty good job of obeying the equals()
/hashCode()
contract. And in fact, it does it too well for JSON Schema.
For instance, it considers numeric nodes 1
and 1.0
to be
different nodes, which is true. But some IETF RFCs and drafts (among them,
JSON Schema and JSON Patch) mandate that numeric JSON values be considered
equal if their mathematical value is the same. This class implements this
kind of equality.
Modifier and Type | Method and Description |
---|---|
protected boolean |
doEquivalent(com.fasterxml.jackson.databind.JsonNode a,
com.fasterxml.jackson.databind.JsonNode b) |
protected int |
doHash(com.fasterxml.jackson.databind.JsonNode t) |
static com.google.common.base.Equivalence<com.fasterxml.jackson.databind.JsonNode> |
getInstance() |
public static com.google.common.base.Equivalence<com.fasterxml.jackson.databind.JsonNode> getInstance()
protected boolean doEquivalent(com.fasterxml.jackson.databind.JsonNode a, com.fasterxml.jackson.databind.JsonNode b)
doEquivalent
in class com.google.common.base.Equivalence<com.fasterxml.jackson.databind.JsonNode>
protected int doHash(com.fasterxml.jackson.databind.JsonNode t)
doHash
in class com.google.common.base.Equivalence<com.fasterxml.jackson.databind.JsonNode>