com.ksc.network.vpc.model.Route.DescribeRoutesRequest Maven / Gradle / Ivy
package com.ksc.network.vpc.model.Route;
import com.ksc.KscWebServiceRequest;
import com.ksc.Request;
import com.ksc.model.DryRunSupportedRequest;
import com.ksc.model.Filter;
import com.ksc.network.vpc.transform.Routes.DescribeRoutesRequestMarshaller;
import java.io.Serializable;
/**
*
* Contains the parameters for DescribeRoutes.
*
*/
public class DescribeRoutesRequest extends KscWebServiceRequest implements
Serializable, Cloneable, DryRunSupportedRequest {
/**
*
*/
private static final long serialVersionUID = 5962326358979008715L;
/**
*
* 一个或多个路由的ID
*
*
* Default: Describes all your VPCs.
*
*/
private com.ksc.internal.SdkInternalList routeIds;
private com.ksc.internal.SdkInternalList filters;
/**
*
* vpc-id,VPC的ID
*
*
* Default: Describes all your VPCs.
*
*
* @return One or more VPC IDs.
*
* Default: Describes all your VPCs.
*/
public java.util.List getRouteIds() {
if (routeIds == null) {
routeIds = new com.ksc.internal.SdkInternalList();
}
return routeIds;
}
public void setRouteIds(java.util.Collection routeIds) {
if (routeIds == null) {
this.routeIds = null;
return;
}
this.routeIds = new com.ksc.internal.SdkInternalList(routeIds);
}
public DescribeRoutesRequest withRouteIds(String... routeIds) {
if (this.routeIds == null) {
setRouteIds(new com.ksc.internal.SdkInternalList(
routeIds.length));
}
for (String ele : routeIds) {
this.routeIds.add(ele);
}
return this;
}
public DescribeRoutesRequest withRouteIds(java.util.Collection vpcIds) {
setRouteIds(routeIds);
return this;
}
public java.util.List getFilters() {
if (filters == null) {
filters = new com.ksc.internal.SdkInternalList();
}
return filters;
}
public void setFilters(java.util.Collection filters) {
if (filters == null) {
this.filters = null;
return;
}
this.filters = new com.ksc.internal.SdkInternalList(
filters);
}
public DescribeRoutesRequest withFilters(Filter... filters) {
if (this.filters == null) {
setFilters(new com.ksc.internal.SdkInternalList(
filters.length));
}
for (Filter ele : filters) {
this.filters.add(ele);
}
return this;
}
public DescribeRoutesRequest withFilters(java.util.Collection filters) {
setFilters(filters);
return this;
}
/**
* This method is intended for internal use only. Returns the marshaled
* request configured with additional parameters to enable operation
* dry-run.
*/
@Override
public Request getDryRunRequest() {
Request request = new DescribeRoutesRequestMarshaller()
.marshall(this);
request.addParameter("DryRun", Boolean.toString(true));
return request;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getRouteIds() != null)
sb.append("VpcIds: " + getRouteIds() + ",");
if (getFilters() != null)
sb.append("Filters: " + getFilters());
sb.append("}");
return sb.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((filters == null) ? 0 : filters.hashCode());
result = prime * result
+ ((routeIds == null) ? 0 : routeIds.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
DescribeRoutesRequest other = (DescribeRoutesRequest) obj;
if (filters == null) {
if (other.filters != null)
return false;
} else if (!filters.equals(other.filters))
return false;
if (routeIds == null) {
if (other.routeIds != null)
return false;
} else if (!routeIds.equals(other.routeIds))
return false;
return true;
}
@Override
public DescribeRoutesRequest clone() {
return (DescribeRoutesRequest) super.clone();
}
}