Skip to content

Commit 7b8eb1c

Browse files
committed
Added model with full javadoc
1 parent 484f6d7 commit 7b8eb1c

64 files changed

Lines changed: 11624 additions & 19 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pom.xml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
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>
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>co.aurasphere.botmill</groupId>
5+
<artifactId>telegram-botmill</artifactId>
6+
<version>0.0.1-SNAPSHOT</version>
7+
<name>Telegram-BotMill</name>
8+
<description>A Java framework for building bots on Telegram.</description>
9+
10+
<dependencies>
1011

1112
<dependency>
1213
<groupId>javax.servlet</groupId>
Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
/**
2+
*
3+
*/
4+
package co.aurasphere.botmill.telegram.model;
5+
6+
import java.io.Serializable;
7+
8+
import com.google.gson.annotations.SerializedName;
9+
10+
/**
11+
* This object represents an audio file to be treated as music by the Telegram
12+
* clients.
13+
*
14+
* @author Donato Rimenti
15+
* @date Dec 25, 2016
16+
*/
17+
public class Audio implements Serializable {
18+
19+
/**
20+
* The serial version UID.
21+
*/
22+
private static final long serialVersionUID = 1L;
23+
24+
/**
25+
* Unique identifier for this file.
26+
*/
27+
@SerializedName("file_id")
28+
private String fileId;
29+
30+
/**
31+
* Duration of the audio in seconds as defined by sender.
32+
*/
33+
private int duration;
34+
35+
/**
36+
* Optional. Performer of the audio as defined by sender or by audio tags.
37+
*/
38+
private String performer;
39+
40+
/**
41+
* Optional. Performer of the audio as defined by sender or by audio tags.
42+
*/
43+
private String title;
44+
45+
/**
46+
* Optional. MIME type of the file as defined by sender.
47+
*/
48+
@SerializedName("mime_type")
49+
private String mimeType;
50+
51+
/**
52+
* Optional. File size.
53+
*/
54+
@SerializedName("file_size")
55+
private String fileSize;
56+
57+
/**
58+
* Gets the {@link #fileId}.
59+
*
60+
* @return the {@link #fileId}.
61+
*/
62+
public String getFileId() {
63+
return fileId;
64+
}
65+
66+
/**
67+
* Sets the {@link #fileId}.
68+
*
69+
* @param fileId the {@link #fileId} to set.
70+
*/
71+
public void setFileId(String fileId) {
72+
this.fileId = fileId;
73+
}
74+
75+
/**
76+
* Gets the {@link #duration}.
77+
*
78+
* @return the {@link #duration}.
79+
*/
80+
public int getDuration() {
81+
return duration;
82+
}
83+
84+
/**
85+
* Sets the {@link #duration}.
86+
*
87+
* @param duration the {@link #duration} to set.
88+
*/
89+
public void setDuration(int duration) {
90+
this.duration = duration;
91+
}
92+
93+
/**
94+
* Gets the {@link #performer}.
95+
*
96+
* @return the {@link #performer}.
97+
*/
98+
public String getPerformer() {
99+
return performer;
100+
}
101+
102+
/**
103+
* Sets the {@link #performer}.
104+
*
105+
* @param performer the {@link #performer} to set.
106+
*/
107+
public void setPerformer(String performer) {
108+
this.performer = performer;
109+
}
110+
111+
/**
112+
* Gets the {@link #title}.
113+
*
114+
* @return the {@link #title}.
115+
*/
116+
public String getTitle() {
117+
return title;
118+
}
119+
120+
/**
121+
* Sets the {@link #title}.
122+
*
123+
* @param title the {@link #title} to set.
124+
*/
125+
public void setTitle(String title) {
126+
this.title = title;
127+
}
128+
129+
/**
130+
* Gets the {@link #mimeType}.
131+
*
132+
* @return the {@link #mimeType}.
133+
*/
134+
public String getMimeType() {
135+
return mimeType;
136+
}
137+
138+
/**
139+
* Sets the {@link #mimeType}.
140+
*
141+
* @param mimeType the {@link #mimeType} to set.
142+
*/
143+
public void setMimeType(String mimeType) {
144+
this.mimeType = mimeType;
145+
}
146+
147+
/**
148+
* Gets the {@link #fileSize}.
149+
*
150+
* @return the {@link #fileSize}.
151+
*/
152+
public String getFileSize() {
153+
return fileSize;
154+
}
155+
156+
/**
157+
* Sets the {@link #fileSize}.
158+
*
159+
* @param fileSize the {@link #fileSize} to set.
160+
*/
161+
public void setFileSize(String fileSize) {
162+
this.fileSize = fileSize;
163+
}
164+
165+
/* (non-Javadoc)
166+
* @see java.lang.Object#hashCode()
167+
*/
168+
@Override
169+
public int hashCode() {
170+
final int prime = 31;
171+
int result = 1;
172+
result = prime * result + duration;
173+
result = prime * result + ((fileId == null) ? 0 : fileId.hashCode());
174+
result = prime * result
175+
+ ((fileSize == null) ? 0 : fileSize.hashCode());
176+
result = prime * result
177+
+ ((mimeType == null) ? 0 : mimeType.hashCode());
178+
result = prime * result
179+
+ ((performer == null) ? 0 : performer.hashCode());
180+
result = prime * result + ((title == null) ? 0 : title.hashCode());
181+
return result;
182+
}
183+
184+
/* (non-Javadoc)
185+
* @see java.lang.Object#equals(java.lang.Object)
186+
*/
187+
@Override
188+
public boolean equals(Object obj) {
189+
if (this == obj)
190+
return true;
191+
if (obj == null)
192+
return false;
193+
if (getClass() != obj.getClass())
194+
return false;
195+
Audio other = (Audio) obj;
196+
if (duration != other.duration)
197+
return false;
198+
if (fileId == null) {
199+
if (other.fileId != null)
200+
return false;
201+
} else if (!fileId.equals(other.fileId))
202+
return false;
203+
if (fileSize == null) {
204+
if (other.fileSize != null)
205+
return false;
206+
} else if (!fileSize.equals(other.fileSize))
207+
return false;
208+
if (mimeType == null) {
209+
if (other.mimeType != null)
210+
return false;
211+
} else if (!mimeType.equals(other.mimeType))
212+
return false;
213+
if (performer == null) {
214+
if (other.performer != null)
215+
return false;
216+
} else if (!performer.equals(other.performer))
217+
return false;
218+
if (title == null) {
219+
if (other.title != null)
220+
return false;
221+
} else if (!title.equals(other.title))
222+
return false;
223+
return true;
224+
}
225+
226+
/* (non-Javadoc)
227+
* @see java.lang.Object#toString()
228+
*/
229+
@Override
230+
public String toString() {
231+
return "Audio [fileId=" + fileId + ", duration=" + duration
232+
+ ", performer=" + performer + ", title=" + title
233+
+ ", mimeType=" + mimeType + ", fileSize=" + fileSize + "]";
234+
}
235+
236+
}

0 commit comments

Comments
 (0)