@StringGetter(EVENTS_FILE_FORMAT) private String getEventsFileFormatAsString() { boolean isFirst = true; StringBuilder str = new StringBuilder(); for (EventsFileFormat format : this.eventsFileFormats) { if (!isFirst) { str.append(','); } str.append(format.toString()); isFirst = false; } return str.toString(); }
@StringSetter(EVENTS_FILE_FORMAT) private void setEventFileFormats(final String value) { String[] parts = StringUtils.explode(value, ','); Set<EventsFileFormat> formats = EnumSet.noneOf(EventsFileFormat.class); for (String part : parts) { String trimmed = part.trim(); if (trimmed.length() > 0) { formats.add(EventsFileFormat.valueOf(trimmed)); } } this.eventsFileFormats = formats; }