it.auties.whatsapp.model.button.interactive.InteractiveFooterSpec Maven / Gradle / Ivy
package it.auties.whatsapp.model.button.interactive;
import it.auties.whatsapp.model.button.interactive.InteractiveFooter;
import it.auties.protobuf.stream.ProtobufInputStream;
import it.auties.protobuf.stream.ProtobufOutputStream;
public class InteractiveFooterSpec {
public static byte[] encode(InteractiveFooter protoInputObject) {
if(protoInputObject == null) {
return null;
}
var outputStream = new ProtobufOutputStream();
outputStream.writeString(1, protoInputObject.content());
return outputStream.toByteArray();
}
public static InteractiveFooter decode(byte[] input) {
if(input == null) {
return null;
}
var inputStream = new ProtobufInputStream(input);
java.lang.String content = null;
while(inputStream.readTag()) {
switch(inputStream.index()) {
case 1 -> content = inputStream.readString();
default -> inputStream.skipBytes();
}
}
return new it.auties.whatsapp.model.button.interactive.InteractiveFooter(content);
}
}