Testat Sammlung
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
1.7 KiB

package twitter;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
public class TweetObject {
private String id;
private String created_at;
private String text;
private String user;
private int wordCount;
private List<String> tags;
public TweetObject() {}
public TweetObject(String id, String created_at, String text) {
this.id = id;
this.created_at = created_at;
this.text = text;
this.tags = new LinkedList<>();
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCreated_at() {
return created_at;
}
public void setCreated_at(String created_at) {
this.created_at = created_at;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public int getWordCount() {return wordCount;}
public void setWordCount(int wordCount) {this.wordCount = wordCount;}
public List<String> getTags() {
return tags;
}
public void setTags(List<String> tags) {
this.tags.addAll(tags);
}
public void addTag(String tag) {this.tags.add(tag);}
@Override
public boolean equals(Object obj) {
if(obj == null) {return false;}
if(obj instanceof TweetObject) {
TweetObject that = (TweetObject) obj;
return this.id.equals(that.id);
}
return false;
}
@Override
public String toString() {
return id + ';' + created_at + ';' + text + ';' + user;
}
}