code: private int getPositiveInteger(String number) {
      try {
        return Math.max(0, Integer.parseInt(number));
      } catch (NumberFormatException e) {
        return 0;
      }
    }
docs: Gets the positive integer.
  
  @param number the number
  @return the positive integer