TelegramBots/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Contact.java

66 lines
1.8 KiB
Java
Raw Normal View History

2018-07-08 01:41:21 +02:00
package org.telegram.telegrambots.meta.api.objects;
2016-01-14 01:14:53 +01:00
import com.fasterxml.jackson.annotation.JsonProperty;
2016-04-02 18:20:49 +02:00
2018-07-08 01:41:21 +02:00
import org.telegram.telegrambots.meta.api.interfaces.BotApiObject;
2016-01-14 01:14:53 +01:00
/**
* @author Ruben Bermudez
* @version 1.0
2018-07-27 00:27:26 +02:00
* This object represents a phone contact.
2016-01-14 01:14:53 +01:00
*/
public class Contact implements BotApiObject {
2016-01-14 01:14:53 +01:00
2016-04-11 02:53:53 +02:00
private static final String PHONENUMBER_FIELD = "phone_number";
private static final String FIRSTNAME_FIELD = "first_name";
private static final String LASTNAME_FIELD = "last_name";
private static final String USERID_FIELD = "user_id";
2018-07-27 00:27:26 +02:00
private static final String VCARD_FIELD = "vcard";
2016-01-14 01:14:53 +01:00
@JsonProperty(PHONENUMBER_FIELD)
private String phoneNumber; ///< Contact's phone number
@JsonProperty(FIRSTNAME_FIELD)
private String firstName; ///< Contact's first name
@JsonProperty(LASTNAME_FIELD)
private String lastName; ///< Optional. Contact's last name
@JsonProperty(USERID_FIELD)
private Integer userID; ///< Optional. Contact's user identifier in Telegram
2018-07-27 00:27:26 +02:00
@JsonProperty(VCARD_FIELD)
private String vCard; ///< Optional. Additional data about the contact in the form of a vCard
2016-01-14 01:14:53 +01:00
public Contact() {
super();
}
2016-05-02 08:21:41 +02:00
public String getPhoneNumber() {
return phoneNumber;
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public Integer getUserID() {
return userID;
}
2018-07-27 00:27:26 +02:00
public String getVCard() {
return vCard;
}
@Override
public String toString() {
return "Contact{" +
"phoneNumber='" + phoneNumber + '\'' +
", firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' +
", userID=" + userID +
2018-07-27 00:27:26 +02:00
", vCard=" + vCard +
'}';
}
2016-01-14 01:14:53 +01:00
}