-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update category - API support - Documented example * - Added builder methods to `CategoryUpdateParams` --------- Co-authored-by: Steve Chaloner <[email protected]>
- Loading branch information
Showing
4 changed files
with
143 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package seatsio.charts; | ||
|
||
import com.google.gson.JsonObject; | ||
|
||
import static seatsio.json.JsonObjectBuilder.aJsonObject; | ||
|
||
public class CategoryUpdateParams { | ||
|
||
private String label; | ||
private String color; | ||
private Boolean accessible; | ||
|
||
public CategoryUpdateParams() { | ||
} | ||
|
||
public CategoryUpdateParams(String label, | ||
String color, | ||
Boolean accessible) { | ||
this.label = label; | ||
this.color = color; | ||
this.accessible = accessible; | ||
} | ||
|
||
public CategoryUpdateParams withLabel(String label) { | ||
this.label = label; | ||
return this; | ||
} | ||
|
||
public CategoryUpdateParams withColor(String color) { | ||
this.color = color; | ||
return this; | ||
} | ||
|
||
public CategoryUpdateParams withAccessible(boolean accessible) { | ||
this.accessible = accessible; | ||
return this; | ||
} | ||
|
||
public JsonObject toJson() { | ||
return aJsonObject() | ||
.withPropertyIfNotNull("label", label) | ||
.withPropertyIfNotNull("color", color) | ||
.withPropertyIfNotNull("accessible", accessible) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters