class CanEqualsSupport[T] extends AnyRef
Convenience support to easily write correct equals and hashCode methods as well as canEqual methods.
.Example [source,java] ---- class MyDataClass {
private final String a; private final Long b;
public MyDataClass(String a, Long b) { this.a = a; this.b = b; }
private static final CanEqualsSupport<MyDataClass> eq = new CanEqualsSupport<>(MyDataClass.class, (a,b) -> a.canEqual(b), c -> c.a, c -> c.b );
- Alphabetic
- By Inheritance
- CanEqualsSupport
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new CanEqualsSupport(thisType: Class[T], fields: <repeated...>[F1[T, AnyRef]])
This create a
CanEqualsSupportthat uses reflection to detect thecanEqualmethod.This create a
CanEqualsSupportthat uses reflection to detect thecanEqualmethod.- thisType
The type of the class to which the equals and hashCode methods belong.
- fields
The accessor functions returning the values (fields/getters) that should be part of the equals/hashCode contract.
- Annotations
- @SafeVarargs()
- new CanEqualsSupport(thisType: Class[T], canEqualFunction: F2[T, T, Boolean], fields: <repeated...>[F1[T, AnyRef]])
- Annotations
- @SafeVarargs()
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def _canEqual(other: AnyRef): Boolean
- def _equals(me: T, other: AnyRef): Boolean
- def _hashCode(me: T, superHashCode: Int): Int
- def _hashCode(me: T): Int
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()