Newer
Older
CosmosServer / src / main / java / com / example / cosmos_serversb / jsons / RequestJson.java
package com.example.cosmos_serversb.jsons;

import com.example.cosmos_serversb.entities.Request;
import com.example.cosmos_serversb.entities.User;
import com.example.cosmos_serversb.models.Users;

import java.util.Date;

public class RequestJson {
    private String rId;
    private String uri, product;
    private UserJsonForRequests Issuer;
    private Date date, deadline;
    private int location;// YahooローカルサーチAPIの業種コード
    private boolean done = false;

    public RequestJson(){

    }

    public RequestJson(Request request){
        setrId(request.getrId());
        setUri(request.getrId());
        setDate(request.getDate());
        SetIssuerByUid(request.getIssuerUid());
        setProduct(request.getProduct());
        setDeadline(request.getDeadline());
        setLocation(request.getLocation());
        setDone(request.getDone());
    }

    private void setrId(String rId){
        this.rId = rId;
    }

    public String getrId(){
        return rId;
    }

    private void setUri(String uri){
        this.uri = uri;
    }

    public String getUri(){
        return uri;
    }

    private void setDate(Date date){
        this.date = date;
    }

    public Date getDate() {
        return date;
    }

    public UserJsonForRequests getIssuer(){
        return Issuer;
    }

    private void setIssuer(UserJsonForRequests user){
        this.Issuer = user;
    }

    private void SetIssuerByUid(String uId){
        this.Issuer = new UserJsonForRequests(Users.getInstance().getUserById(uId));
    }

    public String getProduct() {
        return product;
    }

    public void setProduct(String product) {
        this.product = product;
    }

    public Date getDeadline() {
        return deadline;
    }

    public void setDeadline(Date deadline) {
        this.deadline = deadline;
    }

    public int getLocation() {
        return location;
    }

    public void setLocation(int location) {
        this.location = location;
    }

    public boolean isDone() {
        return done;
    }

    public boolean getDone() {
        return done;
    }

    public void setDone(boolean done) {
        this.done = done;
    }
}