/** * Converts the string into a safe field name. * @param name The field name. * @return The safe field name. */ public static final String toFieldName(String name) { return compact(prefixKeywords(name)); }
public String apply(Collection<TypeDef> types) { final Function<TypeDef, String> toString = new Function<TypeDef, String>() { public String apply(TypeDef item) { return stripSuffix(item.getName()); } }; final String prefix = StringUtils.getPrefix(types, toString); return toInterfaceName(prefix + StringUtils.compact(StringUtils.join(types, new Function<TypeDef, String>() { public String apply(TypeDef item) { String str = stripPrefix(stripSuffix(item.getName())); if (str.length() > prefix.length()) { return str.substring(prefix.length()); } else { return str; } } }, ""))); } };
public String apply(Collection<ClassRef> types) { final Function<ClassRef, String> toString = new Function<ClassRef, String>() { public String apply(ClassRef item) { return stripSuffix(item.getDefinition().getName()); } }; final String prefix = StringUtils.getPrefix(types, toString); return toInterfaceName(prefix + StringUtils.compact(StringUtils.join(types, new Function<ClassRef, String>() { public String apply(ClassRef item) { String str = stripPrefix(stripSuffix(item.getDefinition().getName())); if (str.length() > prefix.length()) { return str.substring(prefix.length()); } else { return str; } } }, ""))); } };
.build(); String propertyName = compact(deCapitalizeFirst(descendant.getName()) + property.getNameCapitalized()); result.add(new PropertyBuilder(property) .withName(propertyName) String propertyName = compact(deCapitalizeFirst(descendant.getName() + property.getNameCapitalized())); result.add(new PropertyBuilder(property) .withName(propertyName)