Newer
Older
NemophilaClient / app / src / main / java / com / example / nemophila / entities / Post.java
m-mifune on 29 Jun 2023 1 KB Dateを追加
package com.example.nemophila.entities;

public class Post {
    private String pid;
    private String uid;
    private String name;
    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 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 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.genre = pj.getGenre();
        this.date = pj.getDate();
        this.rate = pj.getRate();
        this.comment = pj.getComment();
    }
}