All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.auties.whatsapp.model.sync.AppStateFatalExceptionNotificationSpec Maven / Gradle / Ivy

package it.auties.whatsapp.model.sync;

import it.auties.whatsapp.model.sync.AppStateFatalExceptionNotification;
import it.auties.protobuf.stream.ProtobufInputStream;
import it.auties.protobuf.stream.ProtobufOutputStream;

public class AppStateFatalExceptionNotificationSpec {
    public static byte[] encode(AppStateFatalExceptionNotification protoInputObject) {
      if(protoInputObject == null) {
         return null;
      }
      var outputStream = new ProtobufOutputStream();
      if(protoInputObject.collectionNames() != null) {
       for(var collectionNamesEntry : protoInputObject.collectionNames()) {
outputStream.writeString(1, collectionNamesEntry);
       }
      }
outputStream.writeInt64(2, protoInputObject.timestamp());
      return outputStream.toByteArray();
    }

    public static AppStateFatalExceptionNotification decode(byte[] input) {
        if(input == null) {
            return null;
        }
        var inputStream = new ProtobufInputStream(input);
        java.util.List collectionNames = new java.util.ArrayList();
        java.lang.Long timestamp = null;
        while(inputStream.readTag()) {
            switch(inputStream.index()) {
                case 1 -> collectionNames.add(inputStream.readString());
                case 2 -> timestamp = inputStream.readInt64();
                default -> inputStream.skipBytes();
            }
        }
        return new it.auties.whatsapp.model.sync.AppStateFatalExceptionNotification(collectionNames, timestamp);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy