package com.ywt.alipaympapi.models.enums;

/**
 * 时间段
 */
public enum DatePeriodEnum {
    UNKNOWN("", 0),
    ALL_DAY("全天", 1),
    MORNING("上午", 2),
    AFTERNOON("下午", 3),
    NIGHT("夜间", 4),
    AFTER_MIDNIGHT("下半夜", 5),
    MIDNOON("午间", 6),
    ;

    private final String displayName;

    private final int value;

    DatePeriodEnum(String displayName, int value) {
        this.displayName = displayName;
        this.value = value;
    }

    public String getDisplayName() {
        return displayName;
    }

    public int getValue() {
        return value;
    }

    public static DatePeriodEnum valueOf(int value) {
        for (DatePeriodEnum datePeriodEnum : DatePeriodEnum.values()) {
            if (datePeriodEnum.getValue() == value) {
                return datePeriodEnum;
            }
        }
        return UNKNOWN;
    }
}

