- All Implemented Interfaces:
RankingFunction
Simple
RankingFunction
that partitions qualified bindings into two main groups.
Default bindings are given zero or positive ranks; the rest are given negative ranks.
-
-
Constructor Summary
Constructors
-
Method Summary
int
Estimates the maximum rank this function may assign to a Binding
.
<T> int
rank(com.google.inject.Binding<T> binding)
Assigns a numeric rank to the given binding.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
primaryRank
private final int primaryRank
-
Constructor Details
-
DefaultRankingFunction
public DefaultRankingFunction(int primaryRank)
-
DefaultRankingFunction
@Inject
public DefaultRankingFunction()
-
Method Details
-
maxRank
public int maxRank()
Estimates the maximum rank this function may assign to a Binding
.
- Specified by:
maxRank
in interface RankingFunction
- Returns:
- Maximum rank
- See Also:
-
-
rank
public <T> int rank(com.google.inject.Binding<T> binding)
Assigns a numeric rank to the given binding.
- Specified by:
rank
in interface RankingFunction
- Parameters:
binding
- The binding
- Returns:
- Assigned rank