-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
484f6d7
commit 7b8eb1c
Showing
64 changed files
with
11,624 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
236 changes: 236 additions & 0 deletions
236
src/main/java/co/aurasphere/botmill/telegram/model/Audio.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,236 @@ | ||
/** | ||
* | ||
*/ | ||
package co.aurasphere.botmill.telegram.model; | ||
|
||
import java.io.Serializable; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
/** | ||
* This object represents an audio file to be treated as music by the Telegram | ||
* clients. | ||
* | ||
* @author Donato Rimenti | ||
* @date Dec 25, 2016 | ||
*/ | ||
public class Audio implements Serializable { | ||
|
||
/** | ||
* The serial version UID. | ||
*/ | ||
private static final long serialVersionUID = 1L; | ||
|
||
/** | ||
* Unique identifier for this file. | ||
*/ | ||
@SerializedName("file_id") | ||
private String fileId; | ||
|
||
/** | ||
* Duration of the audio in seconds as defined by sender. | ||
*/ | ||
private int duration; | ||
|
||
/** | ||
* Optional. Performer of the audio as defined by sender or by audio tags. | ||
*/ | ||
private String performer; | ||
|
||
/** | ||
* Optional. Performer of the audio as defined by sender or by audio tags. | ||
*/ | ||
private String title; | ||
|
||
/** | ||
* Optional. MIME type of the file as defined by sender. | ||
*/ | ||
@SerializedName("mime_type") | ||
private String mimeType; | ||
|
||
/** | ||
* Optional. File size. | ||
*/ | ||
@SerializedName("file_size") | ||
private String fileSize; | ||
|
||
/** | ||
* Gets the {@link #fileId}. | ||
* | ||
* @return the {@link #fileId}. | ||
*/ | ||
public String getFileId() { | ||
return fileId; | ||
} | ||
|
||
/** | ||
* Sets the {@link #fileId}. | ||
* | ||
* @param fileId the {@link #fileId} to set. | ||
*/ | ||
public void setFileId(String fileId) { | ||
this.fileId = fileId; | ||
} | ||
|
||
/** | ||
* Gets the {@link #duration}. | ||
* | ||
* @return the {@link #duration}. | ||
*/ | ||
public int getDuration() { | ||
return duration; | ||
} | ||
|
||
/** | ||
* Sets the {@link #duration}. | ||
* | ||
* @param duration the {@link #duration} to set. | ||
*/ | ||
public void setDuration(int duration) { | ||
this.duration = duration; | ||
} | ||
|
||
/** | ||
* Gets the {@link #performer}. | ||
* | ||
* @return the {@link #performer}. | ||
*/ | ||
public String getPerformer() { | ||
return performer; | ||
} | ||
|
||
/** | ||
* Sets the {@link #performer}. | ||
* | ||
* @param performer the {@link #performer} to set. | ||
*/ | ||
public void setPerformer(String performer) { | ||
this.performer = performer; | ||
} | ||
|
||
/** | ||
* Gets the {@link #title}. | ||
* | ||
* @return the {@link #title}. | ||
*/ | ||
public String getTitle() { | ||
return title; | ||
} | ||
|
||
/** | ||
* Sets the {@link #title}. | ||
* | ||
* @param title the {@link #title} to set. | ||
*/ | ||
public void setTitle(String title) { | ||
this.title = title; | ||
} | ||
|
||
/** | ||
* Gets the {@link #mimeType}. | ||
* | ||
* @return the {@link #mimeType}. | ||
*/ | ||
public String getMimeType() { | ||
return mimeType; | ||
} | ||
|
||
/** | ||
* Sets the {@link #mimeType}. | ||
* | ||
* @param mimeType the {@link #mimeType} to set. | ||
*/ | ||
public void setMimeType(String mimeType) { | ||
this.mimeType = mimeType; | ||
} | ||
|
||
/** | ||
* Gets the {@link #fileSize}. | ||
* | ||
* @return the {@link #fileSize}. | ||
*/ | ||
public String getFileSize() { | ||
return fileSize; | ||
} | ||
|
||
/** | ||
* Sets the {@link #fileSize}. | ||
* | ||
* @param fileSize the {@link #fileSize} to set. | ||
*/ | ||
public void setFileSize(String fileSize) { | ||
this.fileSize = fileSize; | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see java.lang.Object#hashCode() | ||
*/ | ||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + duration; | ||
result = prime * result + ((fileId == null) ? 0 : fileId.hashCode()); | ||
result = prime * result | ||
+ ((fileSize == null) ? 0 : fileSize.hashCode()); | ||
result = prime * result | ||
+ ((mimeType == null) ? 0 : mimeType.hashCode()); | ||
result = prime * result | ||
+ ((performer == null) ? 0 : performer.hashCode()); | ||
result = prime * result + ((title == null) ? 0 : title.hashCode()); | ||
return result; | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see java.lang.Object#equals(java.lang.Object) | ||
*/ | ||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) | ||
return true; | ||
if (obj == null) | ||
return false; | ||
if (getClass() != obj.getClass()) | ||
return false; | ||
Audio other = (Audio) obj; | ||
if (duration != other.duration) | ||
return false; | ||
if (fileId == null) { | ||
if (other.fileId != null) | ||
return false; | ||
} else if (!fileId.equals(other.fileId)) | ||
return false; | ||
if (fileSize == null) { | ||
if (other.fileSize != null) | ||
return false; | ||
} else if (!fileSize.equals(other.fileSize)) | ||
return false; | ||
if (mimeType == null) { | ||
if (other.mimeType != null) | ||
return false; | ||
} else if (!mimeType.equals(other.mimeType)) | ||
return false; | ||
if (performer == null) { | ||
if (other.performer != null) | ||
return false; | ||
} else if (!performer.equals(other.performer)) | ||
return false; | ||
if (title == null) { | ||
if (other.title != null) | ||
return false; | ||
} else if (!title.equals(other.title)) | ||
return false; | ||
return true; | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see java.lang.Object#toString() | ||
*/ | ||
@Override | ||
public String toString() { | ||
return "Audio [fileId=" + fileId + ", duration=" + duration | ||
+ ", performer=" + performer + ", title=" + title | ||
+ ", mimeType=" + mimeType + ", fileSize=" + fileSize + "]"; | ||
} | ||
|
||
} |
Oops, something went wrong.