@SneakyThrows
    public static Duration newDuration(final String length) {
        if (NumberUtils.isCreatable(length)) {
            return Duration.ofSeconds(Long.parseLong(length));
        }
        return Duration.parse(length);
    }
@ SneakyThrows public static Duration newDuration ( final String length ) { if ( NumberUtils . isCreatable ( length ) ) { return Duration . ofSeconds ( Long . parseLong ( length ) ) ; } return Duration . parse ( length ) ; }
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 length the length in seconds.
@return the duration