package com.fs.watch.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.Objects;
import java.util.stream.Stream;

@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum WatchFatigueStatusEnum {

    RELAX(1,"放松"),
    NORMAL(2,"正常"),
    ACCEPTABLE(3,"尚可"),
    HIGH(4,"高");

    private Integer value;
    private String desc;

    public static WatchFatigueStatusEnum toType(Integer value) {
        return Stream.of(WatchFatigueStatusEnum.values())
                .filter(p -> Objects.equals(p.value, value))
                .findAny()
                .orElse(null);
    }
}
