projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Extract default Image implementation as base for all future image implementations.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
data
/
impl
/
AbstractImageBuilder.java
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
1b9e3a8
..
209ef0f
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/data/impl/AbstractImageBuilder.java
+++ b/
src/main/java/net/pterodactylus/sone/data/impl/AbstractImageBuilder.java
@@
-16,8
+16,10
@@
*/
package net.pterodactylus.sone.data.impl;
*/
package net.pterodactylus.sone.data.impl;
+import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.base.Preconditions.checkState;
+import net.pterodactylus.sone.data.Album;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.database.ImageBuilder;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.database.ImageBuilder;
@@
-29,6
+31,8
@@
import net.pterodactylus.sone.database.ImageBuilder;
*/
public abstract class AbstractImageBuilder implements ImageBuilder {
*/
public abstract class AbstractImageBuilder implements ImageBuilder {
+ protected final Album album;
+
/** Whether to create an album with a random ID. */
protected boolean randomId;
/** Whether to create an album with a random ID. */
protected boolean randomId;
@@
-41,6
+45,10
@@
public abstract class AbstractImageBuilder implements ImageBuilder {
protected int width;
protected int height;
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;
@Override
public ImageBuilder randomId() {
randomId = true;