159160161162163164165166167168169
*/ @Test public final void testPlural() { final WordList wl = WordList.getInstance(); assertEquals("houses", wl.plural("house")); assertEquals("cookies", wl.plural("cookie")); assertEquals("cookies", wl.plural("cooky")); } /**
160161162163164165166167168169170
@Test public final void testPlural() { final WordList wl = WordList.getInstance(); assertEquals("houses", wl.plural("house")); assertEquals("cookies", wl.plural("cookie")); assertEquals("cookies", wl.plural("cooky")); } /** * Tests for singular.
161162163164165166167168169170171
public final void testPlural() { final WordList wl = WordList.getInstance(); assertEquals("houses", wl.plural("house")); assertEquals("cookies", wl.plural("cookie")); assertEquals("cookies", wl.plural("cooky")); } /** * Tests for singular. */
387388389390391392393394395396397
@Override public String translateName(Field f) { Named n = f.getAnnotation(Named.class); if (n != null) { return (f.getType().isArray() ? n.plural() : n.singular()); } else return f.getName(); } } }
379380381382383384385386387388389
} private static String translateFieldName(Field f) { Named named = f.getAnnotation(Named.class); if (named != null) { return f.getType().isArray() ? named.plural() : named.singular(); } else { return f.getName(); } }
406407408409410411412413414415416
} private static String getDtoPluralName(Class<? extends Dto> type) { Named name = type.getAnnotation(Named.class); if (name != null) { return name.plural(); } else { // Dto default names always assumed to be singular return getDtoSingularName(type) + "s"; } }