Package org.ametys.plugins.repository
Class IdCollectionIterable<A extends AmetysObject>
java.lang.Object
org.ametys.plugins.repository.IdCollectionIterable<A>
- Type Parameters:
A
- the actual type ofAmetysObject
s
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterable<A>
,AmetysObjectIterable<A>
public class IdCollectionIterable<A extends AmetysObject>
extends Object
implements AmetysObjectIterable<A>
Implementation of an
AmetysObjectIterable
based on a Collection
of AmetysObject IDs.
The AmetysObjects are resolved when next() is called.-
Constructor Summary
ConstructorDescriptionIdCollectionIterable
(AmetysObjectResolver resolver, Collection<String> ids) Creates aIdCollectionIterable
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the associated resources.
AnAmetysObjectIterable
must NOT be closed if any of the containedAmetysObject
is still in use.long
getSize()
Returns the number of elements in this iterable.iterator()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.plugins.repository.AmetysObjectIterable
spliterator, stream
-
Constructor Details
-
IdCollectionIterable
Creates aIdCollectionIterable
.- Parameters:
resolver
- The AmetysObject resolver.ids
- theAmetysObject
s collection
-
-
Method Details
-
getSize
Description copied from interface:AmetysObjectIterable
Returns the number of elements in this iterable. If this information is unavailable, returns -1.- Specified by:
getSize
in interfaceAmetysObjectIterable<A extends AmetysObject>
- Returns:
- a long
-
iterator
- Specified by:
iterator
in interfaceAmetysObjectIterable<A extends AmetysObject>
- Specified by:
iterator
in interfaceIterable<A extends AmetysObject>
-
close
Description copied from interface:AmetysObjectIterable
Close the associated resources.
AnAmetysObjectIterable
must NOT be closed if any of the containedAmetysObject
is still in use.- Specified by:
close
in interfaceAmetysObjectIterable<A extends AmetysObject>
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-