-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathPartCollection.java
40 lines (35 loc) · 1.12 KB
/
PartCollection.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Made with all the love in the world
* by scireum in Remshalden, Germany
*
* Copyright by scireum GmbH
* http://www.scireum.de - [email protected]
*/
package sirius.kernel.di;
import javax.annotation.Nonnull;
import java.util.Collection;
/**
* Represents a collection, which always contains all registered parts for the
* given interface (PartCollection{@link #getInterface()}.
* <p>
* This is the content of a field wearing the {@link sirius.kernel.di.std.Parts} annotation.
*
* @param <P> the type of objects in the collection
*/
public interface PartCollection<P> extends Iterable<P> {
/**
* Returns the class which is used to fetch parts from the {@link GlobalContext}
*
* @return the class which is used to determine which parts should be in this collection.
*/
@Nonnull
Class<P> getInterface();
/**
* Returns all parts currently registered for the given class.
*
* @return all parts in the {@link GlobalContext} which were registered for the given class. If no parts are found,
* and empty collection is returned.
*/
@Nonnull
Collection<P> getParts();
}