import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.Sone;
+import com.google.common.base.Optional;
+
/**
* Builder for {@link Post} objects.
* <p>
* The ID of the recipient of the post
* @return This post builder
*/
- public PostBuilder to(String recipientId);
+ public PostBuilder to(Optional<String> recipientId);
/**
* Verifies this builder’s configuration and creates a new post.
* @throws IllegalStateException
* if this builder’s configuration is not valid
*/
- public Post build() throws IllegalStateException;
+ public Post build(Optional<PostCreated> postCreated) throws IllegalStateException;
+
+ interface PostCreated {
+
+ void postCreated(Post post);
+
+ }
}