Package com.gravity9.jsonpatch.jackson
Class JsonNumEquals
- java.lang.Object
-
- com.gravity9.jsonpatch.jackson.JsonNumEquals
-
public final class JsonNumEquals extends java.lang.ObjectAncom.google.common.base.Equivalencelike strategy for JSON Schema equalityJsonNodedoes a pretty good job of obeying theequals()/hashCode()contract. And in fact, it does it too well for JSON Schema.For instance, it considers numeric nodes
1and1.0to 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.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequivalent(com.fasterxml.jackson.databind.JsonNode a, com.fasterxml.jackson.databind.JsonNode b)static JsonNumEqualsgetInstance()inthash(com.fasterxml.jackson.databind.JsonNode t)
-
-
-
Method Detail
-
getInstance
public static JsonNumEquals getInstance()
-
equivalent
public final boolean equivalent(@Nullable com.fasterxml.jackson.databind.JsonNode a, @Nullable com.fasterxml.jackson.databind.JsonNode b)
-
hash
public int hash(@Nullable com.fasterxml.jackson.databind.JsonNode t)
-
-