001package io.ebean.docstore;
002
003import java.util.Map;
004
005/**
006 * Raw document.
007 */
008public class RawDoc {
009
010  private Map<String, Object> source;
011  private String id;
012  private double score;
013  private String index;
014  private String type;
015
016  /**
017   * Construct the document with all the meta data.
018   */
019  public RawDoc(Map<String, Object> source, String id, double score, String index, String type) {
020    this.source = source;
021    this.id = id;
022    this.score = score;
023    this.index = index;
024    this.type = type;
025  }
026
027  /**
028   * Construct empty (typically for JSON marshalling).
029   */
030  public RawDoc() {
031  }
032
033  /**
034   * Return the source document as a Map.
035   */
036  public Map<String, Object> getSource() {
037    return source;
038  }
039
040  /**
041   * Return the Id value.
042   */
043  public String getId() {
044    return id;
045  }
046
047  /**
048   * Return the score.
049   */
050  public double getScore() {
051    return score;
052  }
053
054  /**
055   * Return the index name.
056   */
057  public String getIndex() {
058    return index;
059  }
060
061  /**
062   * Return the index type.
063   */
064  public String getType() {
065    return type;
066  }
067
068  /**
069   * Set the source document.
070   */
071  public void setSource(Map<String, Object> source) {
072    this.source = source;
073  }
074
075  /**
076   * Set the id value.
077   */
078  public void setId(String id) {
079    this.id = id;
080  }
081
082  /**
083   * Set the score.
084   */
085  public void setScore(double score) {
086    this.score = score;
087  }
088
089  /**
090   * Set the index name.
091   */
092  public void setIndex(String index) {
093    this.index = index;
094  }
095
096  /**
097   * Set the index type.
098   */
099  public void setType(String type) {
100    this.type = type;
101  }
102}