com.huaweicloud.sdk.iotda.v5.model.ListBatchTasksResponse Maven / Gradle / Ivy
package com.huaweicloud.sdk.iotda.v5.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huaweicloud.sdk.core.SdkResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.function.Consumer;
/**
* Response Object
*/
public class ListBatchTasksResponse extends SdkResponse {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "batchtasks")
private List batchtasks = null;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "page")
private Page page;
public ListBatchTasksResponse withBatchtasks(List batchtasks) {
this.batchtasks = batchtasks;
return this;
}
public ListBatchTasksResponse addBatchtasksItem(Task batchtasksItem) {
if (this.batchtasks == null) {
this.batchtasks = new ArrayList<>();
}
this.batchtasks.add(batchtasksItem);
return this;
}
public ListBatchTasksResponse withBatchtasks(Consumer> batchtasksSetter) {
if (this.batchtasks == null) {
this.batchtasks = new ArrayList<>();
}
batchtasksSetter.accept(this.batchtasks);
return this;
}
/**
* 批量任务列表。
* @return batchtasks
*/
public List getBatchtasks() {
return batchtasks;
}
public void setBatchtasks(List batchtasks) {
this.batchtasks = batchtasks;
}
public ListBatchTasksResponse withPage(Page page) {
this.page = page;
return this;
}
public ListBatchTasksResponse withPage(Consumer pageSetter) {
if (this.page == null) {
this.page = new Page();
pageSetter.accept(this.page);
}
return this;
}
/**
* Get page
* @return page
*/
public Page getPage() {
return page;
}
public void setPage(Page page) {
this.page = page;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
ListBatchTasksResponse that = (ListBatchTasksResponse) obj;
return Objects.equals(this.batchtasks, that.batchtasks) && Objects.equals(this.page, that.page);
}
@Override
public int hashCode() {
return Objects.hash(batchtasks, page);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ListBatchTasksResponse {\n");
sb.append(" batchtasks: ").append(toIndentedString(batchtasks)).append("\n");
sb.append(" page: ").append(toIndentedString(page)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}