package tutorial.rest.resources;


import java.util.Date;
import org.springframework.hateoas.ResourceSupport;
import tutorial.core.models.entities.Message;

/**
 * 
 * @author Xavier
 */
public class MessageResource extends ResourceSupport {
    private String ownerName;
    private String messageText;
    private Date created;

    public String getOwnerName() {
        return ownerName;
    }

    public void setOwnerName(String owner) {
        this.ownerName = owner;
    }

    
    
    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }
    
    public String getMessageText() {
        return messageText;
    }

    public void setMessageText(String messageText) {
        this.messageText = messageText;
    }

    public Message toMessage() {
        Message message = new Message();
        message.setMessageText(messageText);
        message.setCreated(created);
        return message;
    }
}