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