backlog4j.admin.api.UpdateProject Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of backlog4j Show documentation
Show all versions of backlog4j Show documentation
A Java library for Backlog API
package backlog4j.admin.api;
import backlog4j.BacklogAdminClient;
import backlog4j.BacklogException;
import backlog4j.admin.impl.ProjectEx;
import java.util.HashMap;
import java.util.Map;
/**
* @author eguchi
*/
public class UpdateProject implements BacklogAdminCommand {
private final BacklogAdminClient client;
protected final Map map = new HashMap();
public UpdateProject(BacklogAdminClient client) {
this.client = client;
}
public UpdateProject setId(Integer id) {
map.put(ID, id);
return this;
}
public Integer getId() {
return (Integer) map.get(ID);
}
public UpdateProject setName(String name) {
map.put(NAME, name);
return this;
}
public String getName() {
return (String) map.get(NAME);
}
public UpdateProject setKey(String key) {
map.put(KEY, key);
return this;
}
public String getKey() {
return (String) map.get(KEY);
}
public UpdateProject setUseChart(String key) {
map.put(USE_CHART, key);
return this;
}
public Boolean getUseChart() {
return (Boolean) map.get(USE_CHART);
}
public UpdateProject setArchived(Boolean archived) {
map.put(ARCHIVED, archived);
return this;
}
public Boolean getArchived() {
return (Boolean) map.get(ARCHIVED);
}
private void checkParameters() {
if (getId() == null) {
throw new BacklogException("id is required");
}
}
@Override
public ProjectEx execute() {
checkParameters();
Object res = client.execute(BACKLOG_ADMIN_UPDATE_PROJECT, map);
return new ProjectEx((Map) res);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy