@Test public void print_SIMPLE() { List<String> entry = Lists.newArrayList("slowo1", "slowo2", "slowo3"); String expected = "slowo1 | slowo2 | slowo3"; String actual = multiWordFormatter.print(entry, null); assertEquals(expected, actual); }
@Override public String print(List<String> value, Locale locale) { if (value == null || value.isEmpty()) { return StringUtils.EMPTY; } return StringUtils.join(value, " | "); }
MultiWordFormatterFactory implements AnnotationFormatterFactory<MultiWordFormat>, Formatter<List<String>> { @Override public String print(List<String> value, Locale locale) { if (value == null || value.isEmpty()) { return StringUtils.EMPTY; } return StringUtils.join(value, " | "); } }
MultiWordFormatterFactory implements AnnotationFormatterFactory<MultiWordFormat>, Formatter<List<String>> { @Override public String print(List<String> value, Locale locale) { if (value == null || value.isEmpty()) { return StringUtils.EMPTY; } return StringUtils.join(value, " | "); } MultiWordFormatterFactory(); }
MultiWordFormatterFactory implements AnnotationFormatterFactory<MultiWordFormat>, Formatter<List<String>> { @Override public String print(List<String> value, Locale locale) { if (value == null || value.isEmpty()) { return StringUtils.EMPTY; } return StringUtils.join(value, " | "); } MultiWordFormatterFactory(); @Override Set<Class<?>> getFieldTypes(); @Override Printer<?> getPrinter(MultiWordFormat annotation, Class<?> fieldType); @Override Parser<?> getParser(MultiWordFormat annotation, Class<?> fieldType); @Override String print(List<String> value, Locale locale); @Override List<String> parse(String source, Locale locale); }
MultiWordFormatterFactory implements AnnotationFormatterFactory<MultiWordFormat>, Formatter<List<String>> { @Override public String print(List<String> value, Locale locale) { if (value == null || value.isEmpty()) { return StringUtils.EMPTY; } return StringUtils.join(value, " | "); } MultiWordFormatterFactory(); @Override Set<Class<?>> getFieldTypes(); @Override Printer<?> getPrinter(MultiWordFormat annotation, Class<?> fieldType); @Override Parser<?> getParser(MultiWordFormat annotation, Class<?> fieldType); @Override String print(List<String> value, Locale locale); @Override List<String> parse(String source, Locale locale);  }