class DurationConverter implements PropertyConverter<Duration> {

    @Override
    public Duration convert(String value, ConversionContext ctx) {
        ctx.addSupportedFormats(getClass(),
                Duration.of(1234, ChronoUnit.SECONDS).toString());
        if(value==null){
            return null;
        }
        try {
            return Duration.parse(value);
        }catch(Exception e){
            LOG.log(Level.FINEST, e, () -> "Cannot parse Duration: " + value);
            return null;
        }
    }

}