Builder: Category
~ Category object rewrite for builder implementation
@@ -2,43 +2,71 @@ package com.wrapper.spotify.objects;
import java.util.List;
-public class Category {
+public class Category extends AbstractModelObject {
+ private final String href;
+ private final List<Image> icons;
+ private final String id;
+ private final String name;
- private String href;
- private List<Image> icons;
- private String id;
- private String name;
+ private Category(final Category.Builder builder) {
+ super(builder);
- public String getHref() {
- return href;
+ this.href = builder.href;
+ this.icons = builder.icons;
+ this.id = builder.id;
+ this.name = builder.name;
}
- public void setHref(String href) {
- this.href = href;
+ public String getHref() {
+ return href;
}
public List<Image> getIcons() {
return icons;
}
- public void setIcons(List<Image> icons) {
- this.icons = icons;
- }
-
public String getId() {
return id;
}
- public void setId(String id) {
- this.id = id;
- }
-
public String getName() {
return name;
}
- public void setName(String name) {
+ @Override
+ public Builder builder() {
+ return new Builder();
+ }
+
+ public static final class Builder extends AbstractModelObject.Builder<ArtistSimplified.Builder> {
+ private String href;
+ private List<Image> icons;
+ private String id;
+ private String name;
+
+ public Builder setHref(String href) {
+ this.href = href;
+ return this;
+ }
+
+ public Builder setIcons(List<Image> icons) {
+ this.icons = icons;
+ return this;
+ }
+
+ public Builder setId(String id) {
+ this.id = id;
+ return this;
+ }
+
+ public Builder setName(String name) {
this.name = name;
+ return this;
}
+ @Override
+ public Category build() {
+ return new Category(this);
+ }
+ }
}
