class VarietyFormatter implements Formatter<Variety> {

    @Autowired
    private VarietyService varietyService;


    public VarietyFormatter() {
        super();
    }

    public Variety parse(final String text, final Locale locale) throws ParseException {<FILL_FUNCTION_BODY>}


    public String print(final Variety object, final Locale locale) {
        return (object != null ? object.getId().toString() : "");
    }

}

        final Integer varietyId = Integer.valueOf(text);
        // There is no Formatter API yet that allows us to return a Publisher, so we need to block
        return this.varietyService.findById(varietyId).block();
    
<no_super_class>