All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nulabinc.backlog4j.api.option.AddCheckBoxCustomFieldParams Maven / Gradle / Ivy

There is a newer version: 2.6.0
Show newest version
package com.nulabinc.backlog4j.api.option;

import com.nulabinc.backlog4j.BacklogAPIException;
import com.nulabinc.backlog4j.CustomFieldSetting;
import com.nulabinc.backlog4j.http.NameValuePair;

import java.util.List;

/**
 * Parameters for add checkbox type custom field API.
 *
 * @author nulab-inc
 */
public class AddCheckBoxCustomFieldParams extends AddCustomFieldParams {

    public AddCheckBoxCustomFieldParams(Object projectIdOrKey, String name) {
        super(projectIdOrKey, CustomFieldSetting.FieldType.CheckBox, name);
    }

    public AddCheckBoxCustomFieldParams items(List items) {
        for (String item : items) {
            parameters.add(new NameValuePair("items[]", item));
        }
        return this;
    }

    public AddCheckBoxCustomFieldParams allowInput(boolean allowInput) {
        parameters.add(new NameValuePair("allowInput", String.valueOf(allowInput)));
        return this;
    }

    public AddCheckBoxCustomFieldParams allowAddItem(boolean allowAddItem) {
        parameters.add(new NameValuePair("allowAddItem", String.valueOf(allowAddItem)));
        return this;
    }


    @Override
    public AddCheckBoxCustomFieldParams applicableIssueTypes(List applicableIssueTypes) {
        return (AddCheckBoxCustomFieldParams)super.applicableIssueTypes(applicableIssueTypes);
    }

    @Override
    public AddCheckBoxCustomFieldParams description(String description) {
        return (AddCheckBoxCustomFieldParams)super.description(description);
    }

    @Override
    public AddCheckBoxCustomFieldParams required(boolean required) {
        return (AddCheckBoxCustomFieldParams)super.required(required);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy