Package io.getunleash.strategy
Class StrategyUtils
java.lang.Object
io.getunleash.strategy.StrategyUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetNormalizedNumber(String identifier, String groupId, int normalizer, long seed) static intgetNormalizedNumber(String identifier, String groupId, long seed) Takes to string inputs concat them, produce a hash and return a normalized value between 0 and 100;static intgetPercentage(String percentage) Takes a numeric string value and converts it to a integer between 0 and 100.static booleanisEmpty(CharSequence cs) static booleanstatic boolean
-
Constructor Details
-
StrategyUtils
public StrategyUtils()
-
-
Method Details
-
isNotEmpty
-
isEmpty
-
isNumeric
-
getNormalizedNumber
Takes to string inputs concat them, produce a hash and return a normalized value between 0 and 100;- Parameters:
identifier-groupId-- Returns:
-
getNormalizedNumber
-
getPercentage
Takes a numeric string value and converts it to a integer between 0 and 100.returns 0 if the string is not numeric.
- Parameters:
percentage- - A numeric string value- Returns:
- a integer between 0 and 100
-