Class Equal<A>
java.lang.Object
fj.Equal<A>
Tests for equality between two objects.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacePrimitives functions of Equal: alternative minimal definition and overridable methods.static interfacePrimitives functions of Equal: minimal definition and overridable methods. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Equal<BigDecimal> An equal instance for theBigDecimaltype.static final Equal<BigInteger> An equal instance for theBigIntegertype.An equal instance for theBitSettype.An equal instance for thebooleantype.An equal instance for thebytetype.An equal instance for thechartype.private final Equal.Definition<A> An equal instance for thedoubletype.static final Equal<LazyString> An equal instance for lazy strings.An equal instance for thefloattype.static final Equal<HList.HNil> An equal instance for the empty heterogeneous list.An equal instance for theinttype.An equal instance for thelongtype.An equal instance for theNaturaltype.An equal instance for theshorttype.static final Equal<StringBuffer> An equal instance for theStringBuffertype.static final Equal<StringBuilder> An equal instance for theStringBuildertype.An equal instance for theStringtype. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <A> Equal<A> anyEqual()Returns an equal instance that uses theObject.equals(Object)method to test for equality.arrayEqual(Equal<A> ea) An equal instance for theArraytype.static <A,B> Equal <A> Static version ofcontramap(F)<B> Equal<B> Maps the given function across this equal as a contra-variant functor.private static <A,B> Equal.Definition <B> contramapDef(F<B, A> f, Equal.Definition<A> aEqDef) either3Equal(Equal<A> ea, Equal<B> eb, Equal<C> ec) eitherEqual(Equal<A> ea, Equal<B> eb) An equal instance for theEithertype.eq()First-class equality check.Partially applied equality check.booleanReturnstrueif the two given arguments are equal,falseotherwise.static <A> Equal<A> Constructs an equal instance from the given function.static <A> Equal<A> Constructs an equal instance from the given function.static <A> Equal<A> equalDef(Equal.AltDefinition<A> definition) Constructs an equal instance from the given (alternative) definition.static <A> Equal<A> equalDef(Equal.Definition<A> definition) Constructs an equal instance from the given definition.static <A> booleanHelper method to implementObject.equals(Object)correctly.static <A> booleanHelper method to implementObject.equals(Object)correctly.static <E, L extends HList<L>>
Equal<HList.HCons<E, L>> hListEqual(Equal<E> e, Equal<L> l) An equal instance for heterogeneous lists.An equal instance for theListtype.static <A> Equal<NonEmptyList<A>> nonEmptyListEqual(Equal<A> ea) An equal instance for theNonEmptyListtype.not()An equal instance, which reverts equality for selfbooleanReturnstrueif the two given arguments are not equal,falseotherwise.static <A,B> Equal.Definition <A> Begin definition of an equal instance.optionEqual(Equal<A> ea) An equal instance for theOptiontype.An equal instance for a product-1.An equal instance for a product-2.An equal instance for a product-3.An equal instance for a product-4.An equal instance for a product-5.An equal instance for a product-6.An equal instance for a product-7.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.resultEqual(Equal<A> ea, Equal<I> ei) Equal instance for sets.streamEqual(Equal<A> ea) An equal instance for theStreamtype.An equal instance for theTreetype.treeMapEqual(Equal<K> k, Equal<V> v) static <A> Equal<TreeZipper<A>> treeZipperEqual(Equal<A> ea) An equal instance for theTreeZippertype.An equal instance for a vector-2.An equal instance for a vector-3.An equal instance for a vector-4.An equal instance for a vector-5.An equal instance for a vector-6.An equal instance for a vector-7.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 theValidationtype.writerEqual(Equal<A> eq1, Equal<B> eq2) zipperEqual(Equal<A> ea) An equal instance for theZippertype.
-
Field Details
-
def
-
booleanEqual
-
byteEqual
-
charEqual
-
doubleEqual
-
floatEqual
-
intEqual
-
bigintEqual
An equal instance for theBigIntegertype. -
bigdecimalEqual
An equal instance for theBigDecimaltype. -
longEqual
-
shortEqual
-
naturalEqual
-
stringEqual
-
stringBufferEqual
An equal instance for theStringBuffertype. -
stringBuilderEqual
An equal instance for theStringBuildertype. -
bitSetSequal
-
eq
An equal instance for lazy strings. -
hListEqual
An equal instance for the empty heterogeneous list.
-
-
Constructor Details
-
Equal
-
-
Method Details
-
eq
-
notEq
-
eq
-
eq
-
contramap
-
not
-
contramapDef
-
contramap
Static version ofcontramap(F) -
on
Begin definition of an equal instance.- See Also:
-
equal
Constructs an equal instance from the given function. Java 8+ users: useequalDef(Definition)instead.- Parameters:
f- The function to construct the equal with.- Returns:
- An equal instance from the given function.
-
equal
Constructs an equal instance from the given function. Java 8+ users: useequalDef(AltDefinition)instead.- Parameters:
f- The function to construct the equal with.- Returns:
- An equal instance from the given function.
-
equalDef
Constructs an equal instance from the given definition.- Parameters:
definition- a definition of the equal instance.- Returns:
- An equal instance from the given function.
-
equalDef
Constructs an equal instance from the given (alternative) definition.- Parameters:
definition- a definition of the equal instance.- Returns:
- An equal instance from the given function.
-
anyEqual
Returns an equal instance that uses theObject.equals(Object)method to test for equality.- Returns:
- An equal instance that uses the
Object.equals(Object)method to test for equality.
-
eitherEqual
-
either3Equal
-
resultEqual
-
validationEqual
An equal instance for theValidationtype.- Parameters:
ea- Equality across the failing side ofValidation.eb- Equality across the succeeding side ofValidation.- Returns:
- An equal instance for the
Validationtype.
-
listEqual
-
nonEmptyListEqual
An equal instance for theNonEmptyListtype.- Parameters:
ea- Equality across the elements of the non-empty list.- Returns:
- An equal instance for the
NonEmptyListtype.
-
optionEqual
-
seqEqual
-
streamEqual
-
zipperEqual
-
treeZipperEqual
An equal instance for theTreeZippertype.- Parameters:
ea- Equality across the elements of the tree zipper.- Returns:
- An equal instance for the
TreeZippertype.
-
arrayEqual
-
treeEqual
-
p1Equal
-
p2Equal
-
p3Equal
An equal instance for a product-3.- Parameters:
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.- Returns:
- An equal instance for a product-3.
-
p4Equal
public static <A,B, Equal<P4<A,C, D> B, p4EqualC, D>> (Equal<A> ea, Equal<B> eb, Equal<C> ec, Equal<D> ed) An equal instance for a product-4.- Parameters:
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.- Returns:
- An equal instance for a product-4.
-
p5Equal
public static <A,B, Equal<P5<A,C, D, E> B, p5EqualC, D, E>> (Equal<A> ea, Equal<B> eb, Equal<C> ec, Equal<D> ed, Equal<E> ee) An equal instance for a product-5.- Parameters:
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.- Returns:
- An equal instance for a product-5.
-
p6Equal
public static <A,B, Equal<P6<A,C, D, E, F$> B, p6EqualC, D, E, F$>> (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.- Parameters:
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.- Returns:
- An equal instance for a product-6.
-
p7Equal
public static <A,B, Equal<P7<A,C, D, E, F$, G> B, p7EqualC, D, E, F$, G>> (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.- Parameters:
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.- Returns:
- An equal instance for a product-7.
-
p8Equal
public static <A,B, Equal<P8<A,C, D, E, F$, G, H> B, p8EqualC, D, E, F$, G, H>> (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.- Parameters:
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.- Returns:
- An equal instance for a product-8.
-
v2Equal
-
v3Equal
-
v4Equal
-
v5Equal
-
v6Equal
-
v7Equal
-
v8Equal
-
hListEqual
An equal instance for heterogeneous lists.- Parameters:
e- Equality for the first element of the list.l- Equality for the rest of the list.- Returns:
- an equal instance for a heterogeneous list.
-
setEqual
-
treeMapEqual
-
writerEqual
-
equals0
Helper method to implementObject.equals(Object)correctly. DO NOT USE it for any other purpose.- Parameters:
clazz- the class in which theObject.equals(Object)is implementedself- a reference to 'this'other- the other object of the comparisonequal- an equal instance for the type of self (that useanyEqual()if generic type).- Returns:
- true if self and other are equal
-
equals0
Helper method to implementObject.equals(Object)correctly. DO NOT USE it for any other purpose.- Parameters:
clazz- the class in which theObject.equals(Object)is implementedself- a reference to 'this'other- the other object of the comparisonequal- a lazy equal instance for the type (that useanyEqual()if generic type)..- Returns:
- true if self and other are equal
-