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