+++ /dev/null
-/*
- * Sone - PostReplyBuilder.java - Copyright © 2013–2016 David Roden
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package net.pterodactylus.sone.database;
-
-import net.pterodactylus.sone.data.PostReply;
-
-/**
- * Builder for a {@link PostReply} object.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
- */
-public interface PostReplyBuilder extends ReplyBuilder<PostReplyBuilder> {
-
- /**
- * Configures this builder to set the given post as post the created reply
- * refers to.
- *
- * @param postId
- * The ID of the post the reply refers to
- * @return This builder
- */
- public PostReplyBuilder to(String postId);
-
- /**
- * Verifies the configuration of this builder and creates a new post reply.
- * <p>
- * The following conditions must be met in order for the configuration to be
- * considered valid:
- * <ul>
- * <li>Exactly one of {@link #randomId()} or {@link #withId(String)} must
- * have been called.</li>
- * <li>The {@link #from(String) sender} must not be {@code null}.</li>
- * <li>Exactly one of {@link #currentTime()} or {@link #withTime(long)} must
- * have been called.</li>
- * <li>The {@link #withText(String) text} must not be {@code null} and must
- * contain something other than whitespace.</li>
- * <li>The {@link #to(String) post} have been set.</li>
- * </ul>
- *
- * @return The created post reply
- * @throws IllegalStateException
- * if this builder’s configuration is not valid
- */
- public PostReply build() throws IllegalStateException;
-
-}
+++ /dev/null
-/*
- * Sone - PostReplyBuilderFactory.java - Copyright © 2013–2016 David Roden
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package net.pterodactylus.sone.database;
-
-import net.pterodactylus.sone.database.memory.MemoryDatabase;
-
-import com.google.inject.ImplementedBy;
-
-/**
- * Factory for {@link PostReplyBuilder}s.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
- */
-@ImplementedBy(MemoryDatabase.class)
-public interface PostReplyBuilderFactory {
-
- /**
- * Creates a new post reply builder.
- *
- * @return A new post reply builder
- */
- public PostReplyBuilder newPostReplyBuilder();
-
-}
+++ /dev/null
-/*
- * Sone - PostReplyDatabase.java - Copyright © 2013–2016 David Roden
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package net.pterodactylus.sone.database;
-
-/**
- * Combines a {@link PostReplyProvider}, a {@link PostReplyBuilderFactory}, and
- * a {@link PostReplyStore} into a complete post reply database.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
- */
-public interface PostReplyDatabase extends PostReplyProvider, PostReplyBuilderFactory, PostReplyStore {
-
- /* nothing here. */
-
-}
+++ /dev/null
-/*
- * Sone - PostReplyProvider.java - Copyright © 2013–2016 David Roden
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package net.pterodactylus.sone.database;
-
-import java.util.List;
-
-import net.pterodactylus.sone.data.PostReply;
-
-import com.google.common.base.Optional;
-
-/**
- * Interface for objects that can provide {@link PostReply}s.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
- */
-public interface PostReplyProvider {
-
- /**
- * Returns the reply with the given ID.
- *
- * @param id
- * The ID of the reply to get
- * @return The reply, or {@code null} if there is no such reply
- */
- public Optional<PostReply> getPostReply(String id);
-
- /**
- * Returns all replies for the given post, order ascending by time.
- *
- * @param postId
- * The ID of the post to get all replies for
- * @return All replies for the given post
- */
- public List<PostReply> getReplies(String postId);
-
-}
+++ /dev/null
-/*
- * Sone - PostReplyStore.java - Copyright © 2013–2016 David Roden
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package net.pterodactylus.sone.database;
-
-import java.util.Collection;
-
-import net.pterodactylus.sone.data.PostReply;
-import net.pterodactylus.sone.data.Sone;
-
-/**
- * Defines a store for {@link PostReply post replies}.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
- */
-public interface PostReplyStore {
-
- /**
- * Stores the given post reply.
- *
- * @param postReply
- * The post reply
- */
- public void storePostReply(PostReply postReply);
-
- /**
- * Removes the given post reply from this store.
- *
- * @param postReply
- * The post reply to remove
- */
- public void removePostReply(PostReply postReply);
-
-}
+++ /dev/null
-/*
- * Sone - ReplyBuilder.java - Copyright © 2013–2016 David Roden
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package net.pterodactylus.sone.database;
-
-import net.pterodactylus.sone.data.Reply;
-import net.pterodactylus.sone.data.Sone;
-
-/**
- * Methods that all reply builders need to implement in order to be able to
- * create any kind of {@link Reply}.
- *
- * @param <B>
- * The type of the builder
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
- */
-public interface ReplyBuilder<B extends ReplyBuilder<B>> {
-
- /**
- * Configures this builder to use a random ID when creating the reply. If
- * this method is used, {@link #withId(String)} must not be used.
- *
- * @return This builder
- */
- public B randomId();
-
- /**
- * Configures this builder to use the given ID when creating the reply. If
- * this method is used, {@link #randomId()} must not be used.
- *
- * @param id
- * The ID of the reply
- * @return This builder
- */
- public B withId(String id);
-
- /**
- * Configures this builder to use the ID of the given {@link Sone} as sender
- * of the reply.
- *
- * @param senderId
- * The ID of the sender of the reply
- * @return This builder
- */
- public B from(String senderId);
-
- /**
- * Configures this builder to use the current time when creating the reply.
- * If this method is used, {@link #withTime(long)} must not be used.
- *
- * @return This builder
- */
- public B currentTime();
-
- /**
- * Configures this builder to use the given time when creating the reply. If
- * this method is used, {@link #currentTime()} must not be used.
- *
- * @param time
- * The time of the reply
- * @return This builder
- */
- public B withTime(long time);
-
- /**
- * Configures this builder to use the given text when creating the reply.
- *
- * @param text
- * The text of the reply
- * @return This builder
- */
- public B withText(String text);
-
-}
--- /dev/null
+/*
+ * Sone - PostReplyBuilder.java - Copyright © 2013–2016 David Roden
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.pterodactylus.sone.database
+
+import net.pterodactylus.sone.data.PostReply
+
+/**
+ * Builder for a [PostReply] object.
+ */
+interface PostReplyBuilder : ReplyBuilder<PostReplyBuilder> {
+
+ fun to(postId: String): PostReplyBuilder
+
+ /**
+ * Verifies the configuration of this builder and creates a new post reply.
+ *
+ * The following conditions must be met in order for the configuration to be
+ * considered valid:
+ *
+ * * Exactly one of [randomId] or [withId] must have been called.
+ * * The [sender][from] must not be `null`.
+ * * Exactly one of [currentTime] or [withTime] must have been called.
+ * * The [text][withText] must not be `null` and must contain something other than whitespace.
+ * * The [post][to] must have been set.
+ *
+ * @return The created post reply
+ * @throws IllegalStateException if this builder’s configuration is not valid
+ */
+ fun build(): PostReply
+
+}
--- /dev/null
+/*
+ * Sone - PostReplyBuilderFactory.java - Copyright © 2013–2016 David Roden
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.pterodactylus.sone.database
+
+import net.pterodactylus.sone.database.memory.MemoryDatabase
+
+import com.google.inject.ImplementedBy
+
+/**
+ * Factory for [PostReplyBuilder]s.
+ */
+@ImplementedBy(MemoryDatabase::class)
+interface PostReplyBuilderFactory {
+
+ fun newPostReplyBuilder(): PostReplyBuilder
+
+}
--- /dev/null
+/*
+ * Sone - PostReplyDatabase.java - Copyright © 2013–2016 David Roden
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.pterodactylus.sone.database
+
+/**
+ * Combines a [PostReplyProvider], a [PostReplyBuilderFactory], and
+ * a [PostReplyStore] into a complete post reply database.
+ */
+interface PostReplyDatabase : PostReplyProvider, PostReplyBuilderFactory, PostReplyStore
--- /dev/null
+/*
+ * Sone - PostReplyProvider.java - Copyright © 2013–2016 David Roden
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.pterodactylus.sone.database
+
+import com.google.common.base.Optional
+import net.pterodactylus.sone.data.PostReply
+
+/**
+ * Interface for objects that can provide [PostReply]s.
+ */
+interface PostReplyProvider {
+
+ fun getPostReply(id: String): Optional<PostReply>
+
+ /**
+ * Returns all replies for the given post, order ascending by time.
+ *
+ * @param postId The ID of the post to get all replies for
+ * @return All replies for the given post
+ */
+ fun getReplies(postId: String): List<PostReply>
+
+}
--- /dev/null
+/*
+ * Sone - PostReplyStore.java - Copyright © 2013–2016 David Roden
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.pterodactylus.sone.database
+
+import net.pterodactylus.sone.data.PostReply
+import net.pterodactylus.sone.data.Sone
+
+/**
+ * Defines a store for [post replies][PostReply].
+ */
+interface PostReplyStore {
+
+ fun storePostReply(postReply: PostReply)
+ fun removePostReply(postReply: PostReply)
+
+}
--- /dev/null
+/*
+ * Sone - ReplyBuilder.java - Copyright © 2013–2016 David Roden
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.pterodactylus.sone.database
+
+import net.pterodactylus.sone.data.Reply
+import net.pterodactylus.sone.data.Sone
+
+/**
+ * Methods that all reply builders need to implement in order to be able to
+ * create any kind of [Reply].
+ *
+ * @param B The type of the builder
+ */
+interface ReplyBuilder<B : ReplyBuilder<B>> {
+
+ fun randomId(): B
+ fun withId(id: String): B
+
+ fun from(senderId: String): B
+ fun currentTime(): B
+ fun withTime(time: Long): B
+ fun withText(text: String): B
+
+}