* {@inheritDoc}
*/
@Override
- public PostBuilder copyPost(Post post) {
- this.randomId = false;
- this.id = post.getId();
- this.currentTime = false;
- this.time = post.getTime();
- this.text = post.getText();
- this.recipientId = post.getRecipientId().orNull();
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public PostBuilder randomId() {
randomId = true;
return this;
public interface PostBuilder {
/**
- * Copies all attributes of the given post to this post builder.
- *
- * @param post
- * The post whose attributes to copy into this builder
- * @return This builder
- * @throws NullPointerException
- * if {@code post} is {@code null}
- */
- public PostBuilder copyPost(Post post) throws NullPointerException;
-
- /**
* Configures this builder to use a random ID for the new post. If this
* method is used, {@link #withId(String)} must not be used.
*