package org.codiki.core.entities.dto;

import java.util.Date;

import org.codiki.core.entities.persistence.Post;

public class PostDTO {

	private String key;
	
	private String title;
	
	private String text;
	
	private String description;
	
	private String image;

	private Date creationDate;
	
	private UserDTO author;
	
	private CategoryDTO category;
	
	public PostDTO() {
		super();
	}

	public PostDTO(final Post pPost) {
		this();
		key = pPost.getKey();
		title = pPost.getTitle();
		text = pPost.getText();
		description = pPost.getDescription();
		image = pPost.getImage();
		creationDate = pPost.getCreationDate();
		author = new UserDTO(pPost.getAuthor());
		category = new CategoryDTO(pPost.getCategory());
	}
	
	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	public Date getCreationDate() {
		return creationDate;
	}

	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	public UserDTO getAuthor() {
		return author;
	}

	public void setAuthor(UserDTO author) {
		this.author = author;
	}

	public CategoryDTO getCategory() {
		return category;
	}

	public void setCategory(CategoryDTO category) {
		this.category = category;
	}

}
