package cn.superdesk.uniorder.common.numerical;


import cn.superdesk.uniorder.common.enums.invoice.customer.InvoiceApplyCustomerBackAccountStatusEnum;
import cn.superdesk.uniorder.common.enums.invoice.InvoiceInvoicedIsOverdueEnum;
import lombok.NoArgsConstructor;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * @Description: 枚举不清楚怎样类范型处理
 * @Author: linjinyu
 * @CreateDate: 2021/7/26 下午4:45
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/7/26 下午4:45
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@NoArgsConstructor
public class AnEnumUtils {

//	public Map<String, Object> convertToMap(T target) {
//
//		Map<String, Object> resultMap = new HashMap<>();
//
////		target.
//		for (T s : EnumSet.allOf(T)) {
//			resultMap.put(s.getKey(), s);
//		}
//
//
//		return resultMap;
//
//	}

	public static Map<Integer, InvoiceApplyCustomerBackAccountStatusEnum> invoiceApplyBackAccountStatusEnumConvertToMap() {

		Map<Integer, InvoiceApplyCustomerBackAccountStatusEnum> resultMap = new HashMap<>();

		for (InvoiceApplyCustomerBackAccountStatusEnum s : EnumSet.allOf(InvoiceApplyCustomerBackAccountStatusEnum.class)) {
			resultMap.put(s.getKey(), s);
		}

		return resultMap;

	}

	public static Map<Integer, InvoiceInvoicedIsOverdueEnum> invoiceInvoicedIsOverdueEnumConvertToMap() {

		Map<Integer, InvoiceInvoicedIsOverdueEnum> resultMap = new HashMap<>();

		for (InvoiceInvoicedIsOverdueEnum s : EnumSet.allOf(InvoiceInvoicedIsOverdueEnum.class)) {
			resultMap.put(s.getKey(), s);
		}

		return resultMap;

	}


}
