Package org.eclipse.sisu.inject
Class DefaultRankingFunction
- java.lang.Object
-
- org.eclipse.sisu.inject.DefaultRankingFunction
-
- All Implemented Interfaces:
RankingFunction
public final class DefaultRankingFunction extends Object implements RankingFunction
SimpleRankingFunctionthat partitions qualified bindings into two main groups.Default bindings are given zero or positive ranks; the rest are given negative ranks.
-
-
Constructor Summary
Constructors Constructor Description DefaultRankingFunction()DefaultRankingFunction(int primaryRank)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intmaxRank()Estimates the maximum rank this function may assign to aBinding.<T> intrank(com.google.inject.Binding<T> binding)Assigns a numeric rank to the given binding.
-
-
-
Method Detail
-
maxRank
public int maxRank()
Description copied from interface:RankingFunctionEstimates the maximum rank this function may assign to aBinding.- Specified by:
maxRankin interfaceRankingFunction- Returns:
- Maximum rank
- See Also:
BindingPublisher.maxBindingRank()
-
rank
public <T> int rank(com.google.inject.Binding<T> binding)
Description copied from interface:RankingFunctionAssigns a numeric rank to the given binding.- Specified by:
rankin interfaceRankingFunction- Parameters:
binding- The binding- Returns:
- Assigned rank
-
-