@Test public void convertShouldAppendPrefixWhenReserved() throws Exception { final String actual = underTest.convert("Class", TypeName.OBJECT); assertThat(actual) .isEqualTo("aClass"); }
@Nonnull @Override public String convert(@Nonnull String name, @Nonnull TypeName type) { final String propertyName = DefaultNamePolicy.format(name, CaseFormat.LOWER_CAMEL); final String parameterName = codeStyleManager.propertyNameToVariableName(propertyName, VariableKind.PARAMETER); if (Strings.isNullOrEmpty(parameterName)) { throw new IllegalArgumentException("Cannot convert '" + name + "' to a parameter name"); } return parameterName; }
ParameterNamePolicy implements NamePolicy { @Nonnull @Override public String convert(@Nonnull String name, @Nonnull TypeName type) { final String propertyName = DefaultNamePolicy.format(name, CaseFormat.LOWER_CAMEL); final String parameterName = codeStyleManager.propertyNameToVariableName(propertyName, VariableKind.PARAMETER); if (Strings.isNullOrEmpty(parameterName)) { throw new IllegalArgumentException("Cannot convert '" + name + "' to a parameter name"); } return parameterName; } }
ParameterNamePolicy implements NamePolicy { @Nonnull @Override public String convert(@Nonnull String name, @Nonnull TypeName type) { final String propertyName = DefaultNamePolicy.format(name, CaseFormat.LOWER_CAMEL); final String parameterName = codeStyleManager.propertyNameToVariableName(propertyName, VariableKind.PARAMETER); if (Strings.isNullOrEmpty(parameterName)) { throw new IllegalArgumentException("Cannot convert '" + name + "' to a parameter name"); } return parameterName; } @Inject  ParameterNamePolicy(@Nonnull JavaCodeStyleManager codeStyleManager); }
ParameterNamePolicy implements NamePolicy { @Nonnull @Override public String convert(@Nonnull String name, @Nonnull TypeName type) { final String propertyName = DefaultNamePolicy.format(name, CaseFormat.LOWER_CAMEL); final String parameterName = codeStyleManager.propertyNameToVariableName(propertyName, VariableKind.PARAMETER); if (Strings.isNullOrEmpty(parameterName)) { throw new IllegalArgumentException("Cannot convert '" + name + "' to a parameter name"); } return parameterName; } @Inject  ParameterNamePolicy(@Nonnull JavaCodeStyleManager codeStyleManager); @Nonnull @Override String convert(@Nonnull String name, @Nonnull TypeName type); }
ParameterNamePolicy implements NamePolicy { @Nonnull @Override public String convert(@Nonnull String name, @Nonnull TypeName type) { final String propertyName = DefaultNamePolicy.format(name, CaseFormat.LOWER_CAMEL); final String parameterName = codeStyleManager.propertyNameToVariableName(propertyName, VariableKind.PARAMETER); if (Strings.isNullOrEmpty(parameterName)) { throw new IllegalArgumentException("Cannot convert '" + name + "' to a parameter name"); } return parameterName; } @Inject  ParameterNamePolicy(@Nonnull JavaCodeStyleManager codeStyleManager); @Nonnull @Override String convert(@Nonnull String name, @Nonnull TypeName type);  }