Skip to content

Instantly share code, notes, and snippets.

@galek
Created September 4, 2017 22:16
Show Gist options
  • Save galek/a45f0bbc0a384142c63dee70acbd9282 to your computer and use it in GitHub Desktop.
Save galek/a45f0bbc0a384142c63dee70acbd9282 to your computer and use it in GitHub Desktop.
package ru.mastermmo.rhumester;
import android.graphics.Bitmap;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Post
{
//@SerializedName("postId")
private int postId;
//@SerializedName("likes")
private int likes;
//@SerializedName("dislikes")
private int dislikes;
// @SerializedName("timestamp")
private long timestamp;
//@SerializedName("avatars")
private Bitmap[] avatars;
//@SerializedName("caption")
private String caption;
//@SerializedName("poemHead")
private String poemHead;
//@SerializedName("poemTails")
private String[] poemTails;
// @SerializedName("currentTail")
private int currentTail;
public Post(int postId, int likes, int dislikes, long timestamp, Bitmap[] avatars, String caption, String poemHead, String[] poemTails, int currentTail) {
this.setPostId(postId);
this.setLikes(likes);
this.setDislikes(dislikes);
this.setTimestamp(timestamp);
this.setAvatars(avatars);
this.setCaption(caption);
this.setPoemHead(poemHead);
this.setPoemTails(poemTails);
this.setCurrentTail(currentTail);
}
public int getPostId() {
return postId;
}
public void setPostId(int postId) {
this.postId = postId;
}
public int getLikes() {
return likes;
}
public void setLikes(int likes) {
this.likes = likes;
}
public int getDislikes() {
return dislikes;
}
public void setDislikes(int dislikes) {
this.dislikes = dislikes;
}
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
public Bitmap CurrentAvatar() {
return avatars[currentTail];
}
public String getCaption() {
return caption;
}
public void setCaption(String caption) {
this.caption = caption;
}
public String getPoemHead() {
return poemHead;
}
public void setPoemHead(String poemHead) {
this.poemHead = poemHead;
}
public int getCurrentTail() {
return currentTail;
}
public String getCurrentText() {
return getPoemHead() + "\n" + poemTails[getCurrentTail()];
}
public int getTailsCount() {
return poemTails.length;
}
public void setAvatars(Bitmap[] avatars) {
this.avatars = avatars;
}
public void setPoemTails(String[] poemTails) {
this.poemTails = poemTails;
}
public void setCurrentTail(int currentTail) {
this.currentTail = currentTail;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment