Package com.atlassian.jira.util.collect
Class CollectionEnclosedIterable<T>
java.lang.Object
com.atlassian.jira.util.collect.CollectionEnclosedIterable<T>
- Type Parameters:
T-
- All Implemented Interfaces:
EnclosedIterable<T>,Sized
Simple collection based
EnclosedIterable.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.util.collect.EnclosedIterable
EnclosedIterable.Functions, EnclosedIterable.ListResolver<T> -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> EnclosedIterable<T>copy(Collection<? extends T> collection) booleanvoidApply the sink to all elements in the Collection.static <T> EnclosedIterable<T>from(Collection<? extends T> collection) Create anEnclosedIterablefrom the supplied Collection.inthashCode()booleanisEmpty()intsize()
-
Method Details
-
from
Create anEnclosedIterablefrom the supplied Collection. Does not copy the collection so you should only use this if you are about to lose the reference or the collection is immutable.- Type Parameters:
T- the collection type- Parameters:
collection-- Returns:
-
copy
-
foreach
Description copied from interface:EnclosedIterableApply the sink to all elements in the Collection.- Specified by:
foreachin interfaceEnclosedIterable<T>
-
size
public int size()- Specified by:
sizein interfaceEnclosedIterable<T>- Specified by:
sizein interfaceSized- Returns:
- the likely size of the objects passed into the sink in
EnclosedIterable.foreach(Consumer). Be careful depending on this size being exact, as in many cases its best efforts value or may be unstable due to concurrent changes.
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceEnclosedIterable<T>- Specified by:
isEmptyin interfaceSized- Returns:
- true if the there is no data behind it.
-
equals
-
hashCode
public int hashCode()
-