package org.telegram.telegrambots.api.objects;

import com.fasterxml.jackson.annotation.JsonProperty;

import org.telegram.telegrambots.api.interfaces.BotApiObject;

/**
 * @author Ruben Bermudez
 * @version 3.0
 * This object represents a Telegram user or bot.
 */
public class User implements BotApiObject {

    private static final String ID_FIELD = "id";
    private static final String FIRSTNAME_FIELD = "first_name";
    private static final String ISBOT_FIELD = "is_bot";
    private static final String LASTNAME_FIELD = "last_name";
    private static final String USERNAME_FIELD = "username";
    private static final String LANGUAGECODE_FIELD = "language_code";

    @JsonProperty(ID_FIELD)
    private Integer id; ///< Unique identifier for this user or bot
    @JsonProperty(FIRSTNAME_FIELD)
    private String firstName; ///< User‘s or bot’s first name
    @JsonProperty(ISBOT_FIELD)
    private Boolean isBot; ///< True, if this user is a bot
    @JsonProperty(LASTNAME_FIELD)
    private String lastName; ///< Optional. User‘s or bot’s last name
    @JsonProperty(USERNAME_FIELD)
    private String userName; ///< Optional. User‘s or bot’s username
    @JsonProperty(LANGUAGECODE_FIELD)
    private String languageCode; ///< Optional. IETF language tag of the user's language

    public User() {
        super();
    }

    public Integer getId() {
        return id;
    }

    public String getFirstName() {
        return firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public String getUserName() {
        return userName;
    }

    public String getLanguageCode() {
        return languageCode;
    }

    public Boolean getBot() {
        return isBot;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", firstName='" + firstName + '\'' +
                ", isBot=" + isBot +
                ", lastName='" + lastName + '\'' +
                ", userName='" + userName + '\'' +
                ", languageCode='" + languageCode + '\'' +
                '}';
    }
}

@@ -159,16 +159,43 @@
 bject;%0A%0A
+import java.util.Objects;%0A%0A
 /**%0A * @
@@ -1349,32 +1349,353 @@
 super();%0A    %7D%0A%0A
+    public User(Integer id, String firstName, Boolean isBot, String lastName, String userName, String languageCode) %7B%0A        this.id = id;%0A        this.firstName = firstName;%0A        this.isBot = isBot;%0A        this.lastName = lastName;%0A        this.userName = userName;%0A        this.languageCode = languageCode;%0A    %7D%0A%0A
     public Integ
@@ -2033,24 +2033,24 @@
  getBot() %7B%0A
-
         retu
@@ -2062,24 +2062,653 @@
 Bot;%0A    %7D%0A%0A
+    @Override%0A    public boolean equals(Object o) %7B%0A      if (this == o) return true;%0A      if (o == null %7C%7C getClass() != o.getClass()) return false;%0A      User user = (User) o;%0A      return Objects.equals(id, user.id) &&%0A          Objects.equals(firstName, user.firstName) &&%0A          Objects.equals(isBot, user.isBot) &&%0A          Objects.equals(lastName, user.lastName) &&%0A          Objects.equals(userName, user.userName) &&%0A          Objects.equals(languageCode, user.languageCode);%0A    %7D%0A%0A    @Override%0A    public int hashCode() %7B%0A      return Objects.hash(id, firstName, isBot, lastName, userName, languageCode);%0A    %7D%0A%0A
     @Overrid

Add detailed constructor, equals and hashCode to User object