package com.sikey.wa04.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 电子围栏状态
 *
 * @author luoyangwei
 * @date 2024年11月01日10:25:31
 */
@Getter
@AllArgsConstructor
public enum FenceState {
    DISABLED(0),
    ENABLED(1);

    private final Integer value;

    /**
     * 根据值获取枚举
     *
     * @param value 值
     * @return 枚举
     */
    private FenceState valueOf(Integer value) {
        FenceState[] values = FenceState.values();
        for (FenceState fenceState : values) {
            if (fenceState.value.equals(value)) {
                return fenceState;
            }
        }
        throw new RuntimeException("未知的电子围栏状态");
    }
}
