package com.cool.store.enums.point;

import java.util.Objects;

/**
 * @author zhangchenbiao
 * @FileName: PropertyStatusEnum
 * @Description:物业状态
 * @date 2024-03-26 16:08
 */
public enum PropertyStatusEnum {

    //1.原始房东 2.二房东 3.三房东 4.招投标性质
    PROPERTY_STATUS_1(1, "原始房东"),
    PROPERTY_STATUS_2(2, "二房东"),
    PROPERTY_STATUS_3(3, "三房东"),
    PROPERTY_STATUS_4(4, "招投标性质"),
    ;

    private Integer code;

    private String desc;

    PropertyStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }


    public static PropertyStatusEnum getByCode(Integer code) {
        if(Objects.isNull(code)){
            return null;
        }
        for (PropertyStatusEnum propertyStatusEnum : PropertyStatusEnum.values()) {
            if (propertyStatusEnum.getCode().equals(code)) {
                return propertyStatusEnum;
            }
        }
        return null;
    }

}
