Class JsonNumEquals


  • public final class JsonNumEquals
    extends java.lang.Object
    An com.google.common.base.Equivalence like 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.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equivalent​(com.fasterxml.jackson.databind.JsonNode a, com.fasterxml.jackson.databind.JsonNode b)  
      static JsonNumEquals getInstance()  
      int hash​(com.fasterxml.jackson.databind.JsonNode t)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • 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)