Skip to content

Commit 484f6d7

Browse files
committed
Created project and added some model
1 parent fe067fb commit 484f6d7

10 files changed

Lines changed: 1649 additions & 0 deletions

File tree

.classpath

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
10+
<attributes>
11+
<attribute name="maven.pomderived" value="true"/>
12+
</attributes>
13+
</classpathentry>
14+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
15+
<attributes>
16+
<attribute name="optional" value="true"/>
17+
<attribute name="maven.pomderived" value="true"/>
18+
</attributes>
19+
</classpathentry>
20+
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
21+
<attributes>
22+
<attribute name="maven.pomderived" value="true"/>
23+
</attributes>
24+
</classpathentry>
25+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
26+
<attributes>
27+
<attribute name="maven.pomderived" value="true"/>
28+
</attributes>
29+
</classpathentry>
30+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
31+
<attributes>
32+
<attribute name="maven.pomderived" value="true"/>
33+
</attributes>
34+
</classpathentry>
35+
<classpathentry kind="output" path="target/classes"/>
36+
</classpath>

.project

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>telegram-botmill</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
3+
org.eclipse.jdt.core.compiler.compliance=1.5
4+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
5+
org.eclipse.jdt.core.compiler.source=1.5
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
activeProfiles=
2+
eclipse.preferences.version=1
3+
resolveWorkspaceProjects=true
4+
version=1

