package chat.module.friendcircle;
|
|
import chat.user.User;
|
import frame.object.data.ID;
|
import frame.util.MapList;
|
|
public class Comment {
|
|
private String id;
|
private User owner;
|
private int level;
|
private String content;
|
private CircleObject circleObject;
|
private Comment parent;
|
private MapList<Comment> subComentList;
|
|
|
public Comment(User owner) {
|
subComentList = new MapList<Comment>();
|
this.owner = owner;
|
}
|
|
public String addOneSubComment(User owner, String content) {
|
String id = ID.newValue();
|
|
Comment comment = new Comment(owner);
|
comment.setId(id);
|
comment.setLevel(2);
|
comment.setParent(parent);
|
comment.setContent(content);
|
|
subComentList.add(id, comment);
|
|
return id;
|
}
|
|
public void setId(String id) {
|
this.id = id;
|
}
|
|
public void setParent(Comment parent) {
|
this.parent = parent;
|
}
|
|
public void setLevel(int level) {
|
this.level = level;
|
}
|
|
public User getOwner() {
|
return owner;
|
}
|
|
public int getLevel() {
|
return level;
|
}
|
|
public String getContent() {
|
return content;
|
}
|
|
public CircleObject getCircleObject() {
|
return circleObject;
|
}
|
|
public Comment getParent() {
|
return parent;
|
}
|
|
public String getParentId() {
|
if (parent == null) {
|
return null;
|
}
|
|
return parent.getId();
|
}
|
|
public void setContent(String content) {
|
this.content = content;
|
}
|
|
public String getId() {
|
return id;
|
}
|
|
}
|