Class SetHelpers


  • public final class SetHelpers
    extends java.lang.Object
    Helper methods for implementers of custom Sets.

    If you are implementing a custom Set, your equals and hashCode methods SHOULD delegate to setEquals and setHashCode, respectively. This will ensure that equality works correctly with the built-in Set types.

    Your toString method MAY delegate to setToString.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean setEquals​(Set<?> set, Set<?> other)  
      static int setHashCode​(Set<?> set)  
      static java.lang.String setToString​(Set<?> set)  
      • Methods inherited from class java.lang.Object

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

      • setEquals

        public static boolean setEquals​(Set<?> set,
                                        Set<?> other)
      • setHashCode

        public static int setHashCode​(Set<?> set)
      • setToString

        public static java.lang.String setToString​(Set<?> set)