final class RankedBindings<T> extends java.lang.Object implements java.lang.Iterable<com.google.inject.Binding<T>>, BindingSubscriber<T>
Binding
s of a given type; subscribes to BindingPublisher
s on demand.Modifier and Type | Class and Description |
---|---|
(package private) class |
RankedBindings.Itr
Binding iterator that only subscribes to BindingPublisher s as required. |
Modifier and Type | Field and Description |
---|---|
(package private) RankedSequence<com.google.inject.Binding<T>> |
bindings |
(package private) java.util.Collection<BeanCache<?,T>> |
cachedBeans |
(package private) RankedSequence<BindingPublisher> |
pendingPublishers |
(package private) com.google.inject.TypeLiteral<T> |
type |
Constructor and Description |
---|
RankedBindings(com.google.inject.TypeLiteral<T> type,
RankedSequence<BindingPublisher> publishers) |
Modifier and Type | Method and Description |
---|---|
void |
add(com.google.inject.Binding<T> binding,
int rank)
Adds the given ranked
Binding to this subscriber. |
(package private) void |
add(BindingPublisher publisher,
int rank) |
java.lang.Iterable<com.google.inject.Binding<T>> |
bindings()
Snapshot of currently subscribed
Binding s. |
RankedBindings.Itr |
iterator() |
(package private) <Q extends java.lang.annotation.Annotation> |
newBeanCache() |
void |
remove(com.google.inject.Binding<T> binding)
Removes the given
Binding from this subscriber. |
(package private) void |
remove(BindingPublisher publisher) |
com.google.inject.TypeLiteral<T> |
type()
Returns the type of
Binding s that are of interest. |
final transient RankedSequence<com.google.inject.Binding<T>> bindings
final transient com.google.inject.TypeLiteral<T> type
final transient RankedSequence<BindingPublisher> pendingPublishers
RankedBindings(com.google.inject.TypeLiteral<T> type, RankedSequence<BindingPublisher> publishers)
public com.google.inject.TypeLiteral<T> type()
BindingSubscriber
Binding
s that are of interest.type
in interface BindingSubscriber<T>
public void add(com.google.inject.Binding<T> binding, int rank)
BindingSubscriber
Binding
to this subscriber.add
in interface BindingSubscriber<T>
binding
- The new bindingrank
- The assigned rankpublic void remove(com.google.inject.Binding<T> binding)
BindingSubscriber
Binding
from this subscriber.remove
in interface BindingSubscriber<T>
binding
- The old bindingpublic java.lang.Iterable<com.google.inject.Binding<T>> bindings()
BindingSubscriber
Binding
s.bindings
in interface BindingSubscriber<T>
Binding
spublic RankedBindings.Itr iterator()
iterator
in interface java.lang.Iterable<com.google.inject.Binding<T>>
void add(BindingPublisher publisher, int rank)
void remove(BindingPublisher publisher)