package com.persagy.server.datacenter.models.wrapperobj

import java.util.*


/**
 *
 * @author  Cainga
 * @date  2021/2/24 10:32
 */
enum class ClassCodeEnum(val cname: String,val value: Int) {
    ACVTIO("通风风口",0),
    FFSCIO("排烟风口",0),
    ACATIO("空调风口",0),
    ACVTSF("通风风机",1),
    ACATAH("空调机组",1),
    ACATFU("新风机组",1);
    companion object {
        fun toSourceList(value: Int?): List<String> {
            val list = ArrayList<String>() //Lists.newArrayList()其实和new ArrayList()几乎一模
            //  一样, 唯一它帮你做的(其实是javac帮你做的), 就是自动推导(不是"倒")尖括号里的数据类型.
            for (classCodeEnum in ClassCodeEnum.values()) {
                if(value == null){
                    list.add(classCodeEnum.name)
                }else if(classCodeEnum.value == value){
                        list.add(classCodeEnum.name)
                }

            }
            return list
        }
    }


}