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