static long validateDuration(@Nullable Duration value, String name) {
        if (value == null) {
            return -1;
        }

        checkArgument(!value.isNegative(), "%s: %s (expected: >= 0)", name, value);
        return value.getSeconds();
    }
Makes sure the specified {@link Duration} is not negative.

@param value the duration
@param name the name of the parameter
@return the duration converted into seconds
core/src/main/java/com/linecorp/armeria/common/CacheControlBuilder.java