Here you can find the source of fieldNameToMethodName(String methodPrefix, String fieldName)
Parameter | Description |
---|---|
methodPrefix | a parameter |
fieldName | a parameter |
public static String fieldNameToMethodName(String methodPrefix, String fieldName)
//package com.java2s; //License from project: Apache License public class Main { /**/*w w w.j a v a 2s .c o m*/ * field name to method name * * @param methodPrefix * @param fieldName * @return methodName */ public static String fieldNameToMethodName(String methodPrefix, String fieldName) { return fieldNameToMethodName(methodPrefix, fieldName, false); } /** * field name to method name * * @param methodPrefix * @param fieldName * @param ignoreFirstLetterCase * @return methodName */ public static String fieldNameToMethodName(String methodPrefix, String fieldName, boolean ignoreFirstLetterCase) { String methodName = null; if (fieldName != null && fieldName.length() > 0) { if (ignoreFirstLetterCase) { methodName = methodPrefix + fieldName; } else { methodName = methodPrefix + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1); } } else { methodName = methodPrefix; } return methodName; } }