package com.github.fhuss.storm.elasticsearch;

/**
 * This class should be used to wrap data required to index a document.
 *
 * @author fhussonnois
 * @param <T> type of the underlying document
 */
public class Document<T> {

    /**
     * The name of the index
     */
    private String name;
    /**
     * The type of document
     */
    private String type;
    /**
     * The source document
     */
    private T source;
    /**
     * The document id
     */
    private String id;
    /**
     * The parent document id
     */
    private String parentId;

    public Document(String name, String type,T source) {
        this(name, type, source, null, null);
    }

    public Document(String name, String type, T source, String id) {
        this(name, type, source, id, null);
    }

    public Document(String name, String type, T source, String id, String parentId) {
        this.name = name;
        this.type = type;
        this.source = source;
        this.id = id;
        this.parentId = parentId;
    }

    public String getName( ) {
        return this.name;
    }

    public String getType( ) {
        return this.type;
    }

    public T getSource( ) {
        return this.source;
    }

    public String getId( ) {
        return this.id;
    }

    public String getParentId() {
        return this.parentId;
    }
}

@@ -40,16 +40,46 @@
 earch;%0A%0A
+import java.io.Serializable;%0A%0A
 /**%0A * T
@@ -247,18 +247,100 @@
 ment%3CT%3E 
-%7B%0A
+implements Serializable %7B%0A%0A    private static final long serialVersionUID = 1L;%0A    
 %0A    /**

Fix #6 Document class must implement Serializable