package com.sikey.wa04.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;

@Getter
@AllArgsConstructor
@ToString
public enum RegistrantPlatformType {
    XIAOMI(0, PlatformType.XIAOMI),
    HUAWEI(1, PlatformType.HUAWEI),
    VIVO(2, PlatformType.VIVO),
    IOS(3, PlatformType.IOS);

    private final Integer type;
    private final PlatformType platformType;

    public static RegistrantPlatformType valueOf(Integer type) throws IllegalAccessException {
        for (RegistrantPlatformType value : values()) {
            if (value.type.equals(type)) {
                return value;
            }
        }
        throw new IllegalAccessException("未知的平台类型");
    }
}
