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

com.javaoffers.brief.modelhelper.core.ModelApplicationContext Maven / Gradle / Ivy

There is a newer version: 3.6.8
Show newest version
package com.javaoffers.brief.modelhelper.core;

import com.javaoffers.brief.modelhelper.convert.Convert;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Description:
 * @Auther: create by cmj on 2021/12/7 20:12
 */
public class  ModelApplicationContext implements SelectorRegister {


    Map registers = new ConcurrentHashMap<>();

    @Override
    public void registerConvert(Descriptor descriptor, Convert convert) {
        registers.putIfAbsent(descriptor.getUniqueMark(),convert);
    }


    @Override
    public Convert selector(Descriptor descriptor) {
        return registers.get(descriptor.getUniqueMark());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy