discord-jadx/app/src/main/java/com/discord/gateway/opcodes/Opcode.java

69 lines
1.8 KiB
Java

package com.discord.gateway.opcodes;
import java.util.HashMap;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* compiled from: Opcode.kt */
public enum Opcode {
UNHANDLED(-1),
DISPATCH(0),
HEARTBEAT(1),
IDENTIFY(2),
PRESENCE_UPDATE(3),
VOICE_STATE_UPDATE(4),
VOICE_SERVER_PING(5),
RESUME(6),
RECONNECT(7),
REQUEST_GUILD_MEMBERS(8),
INVALID_SESSION(9),
HELLO(10),
HEARTBEAT_ACK(11),
CALL_CONNECT(13),
GUILD_SUBSCRIPTIONS(14),
STREAM_CREATE(18),
STREAM_DELETE(19),
STREAM_WATCH(20),
OPCODE_STREAM_PING(21),
REQUEST_GUILD_APPLICATION_COMMANDS(24);
public static final Companion Companion = new Companion(null);
private static final HashMap<Integer, Opcode> intLookup;
private final int apiInt;
/* compiled from: Opcode.kt */
public static final class Companion {
private Companion() {
}
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public final Opcode fromApiInt(int i) {
Opcode opcode = (Opcode) Opcode.access$getIntLookup$cp().get(Integer.valueOf(i));
return opcode != null ? opcode : Opcode.UNHANDLED;
}
}
static {
HashMap<Integer, Opcode> hashMap = new HashMap<>();
Opcode[] values = values();
for (int i = 0; i < 20; i++) {
Opcode opcode = values[i];
hashMap.put(Integer.valueOf(opcode.apiInt), opcode);
}
intLookup = hashMap;
}
private Opcode(int i) {
this.apiInt = i;
}
public static final /* synthetic */ HashMap access$getIntLookup$cp() {
return intLookup;
}
public final int getApiInt() {
return this.apiInt;
}
}