58 lines
1.3 KiB
Java
58 lines
1.3 KiB
Java
package it.unisannio.ding.ids.wedroid.wrapper.entity;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
public class ChecklistPrototype {
|
|
private String title;
|
|
private List<String> items;
|
|
|
|
private ChecklistPrototype(String title, List<String> items) {
|
|
this.title = title;
|
|
this.items = items;
|
|
}
|
|
|
|
public static class Builder {
|
|
private String title;
|
|
private List<String> items;
|
|
|
|
public Builder() {
|
|
items = new ArrayList<>();
|
|
}
|
|
|
|
/**
|
|
* Create a new ChecklistPrototype.
|
|
*
|
|
* @return The ChecklistPrototype
|
|
*/
|
|
public ChecklistPrototype build() {
|
|
return new ChecklistPrototype(
|
|
title,
|
|
items
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Set the title of the new checklist
|
|
*
|
|
* @param title The title of the new board
|
|
* @return The builder
|
|
*/
|
|
public Builder setTitle(String title) {
|
|
this.title = title;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Add a new checklist item to the checklist
|
|
*
|
|
* @param item The item to add to the checklist
|
|
* @return The builder
|
|
*/
|
|
public Builder addItems(String item) {
|
|
items.add(item);
|
|
return this;
|
|
}
|
|
}
|
|
}
|