From 1715ce9da612dd959781e5e62135600b2876fdbf Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 30 Nov 2017 18:56:04 +0100 Subject: [PATCH] Move album-related interfaces to kotlin source prefix --- .../pterodactylus/sone/database/AlbumBuilder.kt | 35 ---------------------- .../sone/database/AlbumBuilderFactory.kt | 27 ----------------- .../pterodactylus/sone/database/AlbumDatabase.kt | 24 --------------- .../pterodactylus/sone/database/AlbumProvider.kt | 31 ------------------- .../net/pterodactylus/sone/database/AlbumStore.kt | 30 ------------------- .../pterodactylus/sone/database/AlbumBuilder.kt | 35 ++++++++++++++++++++++ .../sone/database/AlbumBuilderFactory.kt | 27 +++++++++++++++++ .../pterodactylus/sone/database/AlbumDatabase.kt | 24 +++++++++++++++ .../pterodactylus/sone/database/AlbumProvider.kt | 31 +++++++++++++++++++ .../net/pterodactylus/sone/database/AlbumStore.kt | 30 +++++++++++++++++++ 10 files changed, 147 insertions(+), 147 deletions(-) delete mode 100644 src/main/java/net/pterodactylus/sone/database/AlbumBuilder.kt delete mode 100644 src/main/java/net/pterodactylus/sone/database/AlbumBuilderFactory.kt delete mode 100644 src/main/java/net/pterodactylus/sone/database/AlbumDatabase.kt delete mode 100644 src/main/java/net/pterodactylus/sone/database/AlbumProvider.kt delete mode 100644 src/main/java/net/pterodactylus/sone/database/AlbumStore.kt create mode 100644 src/main/kotlin/net/pterodactylus/sone/database/AlbumBuilder.kt create mode 100644 src/main/kotlin/net/pterodactylus/sone/database/AlbumBuilderFactory.kt create mode 100644 src/main/kotlin/net/pterodactylus/sone/database/AlbumDatabase.kt create mode 100644 src/main/kotlin/net/pterodactylus/sone/database/AlbumProvider.kt create mode 100644 src/main/kotlin/net/pterodactylus/sone/database/AlbumStore.kt diff --git a/src/main/java/net/pterodactylus/sone/database/AlbumBuilder.kt b/src/main/java/net/pterodactylus/sone/database/AlbumBuilder.kt deleted file mode 100644 index ed441e0..0000000 --- a/src/main/java/net/pterodactylus/sone/database/AlbumBuilder.kt +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Sone - AlbumBuilder.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 . - */ - -package net.pterodactylus.sone.database - -import net.pterodactylus.sone.data.Album -import net.pterodactylus.sone.data.Sone - -/** - * Builder for [Album] objects. - */ -interface AlbumBuilder { - - fun randomId(): AlbumBuilder - fun withId(id: String): AlbumBuilder - - fun by(sone: Sone): AlbumBuilder - - fun build(): Album - -} diff --git a/src/main/java/net/pterodactylus/sone/database/AlbumBuilderFactory.kt b/src/main/java/net/pterodactylus/sone/database/AlbumBuilderFactory.kt deleted file mode 100644 index 6f854db..0000000 --- a/src/main/java/net/pterodactylus/sone/database/AlbumBuilderFactory.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Sone - AlbumBuilderFactory.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 . - */ - -package net.pterodactylus.sone.database - -/** - * Factory for [AlbumBuilder]s. - */ -interface AlbumBuilderFactory { - - fun newAlbumBuilder(): AlbumBuilder - -} diff --git a/src/main/java/net/pterodactylus/sone/database/AlbumDatabase.kt b/src/main/java/net/pterodactylus/sone/database/AlbumDatabase.kt deleted file mode 100644 index 69daa21..0000000 --- a/src/main/java/net/pterodactylus/sone/database/AlbumDatabase.kt +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Sone - AlbumDatabase.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 . - */ - -package net.pterodactylus.sone.database - -/** - * Combines an [AlbumProvider] and an [AlbumStore] into an album - * database. - */ -interface AlbumDatabase : AlbumProvider, AlbumBuilderFactory, AlbumStore diff --git a/src/main/java/net/pterodactylus/sone/database/AlbumProvider.kt b/src/main/java/net/pterodactylus/sone/database/AlbumProvider.kt deleted file mode 100644 index c0b09e8..0000000 --- a/src/main/java/net/pterodactylus/sone/database/AlbumProvider.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Sone - AlbumProvider.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 . - */ - -package net.pterodactylus.sone.database - -import net.pterodactylus.sone.data.Album - -import com.google.common.base.Optional - -/** - * Interface for objects that can provide [Album]s by their ID. - */ -interface AlbumProvider { - - fun getAlbum(albumId: String): Album? - -} diff --git a/src/main/java/net/pterodactylus/sone/database/AlbumStore.kt b/src/main/java/net/pterodactylus/sone/database/AlbumStore.kt deleted file mode 100644 index e2a31c7..0000000 --- a/src/main/java/net/pterodactylus/sone/database/AlbumStore.kt +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Sone - AlbumStore.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 . - */ - -package net.pterodactylus.sone.database - -import net.pterodactylus.sone.data.Album - -/** - * Interface for a store of albums. - */ -interface AlbumStore { - - fun storeAlbum(album: Album) - fun removeAlbum(album: Album) - -} diff --git a/src/main/kotlin/net/pterodactylus/sone/database/AlbumBuilder.kt b/src/main/kotlin/net/pterodactylus/sone/database/AlbumBuilder.kt new file mode 100644 index 0000000..ed441e0 --- /dev/null +++ b/src/main/kotlin/net/pterodactylus/sone/database/AlbumBuilder.kt @@ -0,0 +1,35 @@ +/* + * Sone - AlbumBuilder.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 . + */ + +package net.pterodactylus.sone.database + +import net.pterodactylus.sone.data.Album +import net.pterodactylus.sone.data.Sone + +/** + * Builder for [Album] objects. + */ +interface AlbumBuilder { + + fun randomId(): AlbumBuilder + fun withId(id: String): AlbumBuilder + + fun by(sone: Sone): AlbumBuilder + + fun build(): Album + +} diff --git a/src/main/kotlin/net/pterodactylus/sone/database/AlbumBuilderFactory.kt b/src/main/kotlin/net/pterodactylus/sone/database/AlbumBuilderFactory.kt new file mode 100644 index 0000000..6f854db --- /dev/null +++ b/src/main/kotlin/net/pterodactylus/sone/database/AlbumBuilderFactory.kt @@ -0,0 +1,27 @@ +/* + * Sone - AlbumBuilderFactory.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 . + */ + +package net.pterodactylus.sone.database + +/** + * Factory for [AlbumBuilder]s. + */ +interface AlbumBuilderFactory { + + fun newAlbumBuilder(): AlbumBuilder + +} diff --git a/src/main/kotlin/net/pterodactylus/sone/database/AlbumDatabase.kt b/src/main/kotlin/net/pterodactylus/sone/database/AlbumDatabase.kt new file mode 100644 index 0000000..69daa21 --- /dev/null +++ b/src/main/kotlin/net/pterodactylus/sone/database/AlbumDatabase.kt @@ -0,0 +1,24 @@ +/* + * Sone - AlbumDatabase.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 . + */ + +package net.pterodactylus.sone.database + +/** + * Combines an [AlbumProvider] and an [AlbumStore] into an album + * database. + */ +interface AlbumDatabase : AlbumProvider, AlbumBuilderFactory, AlbumStore diff --git a/src/main/kotlin/net/pterodactylus/sone/database/AlbumProvider.kt b/src/main/kotlin/net/pterodactylus/sone/database/AlbumProvider.kt new file mode 100644 index 0000000..c0b09e8 --- /dev/null +++ b/src/main/kotlin/net/pterodactylus/sone/database/AlbumProvider.kt @@ -0,0 +1,31 @@ +/* + * Sone - AlbumProvider.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 . + */ + +package net.pterodactylus.sone.database + +import net.pterodactylus.sone.data.Album + +import com.google.common.base.Optional + +/** + * Interface for objects that can provide [Album]s by their ID. + */ +interface AlbumProvider { + + fun getAlbum(albumId: String): Album? + +} diff --git a/src/main/kotlin/net/pterodactylus/sone/database/AlbumStore.kt b/src/main/kotlin/net/pterodactylus/sone/database/AlbumStore.kt new file mode 100644 index 0000000..e2a31c7 --- /dev/null +++ b/src/main/kotlin/net/pterodactylus/sone/database/AlbumStore.kt @@ -0,0 +1,30 @@ +/* + * Sone - AlbumStore.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 . + */ + +package net.pterodactylus.sone.database + +import net.pterodactylus.sone.data.Album + +/** + * Interface for a store of albums. + */ +interface AlbumStore { + + fun storeAlbum(album: Album) + fun removeAlbum(album: Album) + +} -- 2.7.4