package com.yonge.cooleshow.common.config;

import com.yonge.toolset.base.enums.BaseEnum;
import org.springframework.core.convert.converter.Converter;
import org.springframework.core.convert.converter.ConverterFactory;
import org.springframework.stereotype.Component;

@Component
public class EnumConverterFactory implements ConverterFactory<String, BaseEnum<?, ?>> {

	@Override
	public <T extends BaseEnum<?, ?>> Converter<String, T> getConverter(Class<T> targetType) {
		return new EnumConverter<T>(targetType);
	}

}
