package digital.laboratory.platform.inspection.enums;

import lombok.Getter;

@Getter
public enum NumberTransferHanZi {
    ZERO(0, "零"),
    ONE(1, "一"),


    TWO(2, "二"),
    THREE(3, "三"),
    FOUR(4, "四"),
    FIVE(5, "五"),
    SIX(6, "六"),


    SEVEN(7, "七"),
    EIGHT(8, "八"),
    NINE(9, "九"),
    TEN(10, "十"),
    ELEVEN(11, "十一一"),


    TWELVE(12, "十二"),
    THIRTEEN(13, "十三"),
    FOURTEEN(14, "十四"),
    ;

    NumberTransferHanZi(int number, String hanZi) {
        this.number = number;
        this.hanZi = hanZi;
    }
    private final int number;
    private final String hanZi;

    public static String getHanZiNameByNumber(int number) {
        for (NumberTransferHanZi type : values()) {
            if (number == type.number) {
                return type.hanZi;
            }
        }
        throw new RuntimeException(String.format("没有获取到%s相关的汉字", number));
    }
}
