Java Utililty Methods Getter Name Create

List of utility methods to do Getter Name Create

Description

The list of methods to do Getter Name Create are organized into topic(s).

Method

StringtoGetter(final String field)
Converts a field name into a getter method name.
return new StringBuilder("get").append(Character.toUpperCase(field.charAt(0)))
        .append(field.substring(1, field.length())).toString();
StringtoGetter(String fieldName)
to Getter
return (!fieldName.startsWith("is")
        ? "get" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1)
        : fieldName);
StringtoGetter(String name)
Takes a property name and converts it to a getter method name according to JavaBean conventions.
return "get" + name.toUpperCase().substring(0, 1) + name.substring(1);
StringtoGetterMethodName(String s)
to Getter Method Name
return "get" + s.substring(0, 1).toUpperCase() + s.substring(1);
StringtoGetterName(String name)
Create a getter name.
return "get" + name.substring(0, 1).toUpperCase() + name.substring(1);
StringtoGetterName(String name)
to Getter Name
return tohPrefixialCamelName(name, "get");
StringtoGetterName(String property)
to Getter Name
StringBuffer getterName = new StringBuffer();
getterName.append(property);
getterName.setCharAt(0, Character.toUpperCase(property.charAt(0)));
getterName.insert(0, "get");
return getterName.toString();
StringtoGetterString(String str)
Converts the string to a getter property.
StringBuilder sb = new StringBuilder();
sb.append("get");
sb.append(Character.toTitleCase(str.charAt(0)));
sb.append(str.substring(1));
return sb.toString();