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 WatchUaStatusEnum {

    NORMAL(0,"正常"),
    LOWER(1,"过低"),
    HIGHER(2,"高尿酸血症");

    private Integer value;
    private String desc;

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