Java Reflection Method Name getMethodName(String prefix, String fieldName)

Here you can find the source of getMethodName(String prefix, String fieldName)

Description

get Method Name

License

Open Source License

Declaration

public static String getMethodName(String prefix, String fieldName) 

Method Source Code


//package com.java2s;
import java.lang.reflect.Field;

public class Main {
    public static String getMethodName(String prefix, String fieldName) {
        return prefix + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
    }//from   w  w  w .  j a v a  2s.c om

    public static String getMethodName(String prefix, Field field) {
        return getMethodName(prefix, field.getName());
    }

    public static String getMethodName(String fieldName) {
        return getMethodName("get", fieldName);
    }

    public static String getMethodName(Field field) {
        return getMethodName("get", field);
    }
}

Related

  1. getMethodName(final int depth)
  2. getMethodName(Method method)
  3. getMethodName(Method method)
  4. getMethodName(Method method)
  5. getMethodName(Method method, boolean useSegment, String segment, String value)
  6. getMethodNameAndDescriptor(Method m)
  7. getMethodNameList(Class theClass)
  8. getMethodNameMinusGet(Method aMethod)
  9. getMethodNames(Class cls, boolean insertDefaultValues)