public static Duration newDuration(final String value) {
        if (isNeverDurable(value)) {
            return Duration.ZERO;
        }
        if (isInfinitelyDurable(value)) {
            return Duration.ofDays(Integer.MAX_VALUE);
        }
        if (NumberUtils.isCreatable(value)) {
            return Duration.ofSeconds(Long.parseLong(value));
        }
        return Duration.parse(value);
    }
New duration. If the provided length is duration,
it will be parsed accordingly, or if it's a numeric value
it will be pared as a duration assuming it's provided as seconds.

@param value the length in seconds.
@return the duration
api/cas-server-core-api-configuration-model/src/main/java/org/apereo/cas/configuration/support/Beans.java