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
|
|
|
|
* @brief This object represents a phone contact.
|
|
|
|
* @date 20 of June of 2015
|
|
|
|
*/
|
2016-11-17 02:41:12 +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";
|
2016-11-17 02:41:12 +01:00
|
|
|
|
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
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2016-03-08 20:17:07 +01:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "Contact{" +
|
|
|
|
"phoneNumber='" + phoneNumber + '\'' +
|
|
|
|
", firstName='" + firstName + '\'' +
|
|
|
|
", lastName='" + lastName + '\'' +
|
|
|
|
", userID=" + userID +
|
|
|
|
'}';
|
|
|
|
}
|
2016-01-14 01:14:53 +01:00
|
|
|
}
|