Package io.vavr
Interface Iterable<T>
-
- Type Parameters:
T
- the element type
- All Superinterfaces:
java.lang.Iterable<T>
- All Known Subinterfaces:
Future<T>
,IndexedSeq<T>
,Iterator<T>
,LinearSeq<T>
,Map<K,V>
,Multimap<K,V>
,Seq<T>
,Set<T>
,SortedMap<K,V>
,SortedMultimap<K,V>
,SortedSet<T>
,Traversable<T>
- All Known Implementing Classes:
Array
,BitSet
,CharSeq
,Either
,Either.Left
,Either.Right
,HashMap
,HashMultimap
,HashSet
,LinkedHashMap
,LinkedHashMultimap
,LinkedHashSet
,List
,List.Cons
,List.Nil
,Option
,Option.None
,Option.Some
,PriorityQueue
,Queue
,Stream
,Stream.Cons
,Stream.Empty
,Tree
,Tree.Empty
,Tree.Node
,TreeMap
,TreeMultimap
,TreeSet
,Try
,Try.Failure
,Try.Success
,Validation
,Validation.Invalid
,Validation.Valid
,Vector
public interface Iterable<T> extends java.lang.Iterable<T>
Extension of the well-known JavaIterable
in the sense that a rich VavrIterator
is returned byiterator()
.
-
-
Method Summary
Modifier and Type Method Description Iterator<T>
iterator()
Returns a richIterator
that allows us to perform intermediate, sequential operations known from Vavr's collection library.default <C> C
to(java.util.function.Function<? super java.lang.Iterable<T>,C> fromIterable)
A generic conversion function.
-
-
-
Method Detail
-
iterator
Iterator<T> iterator()
Returns a richIterator
that allows us to perform intermediate, sequential operations known from Vavr's collection library.
-
to
default <C> C to(java.util.function.Function<? super java.lang.Iterable<T>,C> fromIterable)
A generic conversion function.Example:
List<Integer> list = Option.some(1).to(List::ofAll);
- Type Parameters:
C
- the target type of the conversion- Parameters:
fromIterable
- A function that converts aIterable
to some typeC
.- Returns:
- a new instance of type
C
that must not benull
per contract
-
-