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

    NORMAL(0,"正常"),
    LOW(1,"房室传导阻滞"),
    FAST(2,"心动过速");

    private Integer value;
    private String desc;

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