package com.yeejoin.equipmanage.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author keyong
 * @title: UnitEnum
 * <pre>
 * @description: TODO
 * </pre>
 * @date 2023/1/13 20:44
 */
@Getter
@AllArgsConstructor
public enum UnitEnum {

    M("m", "米", ""),
    DM("dm", "分米", ""),
    CM("cm", "厘米", ""),
    MM("mm", "毫米", "");

    private String key;

    private String name;

    private String description;

    public static UnitEnum getEnum(String key) {
        UnitEnum unitEnum = null;
        for (UnitEnum u : UnitEnum.values()) {
            if (u.getKey().equals(key)) {
                unitEnum = u;
                break;
            }
        }
        return unitEnum;
    }
}
