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

matrix.business.pay.selector.PayTemplateSelector Maven / Gradle / Ivy

There is a newer version: 2.1.11
Show newest version
package matrix.business.pay.selector;

import matrix.boot.common.utils.AssertUtil;
import matrix.business.pay.templates.AbstractTemplate;

import java.util.Map;

/**
 * 支付模板选择器
 *
 * @author wangcheng
 * date 2022/12/14
 */
public class PayTemplateSelector {

    private final Map templateMap;

    public PayTemplateSelector(Map templateMap) {
        this.templateMap = templateMap;
    }

    /**
     * 获取模板
     *
     * @param name 模板名称
     * @return 模板
     */
    public AbstractTemplate get(String name) {
        AbstractTemplate abstractTemplate = templateMap.get(name);
        AssertUtil.state(abstractTemplate != null, String.format("%s PayTemplate not found", name));
        assert abstractTemplate != null;
        return abstractTemplate;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy