public final class LabelValue<A,B> extends Tuple implements IValueLabel<A>, IValueValue<B>
A tuple of two elements, with positions 0 and 1 renamed as "label" and "value", respectively.
| Constructor and Description |
|---|
LabelValue(A label,
B value) |
| Modifier and Type | Method and Description |
|---|---|
static <X> LabelValue<X,X> |
fromArray(X[] array)
Create tuple from array.
|
static <X> LabelValue<X,X> |
fromCollection(Collection<X> collection) |
static <X> LabelValue<X,X> |
fromIterable(Iterable<X> iterable) |
static <X> LabelValue<X,X> |
fromIterable(Iterable<X> iterable,
int index) |
A |
getLabel() |
static int |
getSize() |
B |
getValue() |
<X> LabelValue<X,B> |
setLabel(X label) |
<Y> LabelValue<A,Y> |
setValue(Y value) |
static <A,B> LabelValue<A,B> |
with(A label,
B value) |
compareTo, contains, containsAll, containsAll, equals, getValue, hashCode, indexOf, iterator, lastIndexOf, toArray, toList, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic static <A,B> LabelValue<A,B> with(A label, B value)
public static <X> LabelValue<X,X> fromArray(X[] array)
Create tuple from array. Array has to have exactly two elements.
X - the array component typearray - the array to be converted to a tuplepublic static <X> LabelValue<X,X> fromCollection(Collection<X> collection)
public static <X> LabelValue<X,X> fromIterable(Iterable<X> iterable)
public static <X> LabelValue<X,X> fromIterable(Iterable<X> iterable, int index)
public A getLabel()
getLabel in interface IValueLabel<A>public B getValue()
getValue in interface IValueValue<B>public static int getSize()
public <X> LabelValue<X,B> setLabel(X label)
public <Y> LabelValue<A,Y> setValue(Y value)
Copyright © 2020 Flipkart. All rights reserved.