it.auties.whatsapp.model.signal.auth.ClientPayloadClientPayloadConnectReasonSpec Maven / Gradle / Ivy
package it.auties.whatsapp.model.signal.auth;
import it.auties.whatsapp.model.signal.auth.ClientPayload.ClientPayloadConnectReason;
import java.util.Arrays;
import java.util.Optional;
public class ClientPayloadClientPayloadConnectReasonSpec {
public static Integer encode(ClientPayloadConnectReason protoInputObject) {
if(protoInputObject == null) {
return null;
}
return protoInputObject.index;
}
public static Optional decode(int index) {
return Arrays.stream(ClientPayloadConnectReason.values())
.filter(entry -> entry.index == index)
.findFirst();
}
}