for (PostReply reply : sone.getReplies()) {
String replyPrefix = sonePrefix + "/Replies/" + replyCounter++;
configuration.getStringValue(replyPrefix + "/ID").setValue(reply.getId());
- configuration.getStringValue(replyPrefix + "/Post/ID").setValue(reply.getPost().getId());
+ configuration.getStringValue(replyPrefix + "/Post/ID").setValue(reply.getPostId());
configuration.getLongValue(replyPrefix + "/Time").setValue(reply.getTime());
configuration.getStringValue(replyPrefix + "/Text").setValue(reply.getText());
}
public interface PostReply extends Reply<PostReply> {
/**
+ * Returns the ID of the post this reply refers to.
+ *
+ * @return The ID of the post this reply refers to
+ */
+ public String getPostId();
+
+ /**
* Returns the post this reply refers to.
*
* @return The post this reply refers to
//
/**
+ * {@inheritDocs}
+ */
+ @Override
+ public String getPostId() {
+ return postId;
+ }
+
+ /**
* {@inheritDoc}
*/
@Override
if (!postReply.isPresent()) {
return null;
}
- return postReply.get().getPost().getId();
+ return postReply.get().getPostId();
}
/**
private JsonObject createJsonReply(FreenetRequest request, PostReply reply, Sone currentSone) {
JsonObject jsonReply = new JsonObject();
jsonReply.put("id", reply.getId());
- jsonReply.put("postId", reply.getPost().getId());
+ jsonReply.put("postId", reply.getPostId());
jsonReply.put("soneId", reply.getSone().getId());
jsonReply.put("time", reply.getTime());
StringWriter stringWriter = new StringWriter();
JsonObject jsonReply = new JsonObject();
jsonReply.put("id", reply.getId());
jsonReply.put("sone", reply.getSone().getId());
- jsonReply.put("post", reply.getPost().getId());
+ jsonReply.put("post", reply.getPostId());
jsonReply.put("postSone", reply.getPost().getSone().getId());
jsonReplies.add(jsonReply);
}