Package io.github.viimeinen1.ainventory
Class IndexStream
java.lang.Object
io.github.viimeinen1.ainventory.IndexStream
Helper to make streaming values to inventory easier.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classStream value with index and value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Stream<IndexStream.StreamValue<T>> toStream(Collection<T> collection) Convert collection to stream withIndexStream.StreamValues.
-
Constructor Details
-
IndexStream
public IndexStream()
-
-
Method Details
-
toStream
Convert collection to stream withIndexStream.StreamValues. Order might be random. Indexes will start at 0. UseStream.limit(long)to limit the amount of values in the stream. Usage: aValueStream.toStream(collection).limit(limit).forEach(val -> {val.index(); val.value()});- Type Parameters:
T- Collection value type- Parameters:
collection- Collection- Returns:
- Stream of
IndexStream.StreamValuewith index and value
-