Uses of Package
dk.cloudcreate.essentials.shared.functional.tuple
-
Packages that use dk.cloudcreate.essentials.shared.functional.tuple Package Description dk.cloudcreate.essentials.shared.collections dk.cloudcreate.essentials.shared.functional.tuple -
Classes in dk.cloudcreate.essentials.shared.functional.tuple used by dk.cloudcreate.essentials.shared.collections Class Description Pair Represents aTuplewith two elements.
Note:PairsupportsPair.equals(Object)comparison using subclasses, e.g.: -
Classes in dk.cloudcreate.essentials.shared.functional.tuple used by dk.cloudcreate.essentials.shared.functional.tuple Class Description Either Represents aTuplewith two potential elements, but where only one element can have a value at a time
This is used to represent a choice type that can have two different values, but only one value at a time.
The value can either beEither._1()OREither._2()
UseEither(Object, Object)orEither.of_1(Object)/Either.of_2(Object)to create a newEitherinstance
UseEither.is_1()orEither.is_2()to check which value is non-null andEither._1()orEither._2()to get the value of the element.
Conditional logic can be applied usingEither.ifIs_1(Consumer)orEither.ifIs_2(Consumer)Empty Represents aTuplewith zero elementsPair Represents aTuplewith two elements.
Note:PairsupportsPair.equals(Object)comparison using subclasses, e.g.:Single Represents aTuplewith one element.
Note:SinglesupportsSingle.equals(Object)comparison using subclasses, e.g.:Triple Represents aTuplewith three elements.
Note:TriplesupportsTriple.equals(Object)comparison using subclasses, e.g.:Tuple Base interface for allTuple's.
ATupleis an immutable object that can contain the following (supported) number of elements: Number of element in TupleConcreteTupletypeFactory method 0EmptyTuple.empty()1SingleTuple.of(Object)2PairTuple.of(Object, Object)3TripleTuple.of(Object, Object, Object)
Note:Tuple(and its subclasses) supportsObject.equals(Object)comparison using subclasses for the different subclasses