Generate setter Name For Field - Android java.lang.reflect

Android examples for java.lang.reflect:Field Name

Description

Generate setter Name For Field

Demo Code


//package com.java2s;

import java.lang.reflect.Field;

public class Main {
    public static String setterNameForField(Field field) {
        return "set" + field.getName().substring(0, 1).toUpperCase()
                + field.getName().substring(1);

    }/*ww w. j a v a 2 s.c  om*/
}

Related Tutorials