public final class Equal<A>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Equal<java.math.BigDecimal> |
bigdecimalEqual
An equal instance for the
BigDecimal type. |
static Equal<java.math.BigInteger> |
bigintEqual
An equal instance for the
BigInteger type. |
static Equal<java.lang.Boolean> |
booleanEqual
An equal instance for the
boolean type. |
static Equal<java.lang.Byte> |
byteEqual
An equal instance for the
byte type. |
static Equal<java.lang.Character> |
charEqual
An equal instance for the
char type. |
static Equal<java.lang.Double> |
doubleEqual
An equal instance for the
double type. |
static Equal<LazyString> |
eq
An equal instance for lazy strings.
|
static Equal<java.lang.Float> |
floatEqual
An equal instance for the
float type. |
static Equal<HList.HNil> |
hListEqual
An equal instance for the empty heterogeneous list.
|
static Equal<java.lang.Integer> |
intEqual
An equal instance for the
int type. |
static Equal<java.lang.Long> |
longEqual
An equal instance for the
long type. |
static Equal<Natural> |
naturalEqual
An equal instance for the
Natural type. |
static Equal<java.lang.Short> |
shortEqual
An equal instance for the
short type. |
static Equal<java.lang.StringBuffer> |
stringBufferEqual
An equal instance for the
StringBuffer type. |
static Equal<java.lang.StringBuilder> |
stringBuilderEqual
An equal instance for the
StringBuilder type. |
static Equal<java.lang.String> |
stringEqual
An equal instance for the
String type. |
Modifier and Type | Method and Description |
---|---|
static <A> Equal<A> |
anyEqual()
Returns an equal instance that uses the
Object.equals(Object) method to test for
equality. |
static <A> Equal<Array<A>> |
arrayEqual(Equal<A> ea)
An equal instance for the
Array type. |
<B> Equal<B> |
contramap(F<B,A> f)
Maps the given function across this equal as a contra-variant functor.
|
static <A,B> Equal<Either<A,B>> |
eitherEqual(Equal<A> ea,
Equal<B> eb)
An equal instance for the
Either type. |
F2<A,A,java.lang.Boolean> |
eq()
First-class equality check.
|
F<A,java.lang.Boolean> |
eq(A a)
Partially applied equality check.
|
boolean |
eq(A a1,
A a2)
Returns
true if the two given arguments are equal, false otherwise. |
static <A> Equal<A> |
equal(F<A,F<A,java.lang.Boolean>> f)
Constructs an equal instance from the given function.
|
static <A> boolean |
equals0(java.lang.Class<? super A> clazz,
A self,
java.lang.Object other,
Equal<A> equal)
Helper method to implement
Object.equals(Object) correctly. |
static <A> boolean |
equals0(java.lang.Class<? super A> clazz,
A self,
java.lang.Object other,
F0<Equal<A>> equal)
Helper method to implement
Object.equals(Object) correctly. |
static <E,L extends HList<L>> |
hListEqual(Equal<E> e,
Equal<L> l)
An equal instance for heterogeneous lists.
|
static <A> Equal<List<A>> |
listEqual(Equal<A> ea)
An equal instance for the
List type. |
static <A> Equal<NonEmptyList<A>> |
nonEmptyListEqual(Equal<A> ea)
An equal instance for the
NonEmptyList type. |
boolean |
notEq(A a1,
A a2)
Returns
true if the two given arguments are not equal, false otherwise. |
static <A> Equal<Option<A>> |
optionEqual(Equal<A> ea)
An equal instance for the
Option type. |
static <A> Equal<P1<A>> |
p1Equal(Equal<A> ea)
An equal instance for a product-1.
|
static <A,B> Equal<P2<A,B>> |
p2Equal(Equal<A> ea,
Equal<B> eb)
An equal instance for a product-2.
|
static <A,B,C> Equal<P3<A,B,C>> |
p3Equal(Equal<A> ea,
Equal<B> eb,
Equal<C> ec)
An equal instance for a product-3.
|
static <A,B,C,D> Equal<P4<A,B,C,D>> |
p4Equal(Equal<A> ea,
Equal<B> eb,
Equal<C> ec,
Equal<D> ed)
An equal instance for a product-4.
|
static <A,B,C,D,E> |
p5Equal(Equal<A> ea,
Equal<B> eb,
Equal<C> ec,
Equal<D> ed,
Equal<E> ee)
An equal instance for a product-5.
|
static <A,B,C,D,E,F$> |
p6Equal(Equal<A> ea,
Equal<B> eb,
Equal<C> ec,
Equal<D> ed,
Equal<E> ee,
Equal<F$> ef)
An equal instance for a product-6.
|
static <A,B,C,D,E,F$,G> |
p7Equal(Equal<A> ea,
Equal<B> eb,
Equal<C> ec,
Equal<D> ed,
Equal<E> ee,
Equal<F$> ef,
Equal<G> eg)
An equal instance for a product-7.
|
static <A,B,C,D,E,F$,G,H> |
p8Equal(Equal<A> ea,
Equal<B> eb,
Equal<C> ec,
Equal<D> ed,
Equal<E> ee,
Equal<F$> ef,
Equal<G> eg,
Equal<H> eh)
An equal instance for a product-8.
|
static <A> Equal<Seq<A>> |
seqEqual(Equal<A> e) |
static <A> Equal<Set<A>> |
setEqual(Equal<A> e)
Equal instance for sets.
|
static <A> Equal<Stream<A>> |
streamEqual(Equal<A> ea)
An equal instance for the
Stream type. |
static <A> Equal<Tree<A>> |
treeEqual(Equal<A> ea)
An equal instance for the
Tree type. |
static <K,V> Equal<TreeMap<K,V>> |
treeMapEqual(Equal<K> k,
Equal<V> v) |
static <A> Equal<V2<A>> |
v2Equal(Equal<A> ea)
An equal instance for a vector-2.
|
static <A> Equal<V3<A>> |
v3Equal(Equal<A> ea)
An equal instance for a vector-3.
|
static <A> Equal<V4<A>> |
v4Equal(Equal<A> ea)
An equal instance for a vector-4.
|
static <A> Equal<V5<A>> |
v5Equal(Equal<A> ea)
An equal instance for a vector-5.
|
static <A> Equal<V6<A>> |
v6Equal(Equal<A> ea)
An equal instance for a vector-6.
|
static <A> Equal<V7<A>> |
v7Equal(Equal<A> ea)
An equal instance for a vector-7.
|
static <A> Equal<V8<A>> |
v8Equal(Equal<A> ea)
An equal instance for a vector-8.
|
static <A,B> Equal<Validation<A,B>> |
validationEqual(Equal<A> ea,
Equal<B> eb)
An equal instance for the
Validation type. |
static <A,B> Equal<Writer<A,B>> |
writerEqual(Equal<A> eq1,
Equal<B> eq2) |
public static final Equal<java.lang.Boolean> booleanEqual
boolean
type.public static final Equal<java.lang.Byte> byteEqual
byte
type.public static final Equal<java.lang.Character> charEqual
char
type.public static final Equal<java.lang.Double> doubleEqual
double
type.public static final Equal<java.lang.Float> floatEqual
float
type.public static final Equal<java.lang.Integer> intEqual
int
type.public static final Equal<java.math.BigInteger> bigintEqual
BigInteger
type.public static final Equal<java.math.BigDecimal> bigdecimalEqual
BigDecimal
type.public static final Equal<java.lang.Long> longEqual
long
type.public static final Equal<java.lang.Short> shortEqual
short
type.public static final Equal<Natural> naturalEqual
Natural
type.public static final Equal<java.lang.String> stringEqual
String
type.public static final Equal<java.lang.StringBuffer> stringBufferEqual
StringBuffer
type.public static final Equal<java.lang.StringBuilder> stringBuilderEqual
StringBuilder
type.public static final Equal<LazyString> eq
public static final Equal<HList.HNil> hListEqual
public boolean eq(A a1, A a2)
true
if the two given arguments are equal, false
otherwise.a1
- An object to test for equality against another.a2
- An object to test for equality against another.true
if the two given arguments are equal, false
otherwise.public boolean notEq(A a1, A a2)
true
if the two given arguments are not equal, false
otherwise.a1
- An object to test for inequality against another.a2
- An object to test for inequality against another.true
if the two given arguments are not equal, false
otherwise.public F2<A,A,java.lang.Boolean> eq()
true
if the two given arguments are equal.public F<A,java.lang.Boolean> eq(A a)
a
- An object to test for equality against another.true
if the given argument equals the argument to this method.public <B> Equal<B> contramap(F<B,A> f)
f
- The function to map.public static <A> Equal<A> equal(F<A,F<A,java.lang.Boolean>> f)
f
- The function to construct the equal with.public static <A> Equal<A> anyEqual()
Object.equals(Object)
method to test for
equality.Object.equals(Object)
method to test for
equality.public static <A,B> Equal<Either<A,B>> eitherEqual(Equal<A> ea, Equal<B> eb)
Either
type.public static <A,B> Equal<Validation<A,B>> validationEqual(Equal<A> ea, Equal<B> eb)
Validation
type.ea
- Equality across the failing side of Validation
.eb
- Equality across the succeeding side of Validation
.Validation
type.public static <A> Equal<List<A>> listEqual(Equal<A> ea)
List
type.ea
- Equality across the elements of the list.List
type.public static <A> Equal<NonEmptyList<A>> nonEmptyListEqual(Equal<A> ea)
NonEmptyList
type.ea
- Equality across the elements of the non-empty list.NonEmptyList
type.public static <A> Equal<Option<A>> optionEqual(Equal<A> ea)
Option
type.ea
- Equality across the element of the option.Option
type.public static <A> Equal<Stream<A>> streamEqual(Equal<A> ea)
Stream
type.ea
- Equality across the elements of the stream.Stream
type.public static <A> Equal<Array<A>> arrayEqual(Equal<A> ea)
Array
type.ea
- Equality across the elements of the array.Array
type.public static <A> Equal<Tree<A>> treeEqual(Equal<A> ea)
Tree
type.ea
- Equality across the elements of the tree.Tree
type.public static <A> Equal<P1<A>> p1Equal(Equal<A> ea)
ea
- Equality across the first element of the product.public static <A,B> Equal<P2<A,B>> p2Equal(Equal<A> ea, Equal<B> eb)
ea
- Equality across the first element of the product.eb
- Equality across the second element of the product.public static <A,B,C> Equal<P3<A,B,C>> p3Equal(Equal<A> ea, Equal<B> eb, Equal<C> ec)
ea
- Equality across the first element of the product.eb
- Equality across the second element of the product.ec
- Equality across the third element of the product.public static <A,B,C,D> Equal<P4<A,B,C,D>> p4Equal(Equal<A> ea, Equal<B> eb, Equal<C> ec, Equal<D> ed)
ea
- Equality across the first element of the product.eb
- Equality across the second element of the product.ec
- Equality across the third element of the product.ed
- Equality across the fourth element of the product.public static <A,B,C,D,E> Equal<P5<A,B,C,D,E>> p5Equal(Equal<A> ea, Equal<B> eb, Equal<C> ec, Equal<D> ed, Equal<E> ee)
ea
- Equality across the first element of the product.eb
- Equality across the second element of the product.ec
- Equality across the third element of the product.ed
- Equality across the fourth element of the product.ee
- Equality across the fifth element of the product.public static <A,B,C,D,E,F$> Equal<P6<A,B,C,D,E,F$>> p6Equal(Equal<A> ea, Equal<B> eb, Equal<C> ec, Equal<D> ed, Equal<E> ee, Equal<F$> ef)
ea
- Equality across the first element of the product.eb
- Equality across the second element of the product.ec
- Equality across the third element of the product.ed
- Equality across the fourth element of the product.ee
- Equality across the fifth element of the product.ef
- Equality across the sixth element of the product.public static <A,B,C,D,E,F$,G> Equal<P7<A,B,C,D,E,F$,G>> p7Equal(Equal<A> ea, Equal<B> eb, Equal<C> ec, Equal<D> ed, Equal<E> ee, Equal<F$> ef, Equal<G> eg)
ea
- Equality across the first element of the product.eb
- Equality across the second element of the product.ec
- Equality across the third element of the product.ed
- Equality across the fourth element of the product.ee
- Equality across the fifth element of the product.ef
- Equality across the sixth element of the product.eg
- Equality across the seventh element of the product.public static <A,B,C,D,E,F$,G,H> Equal<P8<A,B,C,D,E,F$,G,H>> p8Equal(Equal<A> ea, Equal<B> eb, Equal<C> ec, Equal<D> ed, Equal<E> ee, Equal<F$> ef, Equal<G> eg, Equal<H> eh)
ea
- Equality across the first element of the product.eb
- Equality across the second element of the product.ec
- Equality across the third element of the product.ed
- Equality across the fourth element of the product.ee
- Equality across the fifth element of the product.ef
- Equality across the sixth element of the product.eg
- Equality across the seventh element of the product.eh
- Equality across the eighth element of the product.public static <A> Equal<V2<A>> v2Equal(Equal<A> ea)
ea
- Equality across the elements of the vector.public static <A> Equal<V3<A>> v3Equal(Equal<A> ea)
ea
- Equality across the elements of the vector.public static <A> Equal<V4<A>> v4Equal(Equal<A> ea)
ea
- Equality across the elements of the vector.public static <A> Equal<V5<A>> v5Equal(Equal<A> ea)
ea
- Equality across the elements of the vector.public static <A> Equal<V6<A>> v6Equal(Equal<A> ea)
ea
- Equality across the elements of the vector.public static <A> Equal<V7<A>> v7Equal(Equal<A> ea)
ea
- Equality across the elements of the vector.public static <A> Equal<V8<A>> v8Equal(Equal<A> ea)
ea
- Equality across the elements of the vector.public static <E,L extends HList<L>> Equal<HList.HCons<E,L>> hListEqual(Equal<E> e, Equal<L> l)
e
- Equality for the first element of the list.l
- Equality for the rest of the list.public static <A> Equal<Set<A>> setEqual(Equal<A> e)
e
- Equality for the set elements.public static <A> boolean equals0(java.lang.Class<? super A> clazz, A self, java.lang.Object other, Equal<A> equal)
Object.equals(Object)
correctly. DO NOT USE it for any other purpose.clazz
- the class in which the Object.equals(Object)
is implementedself
- a reference to 'this'other
- the other object of the comparisonequal
- an equal instance for the type of self (that use anyEqual()
if generic type).public static <A> boolean equals0(java.lang.Class<? super A> clazz, A self, java.lang.Object other, F0<Equal<A>> equal)
Object.equals(Object)
correctly. DO NOT USE it for any other purpose.clazz
- the class in which the Object.equals(Object)
is implementedself
- a reference to 'this'other
- the other object of the comparisonequal
- a lazy equal instance for the type (that use anyEqual()
if generic type)..