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