Skip to content

Commit

Permalink
Added model with full javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
aurasphere committed Dec 27, 2016
1 parent 484f6d7 commit 7b8eb1c
Show file tree
Hide file tree
Showing 64 changed files with 11,624 additions and 19 deletions.
19 changes: 10 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>co.aurasphere.botmill</groupId>
<artifactId>telegram-botmill</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Telegram-BotMill</name>
<description>A Java framework for building bots on Telegram.</description>

<dependencies>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>co.aurasphere.botmill</groupId>
<artifactId>telegram-botmill</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Telegram-BotMill</name>
<description>A Java framework for building bots on Telegram.</description>

<dependencies>

<dependency>
<groupId>javax.servlet</groupId>
Expand Down
236 changes: 236 additions & 0 deletions src/main/java/co/aurasphere/botmill/telegram/model/Audio.java
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 + "]";
}

}
Loading

0 comments on commit 7b8eb1c

Please sign in to comment.