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