Skip to content

Instantly share code, notes, and snippets.

@mariusz-s
Created February 7, 2018 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariusz-s/a589c9e92bf07c9d4f9667ede9ddda8b to your computer and use it in GitHub Desktop.
Save mariusz-s/a589c9e92bf07c9d4f9667ede9ddda8b to your computer and use it in GitHub Desktop.
package pl.net.bluesoft.model;
import org.apache.solr.client.solrj.beans.Field;
import org.springframework.data.annotation.Id;
import org.springframework.data.solr.core.mapping.SolrDocument;
@SolrDocument(solrCoreName = "newsgroups")
public class News {
@Id
@Field
private String id;
@Field
private int number;
@Field
private String group;
@Field
private String content;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getGroup() {
return group;
}
public void setGroup(String group) {
this.group = group;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
News news = (News) o;
if (number != news.number) return false;
if (id != null ? !id.equals(news.id) : news.id != null) return false;
if (group != null ? !group.equals(news.group) : news.group != null) return false;
return content != null ? content.equals(news.content) : news.content == null;
}
@Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + number;
result = 31 * result + (group != null ? group.hashCode() : 0);
result = 31 * result + (content != null ? content.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "News{" +
"id='" + id + '\'' +
", number=" + number +
", group='" + group + '\'' +
'}';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment