projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use a static import.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
database
/
PostBuilder.java
diff --git
a/src/main/java/net/pterodactylus/sone/database/PostBuilder.java
b/src/main/java/net/pterodactylus/sone/database/PostBuilder.java
index
0563fed
..
775378c
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/database/PostBuilder.java
+++ b/
src/main/java/net/pterodactylus/sone/database/PostBuilder.java
@@
-20,6
+20,8
@@
package net.pterodactylus.sone.database;
import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.Sone;
+import com.google.common.base.Optional;
+
/**
* Builder for {@link Post} objects.
* <p>
/**
* Builder for {@link Post} objects.
* <p>
@@
-43,14
+45,6
@@
import net.pterodactylus.sone.data.Sone;
public interface PostBuilder {
/**
public interface PostBuilder {
/**
- * Configures this builder to use a random ID for the new post. If this
- * method is used, {@link #withId(String)} must not be used.
- *
- * @return This post builder
- */
- public PostBuilder randomId();
-
- /**
* Configures this builder to use the given ID as ID for the new post. If
* this method is used, {@link #randomId()} must not be used.
*
* Configures this builder to use the given ID as ID for the new post. If
* this method is used, {@link #randomId()} must not be used.
*
@@
-61,14
+55,6
@@
public interface PostBuilder {
public PostBuilder withId(String id);
/**
public PostBuilder withId(String id);
/**
- * Configures this builder to use the current time when creating the post.
- * If this method is used, {@link #withTime(long)} must not be used.
- *
- * @return This post builder
- */
- public PostBuilder currentTime();
-
- /**
* Configures the builder to use the given time as time for the new post. If
* this method is used, {@link #currentTime()} must not be used.
*
* Configures the builder to use the given time as time for the new post. If
* this method is used, {@link #currentTime()} must not be used.
*
@@
-95,7
+81,7
@@
public interface PostBuilder {
* The ID of the recipient of the post
* @return This post builder
*/
* 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.
/**
* Verifies this builder’s configuration and creates a new post.
@@
-119,6
+105,12
@@
public interface PostBuilder {
* @throws IllegalStateException
* if this builder’s configuration is not valid
*/
* @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);
+
+ }
}
}