docs: static final public RateOptions parseRateOptions(final boolean rate,
         final String spec) {
       if (!rate || spec.length() == 4) {
         return new RateOptions(false, Long.MAX_VALUE,
             RateOptions.DEFAULT_RESET_VALUE);
       }
  
       if (spec.length() < 6) {
         throw new BadRequestException("Invalid rate options specification: "
             + spec);
       }
  
       String[] parts = Tags
           .splitString(spec.substring(5, spec.length() - 1), ',');
       if (parts.length < 1 || parts.length > 3) {
         throw new BadRequestException(
             "Incorrect number of values in rate options specification, must be " +
             "counter[,counter max value,reset value], recieved: "
                 + parts.length + " parts");
       }
  
       final boolean counter = parts[0].endsWith("counter");
       try {
         final long max = (parts.length >= 2 && parts[1].length() > 0 ? Long
             .parseLong(parts[1]) : Long.MAX_VALUE);
         try {
           final long reset = (parts.length >= 3 && parts[2].length() > 0 ? Long
               .parseLong(parts[2]) : RateOptions.DEFAULT_RESET_VALUE);
           final boolean drop_counter = parts[0].equals("dropcounter");
           return new RateOptions(counter, max, reset, drop_counter);
         } catch (NumberFormatException e) {
           throw new BadRequestException(
               "Reset value of counter was not a number, received '" + parts[2]
                   + "'");
         }
       } catch (NumberFormatException e) {
         throw new BadRequestException(
             "Max value of counter was not a number, received '" + parts[1] + "'");
       }
     }