Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.lang.reflect.Method;

public class Main {
    public static boolean checkIfClassHasMatchingGetMethod(Class<?> clazz, String columnname) {
        String neededMethodename = "get" + (Character.toUpperCase(columnname.charAt(0)) + columnname.substring(1));
        for (Method aMethod : clazz.getMethods()) {
            if (neededMethodename.equals(aMethod.getName())) {
                return true;
            }
        }
        return false;
    }
}