001package org.gbif.api.model.registry.search;
002
003import org.gbif.api.vocabulary.DatasetSubtype;
004import org.gbif.api.vocabulary.DatasetType;
005
006import java.util.UUID;
007
008import com.google.common.base.Objects;
009
010/**
011 * The dataset search model object for suggest searches of datasets.
012 */
013public class DatasetSuggestResult {
014
015  private UUID key;
016  private String title;
017  private String description;
018  private DatasetType type;
019  private DatasetSubtype subtype;
020
021
022  public UUID getKey() {
023    return key;
024  }
025
026  public void setKey(UUID key) {
027    this.key = key;
028  }
029
030  public String getTitle() {
031    return title;
032  }
033
034  public void setTitle(String title) {
035    this.title = title;
036  }
037
038  public String getDescription() {
039    return description;
040  }
041
042  public void setDescription(String description) {
043    this.description = description;
044  }
045
046  public DatasetType getType() {
047    return type;
048  }
049
050  public void setType(DatasetType type) {
051    this.type = type;
052  }
053
054  public DatasetSubtype getSubtype() {
055    return subtype;
056  }
057
058  public void setSubtype(DatasetSubtype subtype) {
059    this.subtype = subtype;
060  }
061
062
063  @Override
064  public int hashCode() {
065    return Objects
066      .hashCode(key, title, description, type, subtype);
067  }
068
069  @Override
070  public boolean equals(Object object) {
071    if (object instanceof DatasetSuggestResult) {
072      DatasetSuggestResult that = (DatasetSuggestResult) object;
073      return Objects.equal(this.key, that.key)
074        && Objects.equal(this.title, that.title)
075        && Objects.equal(this.description, that.description)
076        && Objects.equal(this.type, that.type)
077        && Objects.equal(this.subtype, that.subtype);
078    }
079    return false;
080  }
081
082  @Override
083  public String toString() {
084    return Objects.toStringHelper(this)
085      .add("key", key)
086      .add("title", title)
087      .add("description", description)
088      .add("type", type)
089      .add("subtype", subtype)
090      .toString();
091  }
092}