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

67 lines
1.9 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;
2020-11-01 23:46:36 +01:00
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
2018-07-08 01:41:21 +02:00
import org.telegram.telegrambots.meta.api.interfaces.BotApiObject;
2016-01-14 01:14:53 +01:00
/**
* This object represents a phone contact.
2016-01-14 01:14:53 +01:00
* @author Ruben Bermudez
* @version 1.0
*/
2020-11-01 23:46:36 +01:00
@EqualsAndHashCode(callSuper = false)
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
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";
/**
* Contact's phone number
*/
2016-01-14 01:14:53 +01:00
@JsonProperty(PHONENUMBER_FIELD)
private String phoneNumber;
/**
* Contact's first name
*/
2016-01-14 01:14:53 +01:00
@JsonProperty(FIRSTNAME_FIELD)
private String firstName;
/**
* Optional.
* Contact's last name
*/
2016-01-14 01:14:53 +01:00
@JsonProperty(LASTNAME_FIELD)
private String lastName;
2021-03-09 11:59:28 +01:00
/**
* Optional.
* Contact's user identifier in Telegram.
*
* @apiNote This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it.
* But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
*/
/**
* Optional.
* Contact's user identifier in Telegram
*/
2016-01-14 01:14:53 +01:00
@JsonProperty(USERID_FIELD)
private Long userId;
/**
* Optional.
* Additional data about the contact in the form of a vCard
*/
2018-07-27 00:27:26 +02:00
@JsonProperty(VCARD_FIELD)
private String vCard;
2016-01-14 01:14:53 +01:00
}