package com.tofly.feesapi.common.Excel;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.converters.WriteConverterContext;
import com.alibaba.excel.metadata.data.WriteCellData;

public class EnumConverter implements Converter<Enum<?>> {

    @Override
    public Class<?> supportJavaTypeKey() {
        return Enum.class;
    }

    @Override
    public WriteCellData<?> convertToExcelData(WriteConverterContext<Enum<?>> context) {
        return new WriteCellData<>(context.getValue().name());
    }
}