package be.nikiroo.gofetch.data;
import java.net.URL;
+import java.util.List;
import be.nikiroo.gofetch.support.BasicSupport;
import be.nikiroo.gofetch.support.BasicSupport.Type;
private String urlExternal;
private String content;
+ private String fullContent;
+ private List<Comment> comments;
+
/**
* Create a news story.
*
this.urlInternal = urlInternal;
this.urlExternal = urlExternal;
this.content = content;
+
+ // Defaults fullContent to content
+ this.fullContent = content;
}
public String getSelector() {
public String getContent() {
return content;
}
+
+ /**
+ * @return the fullContent
+ */
+ public String getFullContent() {
+ return fullContent;
+ }
+
+ /**
+ * @param fullContent
+ * the fullContent to set
+ */
+ public void setFullContent(String fullContent) {
+ this.fullContent = fullContent;
+ }
+
+ /**
+ * @return the comments
+ */
+ public List<Comment> getComments() {
+ return comments;
+ }
+
+ /**
+ * @param comments
+ * the comments to set
+ */
+ public void setComments(List<Comment> comments) {
+ this.comments = comments;
+ }
+
+ /**
+ * Find a comment or sub-comment by its id.
+ *
+ * @param id
+ * the id to look for F
+ * @return this if it has the given id, or a child of this if the child have
+ * the given id, or NULL if not
+ */
+ public Comment getCommentById(String id) {
+ if (id != null && comments != null) {
+ for (Comment comment : comments) {
+ Comment found = comment.getById(id);
+ if (found != null) {
+ return found;
+ }
+ }
+ }
+
+ return null;
+ }
}
\ No newline at end of file