Class Single<T1>
- java.lang.Object
-
- dk.cloudcreate.essentials.shared.functional.tuple.Single<T1>
-
- Type Parameters:
T1- the first element type
- All Implemented Interfaces:
Tuple<Single<T1>>,Serializable
public class Single<T1> extends Object implements Tuple<Single<T1>>
Represents aTuplewith one element.
Note:Singlesupportsequals(Object)comparison using subclasses, e.g.:public class Option extends Single<String> { public Option(String optionalValue) { super(optionalValue); } }- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T1_1()Returns the first element in this tupleintarity()Number of arguments/elements in the Tuplebooleanequals(Object o)inthashCode()<R1> Single<R1>map(Function<? super T1,? extends R1> mappingFunction)Maps the element of thisSingleusing the mapping functionList<?>toList()Convert the Tuple to a listStringtoString()
-
-
-
Field Detail
-
_1
public final T1 _1
The first element in this tuple
-
-
Method Detail
-
arity
public int arity()
Description copied from interface:TupleNumber of arguments/elements in the Tuple
-
_1
public T1 _1()
Returns the first element in this tuple- Returns:
- the first element in this tuple
-
map
public <R1> Single<R1> map(Function<? super T1,? extends R1> mappingFunction)
Maps the element of thisSingleusing the mapping function
-
-