summaryrefslogtreecommitdiff
path: root/src/main/java/files/entity/TelegramUser.java
blob: 5564a640c2d57b24a71e6bc7f3fed11667fdfc2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package files.entity;

import com.pengrad.telegrambot.model.User;

import javax.persistence.Entity;
import javax.persistence.Id;

@Entity
public class TelegramUser {
    @Id
    private static Long id;
    private static String username;
    private static Boolean isBot;
    private static String fullName;
    private static String date;

    public TelegramUser() {}

    public TelegramUser(long id, String username, boolean isBot, String fullName, String date) {
        TelegramUser.id = id;
        TelegramUser.username = username;
        TelegramUser.isBot = isBot;
        TelegramUser.fullName = fullName;
        TelegramUser.date = date;
    }

    public static String checkIfHasLastName(User user) {
        String lastName = user.lastName();
        return (lastName != null) ? (" " + lastName) : ("");
    }

    public static Long getId() {
        return id;
    }

    public static String getUsername() {
        return username;
    }

    public static String getFullName() {
        return fullName;
    }
}