Return the is getter method name for the given property name. - Java Reflection

Java examples for Reflection:Getter

Description

Return the is getter method name for the given property name.

Demo Code


//package com.java2s;

public class Main {
    /**/*w w  w .j  a v  a 2s .  com*/
     * Return the is getter method name for the given property name.
     *
     * @param property the property name
     * @return the is getter method name for the given property name.
     */
    public static String toIsGetterName(String property) {
        StringBuilder buffer = new StringBuilder(property.length() + 3);

        buffer.append("is");
        buffer.append(Character.toUpperCase(property.charAt(0)));
        buffer.append(property.substring(1));

        return buffer.toString();
    }
}

Related Tutorials