public static <A,B> LabelValue<A,B> with(final A label, final B value) { return new LabelValue<A,B>(label,value); }
public static <X> LabelValue<X,X> fromIterable(final Iterable<X> iterable, int index) { return fromIterable(iterable, index, false); }
public <Y> LabelValue<A,Y> setValue(final Y value) { return new LabelValue<A,Y>(this.label, value); }
public static <X> LabelValue<X,X> fromCollection(final Collection<X> collection) { return fromIterable(collection); }
public <X> LabelValue<X,B> setLabel(final X label) { return new LabelValue<X,B>(label, this.value); }
public static <X> LabelValue<X,X> fromIterable(final Iterable<X> iterable) { return fromIterable(iterable, 0, true); }
public static <A,B> LabelValue<A,B> with(final A label, final B value) { return new LabelValue<A,B>(label,value); }
public static <X> LabelValue<X,X> fromCollection(final Collection<X> collection) { return fromIterable(collection); }
public <X> LabelValue<X,B> setLabel(final X label) { return new LabelValue<X,B>(label, this.value); }
public static <X> LabelValue<X,X> fromIterable(final Iterable<X> iterable, int index) { return fromIterable(iterable, index, false); }
public <Y> LabelValue<A,Y> setValue(final Y value) { return new LabelValue<A,Y>(this.label, value); }
public static <X> LabelValue<X,X> fromIterable(final Iterable<X> iterable) { return fromIterable(iterable, 0, true); }
/** * <p> * Create tuple from array. Array has to have exactly two elements. * </p> * * @param <X> the array component type * @param array the array to be converted to a tuple * @return the tuple */ public static <X> LabelValue<X,X> fromArray(final X[] array) { if (array == null) { throw new IllegalArgumentException("Array cannot be null"); } if (array.length != 2) { throw new IllegalArgumentException("Array must have exactly 2 elements in order to create a LabelValue. Size is " + array.length); } return new LabelValue<X,X>(array[0],array[1]); }
/** * <p> * Create tuple from array. Array has to have exactly two elements. * </p> * * @param <X> the array component type * @param array the array to be converted to a tuple * @return the tuple */ public static <X> LabelValue<X,X> fromArray(final X[] array) { if (array == null) { throw new IllegalArgumentException("Array cannot be null"); } if (array.length != 2) { throw new IllegalArgumentException("Array must have exactly 2 elements in order to create a LabelValue. Size is " + array.length); } return new LabelValue<X,X>(array[0],array[1]); }
return new LabelValue<X,X>(element0, element1);
return new LabelValue<X,X>(element0, element1);