Java tutorial
/* * Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.elasticloadbalancing.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * <p> * Contains the parameters for DescribeLoadBalancers. * </p> * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancers" * target="_top">AWS API Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DescribeLoadBalancersRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * The names of the load balancers. * </p> */ private com.amazonaws.internal.SdkInternalList<String> loadBalancerNames; /** * <p> * The marker for the next set of results. (You received this marker from a previous call.) * </p> */ private String marker; /** * <p> * The maximum number of results to return with this call (a number from 1 to 400). The default is 400. * </p> */ private Integer pageSize; /** * Default constructor for DescribeLoadBalancersRequest object. Callers should use the setter or fluent setter * (with...) methods to initialize the object after creating it. */ public DescribeLoadBalancersRequest() { } /** * Constructs a new DescribeLoadBalancersRequest object. Callers should use the setter or fluent setter (with...) * methods to initialize any additional object members. * * @param loadBalancerNames * The names of the load balancers. */ public DescribeLoadBalancersRequest(java.util.List<String> loadBalancerNames) { setLoadBalancerNames(loadBalancerNames); } /** * <p> * The names of the load balancers. * </p> * * @return The names of the load balancers. */ public java.util.List<String> getLoadBalancerNames() { if (loadBalancerNames == null) { loadBalancerNames = new com.amazonaws.internal.SdkInternalList<String>(); } return loadBalancerNames; } /** * <p> * The names of the load balancers. * </p> * * @param loadBalancerNames * The names of the load balancers. */ public void setLoadBalancerNames(java.util.Collection<String> loadBalancerNames) { if (loadBalancerNames == null) { this.loadBalancerNames = null; return; } this.loadBalancerNames = new com.amazonaws.internal.SdkInternalList<String>(loadBalancerNames); } /** * <p> * The names of the load balancers. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setLoadBalancerNames(java.util.Collection)} or {@link #withLoadBalancerNames(java.util.Collection)} if * you want to override the existing values. * </p> * * @param loadBalancerNames * The names of the load balancers. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeLoadBalancersRequest withLoadBalancerNames(String... loadBalancerNames) { if (this.loadBalancerNames == null) { setLoadBalancerNames(new com.amazonaws.internal.SdkInternalList<String>(loadBalancerNames.length)); } for (String ele : loadBalancerNames) { this.loadBalancerNames.add(ele); } return this; } /** * <p> * The names of the load balancers. * </p> * * @param loadBalancerNames * The names of the load balancers. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeLoadBalancersRequest withLoadBalancerNames(java.util.Collection<String> loadBalancerNames) { setLoadBalancerNames(loadBalancerNames); return this; } /** * <p> * The marker for the next set of results. (You received this marker from a previous call.) * </p> * * @param marker * The marker for the next set of results. (You received this marker from a previous call.) */ public void setMarker(String marker) { this.marker = marker; } /** * <p> * The marker for the next set of results. (You received this marker from a previous call.) * </p> * * @return The marker for the next set of results. (You received this marker from a previous call.) */ public String getMarker() { return this.marker; } /** * <p> * The marker for the next set of results. (You received this marker from a previous call.) * </p> * * @param marker * The marker for the next set of results. (You received this marker from a previous call.) * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeLoadBalancersRequest withMarker(String marker) { setMarker(marker); return this; } /** * <p> * The maximum number of results to return with this call (a number from 1 to 400). The default is 400. * </p> * * @param pageSize * The maximum number of results to return with this call (a number from 1 to 400). The default is 400. */ public void setPageSize(Integer pageSize) { this.pageSize = pageSize; } /** * <p> * The maximum number of results to return with this call (a number from 1 to 400). The default is 400. * </p> * * @return The maximum number of results to return with this call (a number from 1 to 400). The default is 400. */ public Integer getPageSize() { return this.pageSize; } /** * <p> * The maximum number of results to return with this call (a number from 1 to 400). The default is 400. * </p> * * @param pageSize * The maximum number of results to return with this call (a number from 1 to 400). The default is 400. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeLoadBalancersRequest withPageSize(Integer pageSize) { setPageSize(pageSize); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getLoadBalancerNames() != null) sb.append("LoadBalancerNames: ").append(getLoadBalancerNames()).append(","); if (getMarker() != null) sb.append("Marker: ").append(getMarker()).append(","); if (getPageSize() != null) sb.append("PageSize: ").append(getPageSize()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeLoadBalancersRequest == false) return false; DescribeLoadBalancersRequest other = (DescribeLoadBalancersRequest) obj; if (other.getLoadBalancerNames() == null ^ this.getLoadBalancerNames() == null) return false; if (other.getLoadBalancerNames() != null && other.getLoadBalancerNames().equals(this.getLoadBalancerNames()) == false) return false; if (other.getMarker() == null ^ this.getMarker() == null) return false; if (other.getMarker() != null && other.getMarker().equals(this.getMarker()) == false) return false; if (other.getPageSize() == null ^ this.getPageSize() == null) return false; if (other.getPageSize() != null && other.getPageSize().equals(this.getPageSize()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLoadBalancerNames() == null) ? 0 : getLoadBalancerNames().hashCode()); hashCode = prime * hashCode + ((getMarker() == null) ? 0 : getMarker().hashCode()); hashCode = prime * hashCode + ((getPageSize() == null) ? 0 : getPageSize().hashCode()); return hashCode; } @Override public DescribeLoadBalancersRequest clone() { return (DescribeLoadBalancersRequest) super.clone(); } }