removed field "article" for clearer understanding
This commit is contained in:
parent
8755eb18f7
commit
6002d2c81e
|
@ -15,11 +15,6 @@ public class Post {
|
|||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* Full article.
|
||||
*/
|
||||
private String article;
|
||||
|
||||
/**
|
||||
* Author of the post.
|
||||
*/
|
||||
|
@ -49,25 +44,6 @@ public class Post {
|
|||
this.title = title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the {@link #article}.
|
||||
*
|
||||
* @return the {@link #article}
|
||||
*/
|
||||
public String getArticle() {
|
||||
return article;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@link #article}.
|
||||
*
|
||||
* @param article
|
||||
* the new {@link #article}
|
||||
*/
|
||||
public void setArticle(String article) {
|
||||
this.article = article;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the {@link #author}.
|
||||
*
|
||||
|
@ -115,7 +91,6 @@ public class Post {
|
|||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((article == null) ? 0 : article.hashCode());
|
||||
result = prime * result + ((author == null) ? 0 : author.hashCode());
|
||||
result = prime * result + ((tags == null) ? 0 : tags.hashCode());
|
||||
result = prime * result + ((title == null) ? 0 : title.hashCode());
|
||||
|
@ -136,11 +111,6 @@ public class Post {
|
|||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
Post other = (Post) obj;
|
||||
if (article == null) {
|
||||
if (other.article != null)
|
||||
return false;
|
||||
} else if (!article.equals(other.article))
|
||||
return false;
|
||||
if (author == null) {
|
||||
if (other.author != null)
|
||||
return false;
|
||||
|
@ -166,7 +136,7 @@ public class Post {
|
|||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Post [title=" + title + ", article=" + article + ", author=" + author + ", tags=" + tags + "]";
|
||||
return "Post [title=" + title + ", author=" + author + ", tags=" + tags + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -135,7 +135,6 @@ public class TagRepository implements Closeable {
|
|||
private static Post documentToPost(Document document) {
|
||||
Post post = new Post();
|
||||
post.setTitle(document.getString(DBCollection.ID_FIELD_NAME));
|
||||
post.setArticle(document.getString("article"));
|
||||
post.setAuthor(document.getString("author"));
|
||||
post.setTags((List<String>) document.get(TAGS_FIELD));
|
||||
return post;
|
||||
|
|
|
@ -19,6 +19,7 @@ import org.junit.Test;
|
|||
public class TaggingIntegrationTest {
|
||||
|
||||
/**
|
||||
* Object to test.
|
||||
* Object to test.
|
||||
*/
|
||||
private TagRepository repository;
|
||||
|
|
Loading…
Reference in New Issue