From: David ‘Bombe’ Roden Date: Mon, 14 Oct 2013 04:38:50 +0000 (+0200) Subject: Let Sone and Album implement AlbumBuilderFactory. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=5a9585e9a43a35e675fb59a9d9135ff62efac21a;p=Sone.git Let Sone and Album implement AlbumBuilderFactory. --- diff --git a/src/main/java/net/pterodactylus/sone/data/Album.java b/src/main/java/net/pterodactylus/sone/data/Album.java index a173e19..7b245f9 100644 --- a/src/main/java/net/pterodactylus/sone/data/Album.java +++ b/src/main/java/net/pterodactylus/sone/data/Album.java @@ -26,7 +26,7 @@ import java.util.Comparator; import java.util.List; import javax.annotation.Nonnull; -import net.pterodactylus.sone.database.AlbumBuilder; +import net.pterodactylus.sone.database.AlbumBuilderFactory; import net.pterodactylus.sone.database.ImageBuilder; import com.google.common.base.Function; @@ -40,7 +40,7 @@ import com.google.common.collect.ImmutableList; * * @author David ‘Bombe’ Roden */ -public interface Album extends Identified, Fingerprintable { +public interface Album extends Identified, Fingerprintable, AlbumBuilderFactory { /** Compares two {@link Album}s by {@link #getTitle()}. */ Comparator TITLE_COMPARATOR = new Comparator() { @@ -167,8 +167,6 @@ public interface Album extends Identified, Fingerprintable { */ String getDescription(); - AlbumBuilder newAlbumBuilder() throws IllegalStateException; - ImageBuilder newImageBuilder() throws IllegalStateException; /** diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index 8180a73..67ecccb 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -29,6 +29,7 @@ import java.util.Set; import net.pterodactylus.sone.core.Options; import net.pterodactylus.sone.database.AlbumBuilder; +import net.pterodactylus.sone.database.AlbumBuilderFactory; import net.pterodactylus.sone.freenet.wot.Identity; import net.pterodactylus.sone.freenet.wot.OwnIdentity; import net.pterodactylus.sone.template.SoneAccessor; @@ -44,7 +45,7 @@ import com.google.common.primitives.Ints; * * @author David ‘Bombe’ Roden */ -public interface Sone extends Identified, Fingerprintable, Comparable { +public interface Sone extends Identified, Fingerprintable, AlbumBuilderFactory, Comparable { /** * Enumeration for the possible states of a {@link Sone}. @@ -547,6 +548,4 @@ public interface Sone extends Identified, Fingerprintable, Comparable { /* TODO - remove this method again, maybe add an option provider */ void setOptions(Options options); - AlbumBuilder newAlbumBuilder(); - }