}
}
}
private DoubanNoteEntryObj generateDoubanNoteEntry (String title, String content, boolean isPrivate, boolean canReply) {
DoubanNoteEntryObj entry = new DoubanNoteEntryObj();
if (title != null && title.length() > 0) {
entry.setTitle(title);
} else {
return null;
}
if (content != null && content.length() > 0) {
entry.setContent(content);
} else {
return null;
}
List<DoubanAttributeObj> atts = new ArrayList<DoubanAttributeObj>();
DoubanAttributeObj privateAtt = new DoubanAttributeObj();
privateAtt.setName("privacy");
if (isPrivate) {
privateAtt.setValue("private");
} else {
privateAtt.setValue("public");
}
atts.add(privateAtt);
DoubanAttributeObj replyAtt = new DoubanAttributeObj();
replyAtt.setName("can_reply");
replyAtt.setValue(canReply ? "yes" : "no");
atts.add(replyAtt);
entry.setAttributes(atts);
return entry;
}