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