public final class JsonNumEquals extends Equivalence<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 JSON Schema mandates that numeric JSON
values are equal if their mathematical value is the same. This class
enforces this kind of equality.
Equivalence.Wrapper<T>| Modifier and Type | Method and Description |
|---|---|
protected boolean |
doEquivalent(JsonNode a,
JsonNode b) |
protected int |
doHash(JsonNode t) |
static Equivalence<JsonNode> |
getInstance() |
equals, equivalent, equivalentTo, hash, identity, onResultOf, pairwise, wrappublic static Equivalence<JsonNode> getInstance()
protected boolean doEquivalent(JsonNode a, JsonNode b)
doEquivalent in class Equivalence<JsonNode>protected int doHash(JsonNode t)
doHash in class Equivalence<JsonNode>Copyright © 2013. All Rights Reserved.