blob: 1f7cf14356676ec19e4472fdd3eff67cc9f4ac64 (
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
package com.mavlushechka.animarfo.telegram.user;
import com.pengrad.telegrambot.model.User;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
public class TelegramUser {
private long id;
private boolean isBot;
private String firstName;
private String lastName;
private String username;
private String date;
public TelegramUser() {
}
public TelegramUser(long id, boolean isBot, String firstName, String lastName, String username, String date) {
this.id = id;
this.isBot = isBot;
this.firstName = firstName;
this.lastName = lastName;
this.username = username;
this.date = date;
}
public static TelegramUser getInstance(User user, int date) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss z");
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT+5"));
String formattedDate = simpleDateFormat.format(new Date(date * 1000L));
return new TelegramUser(user.id(), user.isBot(), user.firstName(), user.lastName(), user.username(), formattedDate);
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public boolean getIsBot() {
return isBot;
}
public void setIsBot(boolean bot) {
isBot = bot;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
}
|