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

org.telegram.api.update.TLUpdateDialogPinned Maven / Gradle / Ivy

The newest version!
package org.telegram.api.update;

import org.telegram.api.peer.TLAbsPeer;
import org.telegram.tl.StreamingUtils;
import org.telegram.tl.TLContext;

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

/**
 * The type TL update channel new message
 */
public class TLUpdateDialogPinned extends TLAbsUpdate {
    /**
     * The constant CLASS_ID.
     */
    public static final int CLASS_ID = 0xd711a2cc;

    private static final int FLAG_PINNED           = 0x00000001; // 0

    private int flags;
    private TLAbsPeer peer;

    /**
     * Instantiates a new TL update channel new message
     */
    public TLUpdateDialogPinned() {
        super();
    }

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

    public TLAbsPeer getPeer() {
        return peer;
    }

    public boolean isPinned() {
        return (flags & FLAG_PINNED) != 0;
    }

    public void serializeBody(OutputStream stream)
            throws IOException {
        StreamingUtils.writeInt(flags, stream);
        StreamingUtils.writeTLObject(peer, stream);
    }

    public void deserializeBody(InputStream stream, TLContext context)
            throws IOException {
        flags = StreamingUtils.readInt(stream);
        this.peer = StreamingUtils.readTLObject(stream, context, TLAbsPeer.class);
    }

    public String toString() {
        return "updateDialogPinned#d711a2cc";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy