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