Builder: Error
~ Error object rewrite for builder implementation
package com.wrapper.spotify.objects;
-public class Error {
+public class Error extends AbstractModelObject {
+ private final int status;
+ private final String message;
- private int status;
- private String message;
+ private Error(final Error.Builder builder) {
+ super(builder);
- public int getStatus() {
- return status;
+ this.status = builder.status;
+ this.message = builder.message;
}
- public void setStatus(int status) {
- this.status = status;
+ public int getStatus() {
+ return status;
}
public String getMessage() {
return message;
}
- public void setMessage(String message) {
+ @Override
+ public Builder builder() {
+ return new Builder();
+ }
+
+ public static final class Builder extends AbstractModelObject.Builder<Error.Builder> {
+ private int status;
+ private String message;
+
+ public Builder setStatus(int status) {
+ this.status = status;
+ return this;
+ }
+
+ public Builder setMessage(String message) {
this.message = message;
+ return this;
+ }
+
+ @Override
+ public Error build() {
+ return new Error(this);
+ }
}
}
