final class RankedBindings<T> extends java.lang.Object implements java.lang.Iterable<com.google.inject.Binding<T>>, BindingSubscriber<T>
Bindings of a given type; subscribes to BindingPublishers on demand.| Modifier and Type | Class and Description |
|---|---|
(package private) class |
RankedBindings.Itr
Binding iterator that only subscribes to BindingPublishers 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
Bindings. |
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
Bindings 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()
BindingSubscriberBindings that are of interest.type in interface BindingSubscriber<T>public void add(com.google.inject.Binding<T> binding, int rank)
BindingSubscriberBinding to this subscriber.add in interface BindingSubscriber<T>binding - The new bindingrank - The assigned rankpublic void remove(com.google.inject.Binding<T> binding)
BindingSubscriberBinding from this subscriber.remove in interface BindingSubscriber<T>binding - The old bindingpublic java.lang.Iterable<com.google.inject.Binding<T>> bindings()
BindingSubscriberBindings.bindings in interface BindingSubscriber<T>Bindingspublic RankedBindings.Itr iterator()
iterator in interface java.lang.Iterable<com.google.inject.Binding<T>>void add(BindingPublisher publisher, int rank)
void remove(BindingPublisher publisher)