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

org.telegram.api.page.block.TLPageBlockPhoto Maven / Gradle / Ivy

There is a newer version: 66.2
Show newest version
package org.telegram.api.page.block;

import org.telegram.api.richtext.TLAbsRichText;
import org.telegram.tl.StreamingUtils;
import org.telegram.tl.TLContext;
import org.telegram.tl.TLObject;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * @author Ruben Bermudez
 * @version 1.0
 */
public class TLPageBlockPhoto extends TLAbsPageBlock {
    public static final int CLASS_ID = 0xe9c69982;

    private long photoId;
    private TLAbsRichText caption;

    public TLPageBlockPhoto() {
        super();
    }

    @Override
    public int getClassId() {
        return CLASS_ID;
    }

    public long getPhotoId() {
        return photoId;
    }

    public TLAbsRichText getCaption() {
        return caption;
    }

    @Override
    public void serializeBody(OutputStream stream) throws IOException {
        StreamingUtils.writeLong(photoId, stream);
        StreamingUtils.writeTLObject(caption, stream);
    }

    @Override
    public void deserializeBody(InputStream stream, TLContext context) throws IOException {
        photoId = StreamingUtils.readLong(stream);
        caption = StreamingUtils.readTLObject(stream, context, TLAbsRichText.class);
    }

    @Override
    public String toString() {
        return "pageBlockPhoto#e9c69982";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy