// Path: airomem-chatsample/airomem-chatsample-view/src/main/java/pl/setblack/airomem/chatsample/view/AuthorView.java
// @XmlRootElement
// public interface AuthorView {
// 
//     @XmlAttribute
//     String getNickName();
// }
// 
// Path: airomem-chatsample/airomem-chatsample-view/src/main/java/pl/setblack/airomem/chatsample/view/MessageView.java
// @XmlRootElement
// public interface MessageView {
// 
//     @XmlElement
//     String getContent();
//     
//     @XmlElement
//     AuthorView getAuthorView();
//     
//     @XmlAttribute
//     LocalDateTime getTime();
//     
//     String getAuthorNick();
// }


import com.googlecode.cqengine.attribute.Attribute;
import com.googlecode.cqengine.attribute.SimpleAttribute;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.chrono.ChronoLocalDate;
import java.time.chrono.ChronoLocalDateTime;
import javax.xml.bind.annotation.XmlElement;
import pl.setblack.airomem.chatsample.view.AuthorView;
import pl.setblack.airomem.chatsample.view.MessageView;
/*
 *  Created by Jarek Ratajski
 */
package pl.setblack.airomem.chatsample.data;


/**
 *
 * @author jarekr
 */
public class Message implements MessageView, Serializable {

    private static final long serialVersionUID = 1;

    public static final SimpleAttribute<Message, ChronoLocalDateTime> MESSAGE_TIME
            = new SimpleAttribute<Message, ChronoLocalDateTime>() {
                @Override
                public ChronoLocalDateTime getValue(Message msg) {
                    return msg.getTime();
                }
            };

    private final Author author;

    private final String content;

    private final LocalDateTime time;

    public Message(Author author, String content, LocalDateTime time) {
        this.author = author;
        this.content = content;
        this.time = time;
    }

    @Override
    public String getContent() {
        return content;
    }

    @Override
    public LocalDateTime getTime() {
        return time;
    }

    @Override
    @XmlElement
// Path: airomem-chatsample/airomem-chatsample-view/src/main/java/pl/setblack/airomem/chatsample/view/AuthorView.java
// @XmlRootElement
// public interface AuthorView {
// 
//     @XmlAttribute
//     String getNickName();
// }
// 
// Path: airomem-chatsample/airomem-chatsample-view/src/main/java/pl/setblack/airomem/chatsample/view/MessageView.java
// @XmlRootElement
// public interface MessageView {
// 
//     @XmlElement
//     String getContent();
//     
//     @XmlElement
//     AuthorView getAuthorView();
//     
//     @XmlAttribute
//     LocalDateTime getTime();
//     
//     String getAuthorNick();
// }


// Path: airomem-chatsample/airomem-chatsample-data/src/main/java/pl/setblack/airomem/chatsample/data/Message.java
import com.googlecode.cqengine.attribute.Attribute;
import com.googlecode.cqengine.attribute.SimpleAttribute;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.chrono.ChronoLocalDate;
import java.time.chrono.ChronoLocalDateTime;
import javax.xml.bind.annotation.XmlElement;
import pl.setblack.airomem.chatsample.view.AuthorView;
import pl.setblack.airomem.chatsample.view.MessageView;

/*
 *  Created by Jarek Ratajski
 */
package pl.setblack.airomem.chatsample.data;


/**
 *
 * @author jarekr
 */
public class Message implements MessageView, Serializable {

    private static final long serialVersionUID = 1;

    public static final SimpleAttribute<Message, ChronoLocalDateTime> MESSAGE_TIME
            = new SimpleAttribute<Message, ChronoLocalDateTime>() {
                @Override
                public ChronoLocalDateTime getValue(Message msg) {
                    return msg.getTime();
                }
            };

    private final Author author;

    private final String content;

    private final LocalDateTime time;

    public Message(Author author, String content, LocalDateTime time) {
        this.author = author;
        this.content = content;
        this.time = time;
    }

    @Override
    public String getContent() {
        return content;
    }

    @Override
    public LocalDateTime getTime() {
        return time;
    }

    @Override
    @XmlElement
    public AuthorView getAuthorView() {