X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2Fimpl%2FAbstractImageBuilder.java;h=6ccd130efbed65f9ba50ce3f0dc4de2ebd58504a;hb=4e61d9d4c916ff7d314baa2923087203aec3842d;hp=0803084100a39eaa1288d1847dc1d9d052f523aa;hpb=37d40a97c65c078a03b71b98177be6551b3ea28a;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/data/impl/AbstractImageBuilder.java b/src/main/java/net/pterodactylus/sone/data/impl/AbstractImageBuilder.java index 0803084..6ccd130 100644 --- a/src/main/java/net/pterodactylus/sone/data/impl/AbstractImageBuilder.java +++ b/src/main/java/net/pterodactylus/sone/data/impl/AbstractImageBuilder.java @@ -16,12 +16,9 @@ */ package net.pterodactylus.sone.data.impl; -import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; import static java.util.UUID.randomUUID; -import net.pterodactylus.sone.data.Album; -import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.database.ImageBuilder; /** @@ -32,24 +29,17 @@ import net.pterodactylus.sone.database.ImageBuilder; */ public abstract class AbstractImageBuilder implements ImageBuilder { - protected final Album album; - /** Whether to create an album with a random ID. */ protected boolean randomId; /** The ID of the album to create. */ protected String id; - protected Sone sone; protected long creationTime; protected boolean createdNow; protected String key; protected int width; protected int height; - public AbstractImageBuilder(Album album) { - this.album = checkNotNull(album, "album must not be null"); - } - @Override public ImageBuilder randomId() { randomId = true; @@ -63,12 +53,6 @@ public abstract class AbstractImageBuilder implements ImageBuilder { } @Override - public ImageBuilder by(Sone sone) { - this.sone = sone; - return this; - } - - @Override public ImageBuilder created(long creationTime) { this.creationTime = creationTime; return this; @@ -113,7 +97,6 @@ public abstract class AbstractImageBuilder implements ImageBuilder { */ protected void validate() throws IllegalStateException { checkState((randomId && (id == null)) || (!randomId && (id != null)), "exactly one of random ID or custom ID must be set"); - checkState(sone != null, "sone must not be null"); checkState((createdNow && (creationTime == 0)) || (!createdNow && (creationTime > 0)), "exactly one of created now or creation time must be set"); checkState((width > 0) && (height > 0), "width and height must be set"); }