package com.example.nemophila.entities; public class Post { private String pid; private String uid; private String name; private String shopName; private String genre; private String date; private int rate; private String comment; //Getter public String getPid() { return pid; } public String getUid() { return uid; } public String getName() { return name; } public String getShopName() { return shopName; } public String getGenre() { return genre; } public String getDate() { return date; } public int getRate() { return rate; } public String getComment() { return comment; } //Setter public void setPid(String pid) { this.pid = pid; } public void setUid(String uid) { this.uid = uid; } public void setName(String name) { this.name = name; } public void setShopName(String shopName) { this.shopName = shopName; } public void setGenre(String genre) { this.genre = genre; } public void setDate(String date) { this.date = date; } public void setRate(int rate) { this.rate = rate; } public void setComment(String comment) { this.comment = comment; } //コンストラクタ(PostJsonからPostを作成) public Post(PostJson pj) { this.pid = pj.getId(); this.uid = pj.getOwner().getId(); this.name = pj.getOwner().getName(); this.shopName = pj.getShopName(); this.genre = pj.getGenre(); this.date = pj.getDate(); this.rate = pj.getRate(); this.comment = pj.getComment(); } }