All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Explore the source code of the class Contact.java

package com.antonioaltieri.telegram.botapi.types;

import com.google.gson.annotations.SerializedName;

/**
 * This object represents a phone contact.
 *
 * Any getters labeled optional might return a default value (such as [email protected] null}).
 *
 * @see https://core.telegram.org/bots/api#contact
 */
public class Contact {

    @SerializedName("phone_number")
    private String phoneNumber;

    @SerializedName("first_name")
    private String firstName;

    @SerializedName("last_name")
    private String lastName;

    @SerializedName("user_id")
    private long userId;

    /**
     * @return Contact's phone number
     */
    public String getPhoneNumber() {
        return phoneNumber;
    }

    /**
     * @return Contact's first name
     */
    public String getFirstName() {
        return firstName;
    }

    /**
     * Optional.
     *
     * @return Contact's last name
     */
    public String getLastName() {
        return lastName;
    }

    /**
     * Optional.
     *
     * @return Contact's user identifier in Telegram
     */
    public long getUserId() {
        return userId;
    }

}