Return an optional from the Core already.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / Core.java
index e550652..48afb36 100644 (file)
@@ -1950,8 +1950,8 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
                touchConfiguration();
        }
 
-       public PostCreated postCreated() {
-               return new PostCreated() {
+       public Optional<PostCreated> postCreated() {
+               return Optional.<PostCreated>of(new PostCreated() {
                        @Override
                        public void postCreated(final Post post) {
                                if (post.isKnown()) {
@@ -1967,7 +1967,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
                                        }, 10, TimeUnit.SECONDS);
                                }
                        }
-               };
+               });
        }
 
 }