code: private int intValue(@Nullable Object object, int defaultValue) {
          if (object instanceof Number) {
              return ((Number) object).intValue();
          }
          if (object instanceof String) {
              return Integer.parseInt((String) object, 10);
          }
          return defaultValue;
      }
docs: Will try to get the int value of a given object. If the value cannot be obtained, it will return the default value.
  
  @param object       to get an int from.
  @param defaultValue to return if the int value cannot be obtained.
  @return the int value of the object or the default value if it cannot be obtained.