From: David ‘Bombe’ Roden Date: Sun, 13 Oct 2013 16:15:45 +0000 (+0200) Subject: Add Sone database interface. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=34a6a72ca76ae5e8ea3d02160b4163baa9912ceb;p=Sone.git Add Sone database interface. --- diff --git a/src/main/java/net/pterodactylus/sone/database/SoneBuilder.java b/src/main/java/net/pterodactylus/sone/database/SoneBuilder.java new file mode 100644 index 0000000..2aca8b9 --- /dev/null +++ b/src/main/java/net/pterodactylus/sone/database/SoneBuilder.java @@ -0,0 +1,35 @@ +/* + * Sone - SoneBuilder.java - Copyright © 2013 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.Sone; +import net.pterodactylus.sone.freenet.wot.Identity; + +/** + * Builder for {@link Sone} objects. + * + * @author David ‘Bombe’ Roden + */ +public interface SoneBuilder { + + SoneBuilder by(Identity identity); + SoneBuilder local(); + + Sone build() throws IllegalStateException; + +} diff --git a/src/main/java/net/pterodactylus/sone/database/SoneBuilderFactory.java b/src/main/java/net/pterodactylus/sone/database/SoneBuilderFactory.java new file mode 100644 index 0000000..672fdd8 --- /dev/null +++ b/src/main/java/net/pterodactylus/sone/database/SoneBuilderFactory.java @@ -0,0 +1,29 @@ +/* + * Sone - SoneBuilderFactory.java - Copyright © 2013 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 {@link SoneBuilder} objects. + * + * @author David ‘Bombe’ Roden + */ +public interface SoneBuilderFactory { + + SoneBuilder newSoneBuilder(); + +} diff --git a/src/main/java/net/pterodactylus/sone/database/SoneDatabase.java b/src/main/java/net/pterodactylus/sone/database/SoneDatabase.java new file mode 100644 index 0000000..825be32 --- /dev/null +++ b/src/main/java/net/pterodactylus/sone/database/SoneDatabase.java @@ -0,0 +1,28 @@ +/* + * Sone - SoneDatabase.java - Copyright © 2013 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 a {@link SoneProvider} and a {@link SoneBuilderFactory} into a Sone + * database. + * + * @author David ‘Bombe’ Roden + */ +public interface SoneDatabase extends SoneProvider, SoneBuilderFactory { + +}