Class StrategyUtils

java.lang.Object
io.getunleash.strategy.StrategyUtils

public final class StrategyUtils extends Object
  • Constructor Details

    • StrategyUtils

      public StrategyUtils()
  • Method Details

    • isNotEmpty

      public static boolean isNotEmpty(CharSequence cs)
    • isEmpty

      public static boolean isEmpty(@Nullable CharSequence cs)
    • isNumeric

      public static boolean isNumeric(CharSequence cs)
    • getNormalizedNumber

      public static int getNormalizedNumber(String identifier, String groupId, long seed)
      Takes to string inputs concat them, produce a hash and return a normalized value between 0 and 100;
      Parameters:
      identifier -
      groupId -
      Returns:
    • getNormalizedNumber

      public static int getNormalizedNumber(String identifier, String groupId, int normalizer, long seed)
    • getPercentage

      public static int getPercentage(String percentage)
      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