class LongConverter implements PropertyConverter<Long> {

    @Override
    public Long convert(String value, ConversionContext ctx) {
        ctx.addSupportedFormats(getClass(), "<long>", "MIN", "MIN_VALUE", "MAX", "MAX_VALUE");

        if(value==null){
            return null;
        }
        String trimmed = value.trim();
            switch (trimmed.toUpperCase(Locale.ENGLISH)) {
                case "MIN_VALUE":
                case "MIN":
                    return Long.MIN_VALUE;
                case "MAX_VALUE":
                case "MAX":
                    return Long.MAX_VALUE;
                default:
                    try {
                        return Long.decode(trimmed);
                    } catch(Exception e) {
                        LOGGER.finest("Unable to parse Long createValue: " + value);
                        return null;
                    }
            }
    }

}