Package org.eclipse.sisu.inject
Class InjectorBindings
- java.lang.Object
-
- org.eclipse.sisu.inject.InjectorBindings
-
- All Implemented Interfaces:
BindingPublisher
public final class InjectorBindings extends java.lang.Object implements BindingPublisher
-
-
Constructor Summary
Constructors Constructor Description InjectorBindings(com.google.inject.Injector injector)
InjectorBindings(com.google.inject.Injector injector, RankingFunction function)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
adapt(java.lang.Class<T> type)
Attempts to adapt this publisher to the given type.boolean
equals(java.lang.Object rhs)
static BindingPublisher
findBindingPublisher(com.google.inject.Injector injector)
static RankingFunction
findRankingFunction(com.google.inject.Injector injector)
int
hashCode()
int
maxBindingRank()
Estimates the maximum rank this publisher may assign to aBinding
.<T> void
subscribe(BindingSubscriber<T> subscriber)
Subscribes the givenBindingSubscriber
to receiveBinding
s.java.lang.String
toString()
<T> void
unsubscribe(BindingSubscriber<T> subscriber)
Stops the givenBindingSubscriber
from receivingBinding
s.
-
-
-
Constructor Detail
-
InjectorBindings
public InjectorBindings(com.google.inject.Injector injector, RankingFunction function)
-
InjectorBindings
@Inject public InjectorBindings(com.google.inject.Injector injector)
-
-
Method Detail
-
findBindingPublisher
public static BindingPublisher findBindingPublisher(com.google.inject.Injector injector)
-
findRankingFunction
public static RankingFunction findRankingFunction(com.google.inject.Injector injector)
-
subscribe
public <T> void subscribe(BindingSubscriber<T> subscriber)
Description copied from interface:BindingPublisher
Subscribes the givenBindingSubscriber
to receiveBinding
s.- Specified by:
subscribe
in interfaceBindingPublisher
- Parameters:
subscriber
- The subscriber
-
unsubscribe
public <T> void unsubscribe(BindingSubscriber<T> subscriber)
Description copied from interface:BindingPublisher
Stops the givenBindingSubscriber
from receivingBinding
s.- Specified by:
unsubscribe
in interfaceBindingPublisher
- Parameters:
subscriber
- The subscriber
-
maxBindingRank
public int maxBindingRank()
Description copied from interface:BindingPublisher
Estimates the maximum rank this publisher may assign to aBinding
.- Specified by:
maxBindingRank
in interfaceBindingPublisher
- Returns:
- Maximum binding rank
-
adapt
public <T> T adapt(java.lang.Class<T> type)
Description copied from interface:BindingPublisher
Attempts to adapt this publisher to the given type.- Specified by:
adapt
in interfaceBindingPublisher
- Parameters:
type
- The target type- Returns:
- Adapted instance;
null
if it couldn't be adapted
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object rhs)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-