org.telegram.api.message.media.TLMessageMediaContact 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
package org.telegram.api.message.media;
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 message media contact.
*/
public class TLMessageMediaContact extends TLAbsMessageMedia {
/**
* The constant CLASS_ID.
*/
public static final int CLASS_ID = 0x5e7d2f39;
private String phoneNumber;
private String firstName;
private String lastName;
private int userId;
/**
* Instantiates a new TL message media contact.
*/
public TLMessageMediaContact() {
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 "messageMediaContact#5e7d2f39";
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy