Here you can find the source of toGetter(final String field)
Parameter | Description |
---|---|
field | the field name to convert |
public static String toGetter(final String field)
//package com.java2s; public class Main { /**/*from w w w. j a v a 2s.co m*/ * Converts a field name into a getter method name. * * @param field the field name to convert * @return the getter method name */ public static String toGetter(final String field) { return new StringBuilder("get").append(Character.toUpperCase(field.charAt(0))) .append(field.substring(1, field.length())).toString(); } }