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