/** * <p> * Create tuple from collection. Collection has to have exactly seven elements. * </p> * * @param <X> the collection component type * @param collection the collection to be converted to a tuple * @return the tuple */ public static <X> Septet<X,X,X,X,X,X,X> fromCollection(final Collection<X> collection) { return fromIterable(collection); }
/** * <p> * Create tuple from iterable. Iterable has to have exactly seven elements. * </p> * * @param <X> the iterable component type * @param iterable the iterable to be converted to a tuple * @return the tuple */ public static <X> Septet<X,X,X,X,X,X,X> fromIterable(final Iterable<X> iterable) { return fromIterable(iterable, 0, true); }
/** * <p> * Create tuple from iterable. Iterable has to have exactly seven elements. * </p> * * @param <X> the iterable component type * @param iterable the iterable to be converted to a tuple * @return the tuple */ public static <X> Septet<X,X,X,X,X,X,X> fromIterable(final Iterable<X> iterable) { return fromIterable(iterable, 0, true); }
/** * <p> * Create tuple from collection. Collection has to have exactly seven elements. * </p> * * @param <X> the collection component type * @param collection the collection to be converted to a tuple * @return the tuple */ public static <X> Septet<X,X,X,X,X,X,X> fromCollection(final Collection<X> collection) { return fromIterable(collection); }
/** * <p> * Create tuple from iterable, starting from the specified index. Iterable * can have more (or less) elements than the tuple to be created. * </p> * * @param <X> the iterable component type * @param iterable the iterable to be converted to a tuple * @return the tuple */ public static <X> Septet<X,X,X,X,X,X,X> fromIterable(final Iterable<X> iterable, int index) { return fromIterable(iterable, index, false); }
/** * <p> * Create tuple from iterable, starting from the specified index. Iterable * can have more (or less) elements than the tuple to be created. * </p> * * @param <X> the iterable component type * @param iterable the iterable to be converted to a tuple * @return the tuple */ public static <X> Septet<X,X,X,X,X,X,X> fromIterable(final Iterable<X> iterable, int index) { return fromIterable(iterable, index, false); }