- /**
- * {@link PostBuilder} implementation that creates a {@link MemoryPost}.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
- */
- private class MemoryPostBuilder extends AbstractPostBuilder {
-
- /**
- * Creates a new memory post builder.
- *
- * @param soneProvider
- * The Sone provider
- */
- public MemoryPostBuilder(SoneProvider soneProvider) {
- super(soneProvider);
- }
-
- /**
- * {@inheritDocs}
- */
- @Override
- public Post build() throws IllegalStateException {
- validate();
- Post post = new MemoryPost(MemoryDatabase.this, soneProvider, randomId ? UUID.randomUUID().toString() : id, senderId, recipientId, currentTime ? System.currentTimeMillis() : time, text);
- post.setKnown(isPostKnown(post));
- return post;
- }
-
- }
-
- /**
- * {@link PostReplyBuilder} implementation that creates
- * {@link MemoryPostReply} objects.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
- */
- private class MemoryPostReplyBuilder extends AbstractPostReplyBuilder {
-
- /**
- * {@inheritDocs}
- */
- @Override
- public PostReply build() throws IllegalStateException {
- validate();
-
- PostReply postReply = new MemoryPostReply(MemoryDatabase.this, soneProvider, randomId ? UUID.randomUUID().toString() : id, senderId, currentTime ? System.currentTimeMillis() : time, text, postId);
- postReply.setKnown(isPostReplyKnown(postReply));
- return postReply;
- }
-
- }
-