集册 Java实例教程 规范化的吸气剂名称

规范化的吸气剂名称

欢马劈雪     最近更新时间:2020-01-02 10:19:05

496
提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
规范化的吸气剂名称


//package com.nowjava;
/**
时   代     Java  公  众  号 - nowjava.com
**/


public class Main {

    public static void main(String[] argv) throws Exception {

        String propertyName = "nowjava.com";

        System.out.println(normalizedGetterName(propertyName));

    }


    public static String GETTER_PREFIX = "get";


    public static String normalizedGetterName(String propertyName) {

        String propertyBaseName = normalizePropertyBaseName(propertyName);

        return GETTER_PREFIX + propertyBaseName;

    }


    /**

     * @param propertyName

     * @return

     */

    private static String normalizePropertyBaseName(String propertyName) {
    /**来自 
     N o w J a v a . c o m - 时代Java**/

        if (propertyName == null)

            return null;

        propertyName = propertyName.trim();

        if (propertyName.length() < 1)

       
展开阅读全文