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