package com.djhk.uav.uav.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

import java.util.Arrays;

/**
 * @author jiachengshuai
 * @version 1.4
 * @date 2023/3/3
 */
@Getter
public enum SyunCameraTypeEnum {

    ZOOM("zoom"),

    WIDE("wide"),

    IR("ir");

    String type;

    SyunCameraTypeEnum(String type) {
        this.type = type;
    }

    @JsonValue
    public String getType() {
        return type;
    }

    @JsonCreator
    public static SyunCameraTypeEnum find(String cameraType) {
        return Arrays.stream(SyunCameraTypeEnum.values()).filter(typeEnum -> typeEnum.type.equals(cameraType)).findAny().get();
    }
}
