Package org.eclipse.sisu.inject
Class RankedBindings<T>
java.lang.Object
org.eclipse.sisu.inject.RankedBindings<T>
- All Implemented Interfaces:
Iterable<com.google.inject.Binding<T>>
,BindingSubscriber<T>
final class RankedBindings<T>
extends Object
implements Iterable<com.google.inject.Binding<T>>, BindingSubscriber<T>
Ordered sequence of
Binding
s of a given type; subscribes to BindingPublisher
s on demand.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) final class
Binding
iterator that only subscribes toBindingPublisher
s as required. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final RankedSequence<com.google.inject.Binding<T>>
(package private) final Collection<BeanCache<?,
T>> (package private) final RankedSequence<BindingPublisher>
(package private) final com.google.inject.TypeLiteral<T>
-
Constructor Summary
ConstructorsConstructorDescriptionRankedBindings
(com.google.inject.TypeLiteral<T> type, RankedSequence<BindingPublisher> publishers) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the given rankedBinding
to this subscriber.(package private) void
add
(BindingPublisher publisher, int rank) bindings()
Snapshot of currently subscribedBinding
s.iterator()
(package private) <Q extends Annotation>
BeanCache<Q,T> void
Removes the givenBinding
from this subscriber.(package private) void
remove
(BindingPublisher publisher) com.google.inject.TypeLiteral<T>
type()
Returns the type ofBinding
s that are of interest.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
bindings
-
type
-
pendingPublishers
-
cachedBeans
-
-
Constructor Details
-
RankedBindings
RankedBindings(com.google.inject.TypeLiteral<T> type, RankedSequence<BindingPublisher> publishers)
-
-
Method Details
-
type
Description copied from interface:BindingSubscriber
Returns the type ofBinding
s that are of interest.- Specified by:
type
in interfaceBindingSubscriber<T>
- Returns:
- The literal type
-
add
Description copied from interface:BindingSubscriber
Adds the given rankedBinding
to this subscriber.- Specified by:
add
in interfaceBindingSubscriber<T>
- Parameters:
binding
- The new bindingrank
- The assigned rank
-
remove
Description copied from interface:BindingSubscriber
Removes the givenBinding
from this subscriber.- Specified by:
remove
in interfaceBindingSubscriber<T>
- Parameters:
binding
- The old binding
-
bindings
Description copied from interface:BindingSubscriber
Snapshot of currently subscribedBinding
s.- Specified by:
bindings
in interfaceBindingSubscriber<T>
- Returns:
- The subscribed
Binding
s
-
iterator
-
newBeanCache
-
add
-
remove
-