/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */

package test.fixtures.enums;

import com.facebook.swift.codec.*;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TProtocol;

@SwiftGenerated
public enum MyEnum1 implements com.facebook.thrift.enums.BaseEnum, com.facebook.thrift.payload.ThriftSerializable {
    ME1_0(0),
    ME1_1(1),
    ME1_2(2),
    ME1_3(3),
    ME1_5(5),
    ME1_6(6);

    private final int value;

    MyEnum1(int value) {
        this.value = value;
    }

    @ThriftEnumValue
    public int getValue() {
        return value;
    }

    public static MyEnum1 fromInteger(int n) {
        switch (n) {
        case 0:
            return ME1_0;
        case 1:
            return ME1_1;
        case 2:
            return ME1_2;
        case 3:
            return ME1_3;
        case 5:
            return ME1_5;
        case 6:
            return ME1_6;
        default:
            return null;
        }
    }

    static {
      com.facebook.thrift.type.TypeRegistry.add(new com.facebook.thrift.type.Type(new com.facebook.thrift.type.UniversalName("test.dev/fixtures/enums/MyEnum1"), MyEnum1.class, MyEnum1::read0));
    }
    public static com.facebook.thrift.payload.Reader<MyEnum1> asReader() {
        return MyEnum1::read0;
    }

    public static MyEnum1 read0(TProtocol iprot) throws TException {
        return MyEnum1.fromInteger(iprot.readI32());
    }

    public void write0(TProtocol oprot) throws TException {
        oprot.writeI32(getValue());
    }


}
