package com.philisense.www.api.processor;

import com.philisense.www.enums.VcodeType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class VcodeProcessorFactory {

    @Autowired
    private Map<String, VcodeProcessor> vcodeProcessorMap;

    public VcodeProcessor get(VcodeType codeType) {
        String beanName = codeType.getName() + "Processor";
        return vcodeProcessorMap.get(beanName);
    }

}
