Class NullAsBlankStringComparator

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.String a, java.lang.String b)
      Called by Javers to compare two Values.
      boolean handlesNulls()
      This flag is used to indicate to Javers whether a comparator implementation wants to handle nulls.
      java.lang.String toString​(java.lang.String value)
      This method has two roles.
      • Methods inherited from class java.lang.Object

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

      • NullAsBlankStringComparator

        public NullAsBlankStringComparator()
    • Method Detail

      • handlesNulls

        public boolean handlesNulls()
        Description copied from interface: CustomValueComparator
        This flag is used to indicate to Javers whether a comparator implementation wants to handle nulls.

        By default, the flag is false and Javers checks if both values are non-null before calling a comparator.
        If any of given values is null — Javers compares them using the standard Java logic:
        • null == null
        • null != non-null

        If the flag is true — Javers skips that logic and allows a comparator to handle nulls on its own. In that case, a comparator holds responsibility for null-safety.
        Specified by:
        handlesNulls in interface CustomValueComparator<java.lang.String>
        See Also:
        NullAsBlankStringComparator