All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.wslxm.springbootplus2.manage.gc.utils.GcReplacUtil Maven / Gradle / Ivy

There is a newer version: 2.3.0
Show newest version
package io.github.wslxm.springbootplus2.manage.gc.utils;

import java.util.Map;

/**
 * 代码生成 动态参数 处理相关
 * @author wangsong
 * @date 2022/3/5 0005 20:58
 * @return
 * @version 1.0.0
 */
public class GcReplacUtil {


    /**
     * 参数替换
     *
     * @param defaultTemplateParam  默认模板参数
     * @param templateParam 动态模板参数
     * @param str 需要替换内容的数据
     */
    public static String replaceParams(Map defaultTemplateParam, Map templateParam, String str) {
        for (String param : defaultTemplateParam.keySet()) {
            str = str.replace(param, defaultTemplateParam.get(param));
        }
        for (String param : templateParam.keySet()) {
            str = str.replace(param, templateParam.get(param));
        }
        return str;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy