/** * {@inheritDoc} */ @Override public String getJavaConstantStyleName(Name name) { return name.words().map(String::toUpperCase).collect(joining("_")); } }
/** * Calculates the path corresponding to the given method. This is calculated converting all the words of the * name to lowercase and concatenating them without separators. For example, if the name of the action is * {@code commitSnapshot} then the returned string will be {@code commitsnapshot}. */ public String getActionPath(Name name) { return name.words().map(String::toLowerCase).collect(joining()); }
/** * Converts the words of the given name to upper case and joins them using the given separator. */ public String getUpperJoined(Name name, String separator) { return name.words().map(String::toUpperCase).collect(joining(separator)); }
/** * {@inheritDoc} */ @Override public String getJavaClassStyleName(Name name) { return name.words().map(words::capitalize).collect(joining()); }
/** * Capitalizes the words of the name and joins them together. */ public String getCapitalized(Name name) { return name.words().map(words::capitalize).collect(joining()); }
/** * Converts the words of the given name to lower case and joins them using the given separator. */ public String getLowerJoined(Name name, String separator) { return name.words().map(String::toLowerCase).collect(joining(separator)); }
public String getSchemaTagName(Name name) { String result = name.words().map(String::toLowerCase).collect(joining("_")); String exception = TAG_NAME_EXCEPTIONS.get(result); if (exception != null) { result = exception; } return result; }
/** * {@inheritDoc} */ @Override public String getJavaMemberStyleName(Name name) { StringBuilder buffer = new StringBuilder(); name.words().findFirst().map(String::toLowerCase).ifPresent(buffer::append); name.words().skip(1).map(words::capitalize).forEach(buffer::append); String result = buffer.toString(); if (javaReservedWords.contains(result)) { result = result + "_"; } return result; }
private String getJavaEnumValueName(EnumValue value) { return value.getName().words().map(String::toUpperCase).collect(joining("_")); } }
private String getSchemaEnumValueName(EnumValue value) { return value.getName().words().map(String::toLowerCase).collect(joining("_")); }
private String getPackageName(List<ReplacementRule> rules, Name name) { String text = name.words().collect(joining(".")); return getPackageName(rules, text); }
private String getValueText(EnumValue value) { return value.getName().words().map(String::toLowerCase).collect(joining("_")); }
link -> { String field = javaNames.getJavaMemberStyleName(link.getName()); String rel = link.getName().words().map(String::toLowerCase).collect(joining()); javaBuffer.addLine("case \"%1$s\":", rel); javaBuffer.addLine("list = new ArrayListWithHref(object.%1$s());", field);