org.telegram.api.decryptedmessage.TLDecryptedMessageMediaContact Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of telegramapi Show documentation
Show all versions of telegramapi Show documentation
Java library to create Telegram Clients
/*
* This is the source code of Telegram Bot v. 2.0
* It is licensed under GNU GPL v. 3 or later.
* You should have received a copy of the license in this archive (see LICENSE).
*
* Copyright Ruben Bermudez, 13/11/14.
*/
package org.telegram.api.decryptedmessage;
import org.telegram.tl.StreamingUtils;
import org.telegram.tl.TLContext;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
/**
* Contact media content of an encrypted message
* @author Ruben Bermudez
* @version 2.0
* @date 02 of May of 2015
*/
public class TLDecryptedMessageMediaContact extends TLAbsDecryptedMessageMedia {
/**
* The constant CLASS_ID.
*/
public static final int CLASS_ID = 0x588a0a97;
private String phoneNumber; ///< Phone number
private String firstName; ///< Contact's first name
private String lastName; ///< Contact's last name
private int userId; ///< Contact's user id
/**
* Instantiates a new TL decrypted message media contact.
*/
public TLDecryptedMessageMediaContact() {
super();
}
@Override
public int getClassId() {
return CLASS_ID;
}
/**
* Gets phone number.
*
* @return the phone number
*/
public String getPhoneNumber() {
return this.phoneNumber;
}
/**
* Sets phone number.
*
* @param phoneNumber the phone number
*/
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
/**
* Gets first name.
*
* @return the first name
*/
public String getFirstName() {
return this.firstName;
}
/**
* Sets first name.
*
* @param firstName the first name
*/
public void setFirstName(String firstName) {
this.firstName = firstName;
}
/**
* Gets last name.
*
* @return the last name
*/
public String getLastName() {
return this.lastName;
}
/**
* Sets last name.
*
* @param lastName the last name
*/
public void setLastName(String lastName) {
this.lastName = lastName;
}
/**
* Gets user id.
*
* @return the user id
*/
public int getUserId() {
return this.userId;
}
/**
* Sets user id.
*
* @param userId the user id
*/
public void setUserId(int userId) {
this.userId = userId;
}
@Override
public void serializeBody(OutputStream stream)
throws IOException {
StreamingUtils.writeTLString(this.phoneNumber, stream);
StreamingUtils.writeTLString(this.firstName, stream);
StreamingUtils.writeTLString(this.lastName, stream);
StreamingUtils.writeInt(this.userId, stream);
}
@Override
public void deserializeBody(InputStream stream, TLContext context)
throws IOException {
this.phoneNumber = StreamingUtils.readTLString(stream);
this.firstName = StreamingUtils.readTLString(stream);
this.lastName = StreamingUtils.readTLString(stream);
this.userId = StreamingUtils.readInt(stream);
}
@Override
public String toString() {
return "decryptedMessageMediaContact#588a0a97";
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy