public static long parseDirectiveValueAsSeconds(@Nullable String value) {
        if (value == null) {
            return -1;
        }

        try {
            final long converted = Long.parseLong(value);
            return converted >= 0 ? converted : -1;
        } catch (NumberFormatException e) {
            return -1;
        }
    }
Converts the specified HTTP header directive value into a long integer.

@return the converted value if {@code value} is equal to or greater than {@code 0}.
        {@code -1} otherwise, i.e. if a negative integer or not a number.
core/src/main/java/com/linecorp/armeria/internal/common/ArmeriaHttpUtil.java