-
-
Save mariusz-s/a589c9e92bf07c9d4f9667ede9ddda8b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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