package com.wzj.soopin.transaction.enums.easypay;

import java.io.IOException;

/**
 * 实名支付验证标识
 */
public enum IDCheckIn {

    EMPTY, THE_0, THE_1, THE_2;

    public String toValue() {
        switch (this) {
            case EMPTY -> {
                return "其他";
            }
            case THE_0 -> {
                return "0";
            }
            case THE_1 -> {
                return "1";
            }
            case THE_2 -> {
                return "2";
            }
        }
        return null;
    }

    public static IDCheckIn forValue(String value) throws IOException {
        return switch (value) {
            case "其他" -> EMPTY;
            case "0" -> THE_0;
            case "1" -> THE_1;
            case "2" -> THE_2;
            default -> throw new IOException("Cannot deserialize IDCheckIn");
        };
    }
}
