import static com.google.common.base.Preconditions.checkState;
+import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.database.AlbumBuilder;
/**
/** The ID of the album to create. */
protected String id;
+ protected Sone sone;
@Override
public AlbumBuilder randomId() {
return this;
}
+ public AlbumBuilder by(Sone sone) {
+ this.sone = sone;
+ return this;
+ }
+
//
// PROTECTED METHODS
//
*/
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");
}
}