Created
September 4, 2017 19:50
-
-
Save galek/f28bb7a2b69a3118af917f02f044e493 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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