pom.xml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>co.aurasphere.botmill</groupId>
4+
<artifactId>telegram-botmill</artifactId>
5+
<version>0.0.1-SNAPSHOT</version>
6+
<name>Telegram-BotMill</name>
7+
<description>A Java framework for building bots on Telegram.</description>
8+
9+
<dependencies>
10+
11+
<dependency>
12+
<groupId>javax.servlet</groupId>
13+
<artifactId>servlet-api</artifactId>
14+
<version>2.5</version>
15+
<scope>provided</scope>
16+
</dependency>
17+
18+
<dependency>
19+
<groupId>com.google.code.gson</groupId>
20+
<artifactId>gson</artifactId>
21+
<version>2.7</version>
22+
</dependency>
23+
24+
<dependency>
25+
<groupId>org.apache.httpcomponents</groupId>
26+
<artifactId>httpclient</artifactId>
27+
<version>4.5.2</version>
28+
</dependency>
29+
30+
<dependency>
31+
<groupId>org.apache.httpcomponents</groupId>
32+
<artifactId>httpmime</artifactId>
33+
<version>4.5.2</version>
34+
</dependency>
35+
36+
<dependency>
37+
<groupId>org.slf4j</groupId>
38+
<artifactId>slf4j-api</artifactId>
39+
<version>1.7.21</version>
40+
</dependency>
41+
42+
<dependency>
43+
<groupId>ch.qos.logback</groupId>
44+
<artifactId>logback-classic</artifactId>
45+
<version>1.0.13</version>
46+
</dependency>
47+
48+
<dependency>
49+
<groupId>org.hibernate</groupId>
50+
<artifactId>hibernate-validator</artifactId>
51+
<version>5.2.4.Final</version>
52+
</dependency>
53+
54+
<dependency>
55+
<groupId>org.glassfish.web</groupId>
56+
<artifactId>javax.el</artifactId>
57+
<version>2.2.4</version>
58+
</dependency>
59+
60+
</dependencies>
61+
62+
</project>
Lines changed: 260 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,260 @@
1+
package co.aurasphere.botmill.telegram.model;
2+
3+
import java.io.Serializable;
4+
5+
import com.google.gson.annotations.SerializedName;
6+
7+
/**
8+
* This object represents a chat.
9+
*
10+
* @author Donato Rimenti
11+
* @date Dec 25, 2016
12+
*/
13+
public class Chat implements Serializable {
14+
15+
/**
16+
* The serial version UID.
17+
*/
18+
private static final long serialVersionUID = 1L;
19+
20+
/**
21+
* Unique identifier for this chat. This number may be greater than 32 bits
22+
* and some programming languages may have difficulty/silent defects in
23+
* interpreting it. But it smaller than 52 bits, so a signed 64 bit integer
24+
* or double-precision float type are safe for storing this identifier.
25+
*/
26+
private String id;
27+
28+
/**
29+
* Type of chat, can be either “private”, “group”, “supergroup” or
30+
* “channel”.
31+
*/
32+
private ChatType type;
33+
34+
/**
35+
* Type of chat, can be either “private”, “group”, “supergroup” or “channel”.
36+
*/
37+
private String title;
38+
39+
/**
40+
* Optional. Username, for private chats, supergroups and channels if available.
41+
*/
42+
private String username;
43+
44+
/**
45+
* Optional. First name of the other party in a private chat.
46+
*/
47+
@SerializedName("first_name")
48+
private String firstName;
49+
50+
/**
51+
* Optional. Last name of the other party in a private chat.
52+
*/
53+
@SerializedName("last_name")
54+
private String lastName;
55+
56+
/**
57+
* Optional. True if a group has ‘All Members Are Admins’ enabled.
58+
*/
59+
@SerializedName("all_members_are_administrators")
60+
private boolean allMembersAreAdministrators;
61+
62+
/**
63+
* Gets the {@link #id}.
64+
*
65+
* @return the {@link #id}.
66+
*/
67+
public String getId() {
68+
return id;
69+
}
70+
71+
/**
72+
* Sets the {@link #id}.
73+
*
74+
* @param id the {@link #id} to set.
75+
*/
76+
public void setId(String id) {
77+
this.id = id;
78+
}
79+
80+
/**
81+
* Gets the {@link #type}.
82+
*
83+
* @return the {@link #type}.
84+
*/
85+
public ChatType getType() {
86+
return type;
87+
}
88+
89+
/**
90+
* Sets the {@link #type}.
91+
*
92+
* @param type the {@link #type} to set.
93+
*/
94+
public void setType(ChatType type) {
95+
this.type = type;
96+
}
97+
98+
/**
99+
* Gets the {@link #title}.
100+
*
101+
* @return the {@link #title}.
102+
*/
103+
public String getTitle() {
104+
return title;
105+
}
106+
107+
/**
108+
* Sets the {@link #title}.
109+
*
110+
* @param title the {@link #title} to set.
111+
*/
112+
public void setTitle(String title) {
113+
this.title = title;
114+
}
115+
116+
/**
117+
* Gets the {@link #username}.
118+
*
119+
* @return the {@link #username}.
120+
*/
121+
public String getUsername() {
122+
return username;
123+
}
124+
125+
/**
126+
* Sets the {@link #username}.
127+
*
128+
* @param username the {@link #username} to set.
129+
*/
130+
public void setUsername(String username) {
131+
this.username = username;
132+
}
133+
134+
/**
135+
* Gets the {@link #firstName}.
136+
*
137+
* @return the {@link #firstName}.
138+
*/
139+
public String getFirstName() {
140+
return firstName;
141+
}
142+
143+
/**
144+
* Sets the {@link #firstName}.
145+
*
146+
* @param firstName the {@link #firstName} to set.
147+
*/
148+
public void setFirstName(String firstName) {
149+
this.firstName = firstName;
150+
}
151+
152+
/**
153+
* Gets the {@link #lastName}.
154+
*
155+
* @return the {@link #lastName}.
156+
*/
157+
public String getLastName() {
158+
return lastName;
159+
}
160+
161+
/**
162+
* Sets the {@link #lastName}.
163+
*
164+
* @param lastName the {@link #lastName} to set.
165+
*/
166+
public void setLastName(String lastName) {
167+
this.lastName = lastName;
168+
}
169+
170+
/**
171+
* Checks if is all members are administrators.
172+
*
173+
* @return true, if is all members are administrators
174+
*/
175+
public boolean isAllMembersAreAdministrators() {
176+
return allMembersAreAdministrators;
177+
}
178+
179+
/**
180+
* Sets the {@link #allMembersAreAdministrators}.
181+
*
182+
* @param allMembersAreAdministrators the {@link #allMembersAreAdministrators} to set.
183+
*/
184+
public void setAllMembersAreAdministrators(boolean allMembersAreAdministrators) {
185+
this.allMembersAreAdministrators = allMembersAreAdministrators;
186+
}
187+
188+
/* (non-Javadoc)
189+
* @see java.lang.Object#hashCode()
190+
*/
191+
@Override
192+
public int hashCode() {
193+
final int prime = 31;
194+
int result = 1;
195+
result = prime * result + (allMembersAreAdministrators ? 1231 : 1237);
196+
result = prime * result
197+
+ ((firstName == null) ? 0 : firstName.hashCode());
198+
result = prime * result + ((id == null) ? 0 : id.hashCode());
199+
result = prime * result
200+
+ ((lastName == null) ? 0 : lastName.hashCode());
201+
result = prime * result + ((title == null) ? 0 : title.hashCode());
202+
result = prime * result
203+
+ ((username == null) ? 0 : username.hashCode());
204+
return result;
205+
}
206+
207+
/* (non-Javadoc)
208+
* @see java.lang.Object#equals(java.lang.Object)
209+
*/
210+
@Override
211+
public boolean equals(Object obj) {
212+
if (this == obj)
213+
return true;
214+
if (obj == null)
215+
return false;
216+
if (getClass() != obj.getClass())
217+
return false;
218+
Chat other = (Chat) obj;
219+
if (allMembersAreAdministrators != other.allMembersAreAdministrators)
220+
return false;
221+
if (firstName == null) {
222+
if (other.firstName != null)
223+
return false;
224+
} else if (!firstName.equals(other.firstName))
225+
return false;
226+
if (id == null) {
227+
if (other.id != null)
228+
return false;
229+
} else if (!id.equals(other.id))
230+
return false;
231+
if (lastName == null) {
232+
if (other.lastName != null)
233+
return false;
234+
} else if (!lastName.equals(other.lastName))
235+
return false;
236+
if (title == null) {
237+
if (other.title != null)
238+
return false;
239+
} else if (!title.equals(other.title))
240+
return false;
241+
if (username == null) {
242+
if (other.username != null)
243+
return false;
244+
} else if (!username.equals(other.username))
245+
return false;
246+
return true;
247+
}
248+
249+
/* (non-Javadoc)
250+
* @see java.lang.Object#toString()
251+
*/
252+
@Override
253+
public String toString() {
254+
return "Chat [id=" + id + ", title=" + title + ", username=" + username
255+
+ ", firstName=" + firstName + ", lastName=" + lastName
256+
+ ", allMembersAreAdministrators="
257+
+ allMembersAreAdministrators + "]";
258+
}
259+
260+
}

0 commit comments

Comments
 (0)