@Test public void testNormalGetterPrimitiveName() { String fieldName = "one"; String getter = getGetterSetterName(fieldName, false, false, true); assertEquals("getOne", getter); }
public static String getGetterSetterName(String name, boolean isSetter, boolean isBoolean, boolean isPrimitive) { String capitalizedName = capitalize(name); String prefix = "get"; if (isBoolean) { if (capitalizedName.startsWith("Is")) { if (capitalizedName.length() > 2 && Character.isUpperCase(capitalizedName.charAt(2))) { capitalizedName = capitalizedName.substring(2); } } if (isPrimitive) { prefix = "is"; } } if (isSetter) { prefix = "set"; } return prefix + capitalizedName; }
Helper { public static String getGetterSetterName(String name, boolean isSetter, boolean isBoolean, boolean isPrimitive) { String capitalizedName = capitalize(name); String prefix = "get"; if (isBoolean) { if (capitalizedName.startsWith("Is")) { if (capitalizedName.length() > 2 && Character.isUpperCase(capitalizedName.charAt(2))) { capitalizedName = capitalizedName.substring(2); } } if (isPrimitive) { prefix = "is"; } } if (isSetter) { prefix = "set"; } return prefix + capitalizedName; } }
Helper { public static String getGetterSetterName(String name, boolean isSetter, boolean isBoolean, boolean isPrimitive) { String capitalizedName = capitalize(name); String prefix = "get"; if (isBoolean) { if (capitalizedName.startsWith("Is")) { if (capitalizedName.length() > 2 && Character.isUpperCase(capitalizedName.charAt(2))) { capitalizedName = capitalizedName.substring(2); } } if (isPrimitive) { prefix = "is"; } } if (isSetter) { prefix = "set"; } return prefix + capitalizedName; }  }
Helper { public static String getGetterSetterName(String name, boolean isSetter, boolean isBoolean, boolean isPrimitive) { String capitalizedName = capitalize(name); String prefix = "get"; if (isBoolean) { if (capitalizedName.startsWith("Is")) { if (capitalizedName.length() > 2 && Character.isUpperCase(capitalizedName.charAt(2))) { capitalizedName = capitalizedName.substring(2); } } if (isPrimitive) { prefix = "is"; } } if (isSetter) { prefix = "set"; } return prefix + capitalizedName; }  static boolean isNullOrEmpty(String string); static boolean isNullOrEmpty(Map map); static boolean isNullOrEmpty(Collection collection); static TypeName getClassName(String name, Map<String, TypeVariableName> typeVariableNames); static ClassName getClassName(String name); static String getGetterSetterName(String name, boolean isSetter, boolean isBoolean, boolean isPrimitive); static TypeName getResolvedTypeName(VariableModel variableModel, final Map<String, TypeVariableName> typeVariableNames,
                                               Chords chords); static Map<String, TypeVariableName> getTypeVariables(List<GenericVariableModel> genericVariables, Chords chords); static Modifier[] resolveModifiers(Tune tune, FieldModel fieldModel); static TypeCreator getCreator(Type type, CreatorSet creatorSet); static FieldTypeHandler getFieldTypeHandler(FieldType type, FieldTypeHandlerSet handlerSet); static ParameterTypeHandler getParameterTypeHandler(FieldType type, ParameterTypeHandlerSet handlerSet); static TypeName processType(FieldModel fieldModel, Map<String, TypeVariableName> typeVariableNames, Chords chords); static List<String> getRequiredFields(Map<String, FieldModel> fields, boolean excludeInitializedFields); }
Helper { public static String getGetterSetterName(String name, boolean isSetter, boolean isBoolean, boolean isPrimitive) { String capitalizedName = capitalize(name); String prefix = "get"; if (isBoolean) { if (capitalizedName.startsWith("Is")) { if (capitalizedName.length() > 2 && Character.isUpperCase(capitalizedName.charAt(2))) { capitalizedName = capitalizedName.substring(2); } } if (isPrimitive) { prefix = "is"; } } if (isSetter) { prefix = "set"; } return prefix + capitalizedName; }  static boolean isNullOrEmpty(String string); static boolean isNullOrEmpty(Map map); static boolean isNullOrEmpty(Collection collection); static TypeName getClassName(String name, Map<String, TypeVariableName> typeVariableNames); static ClassName getClassName(String name); static String getGetterSetterName(String name, boolean isSetter, boolean isBoolean, boolean isPrimitive); static TypeName getResolvedTypeName(VariableModel variableModel, final Map<String, TypeVariableName> typeVariableNames,
                                               Chords chords); static Map<String, TypeVariableName> getTypeVariables(List<GenericVariableModel> genericVariables, Chords chords); static Modifier[] resolveModifiers(Tune tune, FieldModel fieldModel); static TypeCreator getCreator(Type type, CreatorSet creatorSet); static FieldTypeHandler getFieldTypeHandler(FieldType type, FieldTypeHandlerSet handlerSet); static ParameterTypeHandler getParameterTypeHandler(FieldType type, ParameterTypeHandlerSet handlerSet); static TypeName processType(FieldModel fieldModel, Map<String, TypeVariableName> typeVariableNames, Chords chords); static List<String> getRequiredFields(Map<String, FieldModel> fields, boolean excludeInitializedFields); static final TriConsumer<ValidationAnnotatorStyle, FieldModel, ParameterSpec.Builder> requiredParameterConstructorParadigm; }