Builde: Recommendations
~ Recommendations object rewrite for builder implementation
@@ -2,24 +2,47 @@ package com.wrapper.spotify.objects;
import java.util.List;
-public class Recommendations {
+public class Recommendations extends AbstractModelObject {
+ private final RecommendationsSeed seeds;
+ private final List<TrackSimplified> tracks;
- private RecommendationsSeed seeds;
- private List<TrackSimplified> tracks;
+ private Recommendations(final Recommendations.Builder builder) {
+ super(builder);
- public RecommendationsSeed getSeeds() {
- return seeds;
+ this.seeds = builder.seeds;
+ this.tracks = builder.tracks;
}
- public void setSeeds(RecommendationsSeed seeds) {
- this.seeds = seeds;
+ public RecommendationsSeed getSeeds() {
+ return seeds;
}
public List<TrackSimplified> getTracks() {
return tracks;
}
- public void setTracks(List<TrackSimplified> tracks) {
+ @Override
+ public Builder builder() {
+ return new Builder();
+ }
+
+ public static final class Builder extends AbstractModelObject.Builder<Recommendations.Builder> {
+ private RecommendationsSeed seeds;
+ private List<TrackSimplified> tracks;
+
+ public Builder setSeeds(RecommendationsSeed seeds) {
+ this.seeds = seeds;
+ return this;
+ }
+
+ public Builder setTracks(List<TrackSimplified> tracks) {
this.tracks = tracks;
+ return this;
+ }
+
+ @Override
+ public Recommendations build() {
+ return new Recommendations(this);
+ }
}
}
