![JAR search and dependency download from the Maven repository](/logo.png)
com.amazonaws.services.ec2.model.CreateManagedPrefixListRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* Copyright 2019-2024 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.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
import com.amazonaws.Request;
import com.amazonaws.services.ec2.model.transform.CreateManagedPrefixListRequestMarshaller;
/**
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateManagedPrefixListRequest extends AmazonWebServiceRequest implements Serializable, Cloneable,
DryRunSupportedRequest {
/**
*
* A name for the prefix list.
*
*
* Constraints: Up to 255 characters in length. The name cannot start with com.amazonaws
.
*
*/
private String prefixListName;
/**
*
* One or more entries for the prefix list.
*
*/
private com.amazonaws.internal.SdkInternalList entries;
/**
*
* The maximum number of entries for the prefix list.
*
*/
private Integer maxEntries;
/**
*
* The tags to apply to the prefix list during creation.
*
*/
private com.amazonaws.internal.SdkInternalList tagSpecifications;
/**
*
* The IP address type.
*
*
* Valid Values: IPv4
| IPv6
*
*/
private String addressFamily;
/**
*
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see
* Ensuring idempotency.
*
*
* Constraints: Up to 255 UTF-8 characters in length.
*
*/
private String clientToken;
/**
*
* A name for the prefix list.
*
*
* Constraints: Up to 255 characters in length. The name cannot start with com.amazonaws
.
*
*
* @param prefixListName
* A name for the prefix list.
*
* Constraints: Up to 255 characters in length. The name cannot start with com.amazonaws
.
*/
public void setPrefixListName(String prefixListName) {
this.prefixListName = prefixListName;
}
/**
*
* A name for the prefix list.
*
*
* Constraints: Up to 255 characters in length. The name cannot start with com.amazonaws
.
*
*
* @return A name for the prefix list.
*
* Constraints: Up to 255 characters in length. The name cannot start with com.amazonaws
.
*/
public String getPrefixListName() {
return this.prefixListName;
}
/**
*
* A name for the prefix list.
*
*
* Constraints: Up to 255 characters in length. The name cannot start with com.amazonaws
.
*
*
* @param prefixListName
* A name for the prefix list.
*
* Constraints: Up to 255 characters in length. The name cannot start with com.amazonaws
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateManagedPrefixListRequest withPrefixListName(String prefixListName) {
setPrefixListName(prefixListName);
return this;
}
/**
*
* One or more entries for the prefix list.
*
*
* @return One or more entries for the prefix list.
*/
public java.util.List getEntries() {
if (entries == null) {
entries = new com.amazonaws.internal.SdkInternalList();
}
return entries;
}
/**
*
* One or more entries for the prefix list.
*
*
* @param entries
* One or more entries for the prefix list.
*/
public void setEntries(java.util.Collection entries) {
if (entries == null) {
this.entries = null;
return;
}
this.entries = new com.amazonaws.internal.SdkInternalList(entries);
}
/**
*
* One or more entries for the prefix list.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setEntries(java.util.Collection)} or {@link #withEntries(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param entries
* One or more entries for the prefix list.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateManagedPrefixListRequest withEntries(AddPrefixListEntry... entries) {
if (this.entries == null) {
setEntries(new com.amazonaws.internal.SdkInternalList(entries.length));
}
for (AddPrefixListEntry ele : entries) {
this.entries.add(ele);
}
return this;
}
/**
*
* One or more entries for the prefix list.
*
*
* @param entries
* One or more entries for the prefix list.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateManagedPrefixListRequest withEntries(java.util.Collection entries) {
setEntries(entries);
return this;
}
/**
*
* The maximum number of entries for the prefix list.
*
*
* @param maxEntries
* The maximum number of entries for the prefix list.
*/
public void setMaxEntries(Integer maxEntries) {
this.maxEntries = maxEntries;
}
/**
*
* The maximum number of entries for the prefix list.
*
*
* @return The maximum number of entries for the prefix list.
*/
public Integer getMaxEntries() {
return this.maxEntries;
}
/**
*
* The maximum number of entries for the prefix list.
*
*
* @param maxEntries
* The maximum number of entries for the prefix list.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateManagedPrefixListRequest withMaxEntries(Integer maxEntries) {
setMaxEntries(maxEntries);
return this;
}
/**
*
* The tags to apply to the prefix list during creation.
*
*
* @return The tags to apply to the prefix list during creation.
*/
public java.util.List getTagSpecifications() {
if (tagSpecifications == null) {
tagSpecifications = new com.amazonaws.internal.SdkInternalList();
}
return tagSpecifications;
}
/**
*
* The tags to apply to the prefix list during creation.
*
*
* @param tagSpecifications
* The tags to apply to the prefix list during creation.
*/
public void setTagSpecifications(java.util.Collection tagSpecifications) {
if (tagSpecifications == null) {
this.tagSpecifications = null;
return;
}
this.tagSpecifications = new com.amazonaws.internal.SdkInternalList(tagSpecifications);
}
/**
*
* The tags to apply to the prefix list during creation.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTagSpecifications(java.util.Collection)} or {@link #withTagSpecifications(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param tagSpecifications
* The tags to apply to the prefix list during creation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateManagedPrefixListRequest withTagSpecifications(TagSpecification... tagSpecifications) {
if (this.tagSpecifications == null) {
setTagSpecifications(new com.amazonaws.internal.SdkInternalList(tagSpecifications.length));
}
for (TagSpecification ele : tagSpecifications) {
this.tagSpecifications.add(ele);
}
return this;
}
/**
*
* The tags to apply to the prefix list during creation.
*
*
* @param tagSpecifications
* The tags to apply to the prefix list during creation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateManagedPrefixListRequest withTagSpecifications(java.util.Collection tagSpecifications) {
setTagSpecifications(tagSpecifications);
return this;
}
/**
*
* The IP address type.
*
*
* Valid Values: IPv4
| IPv6
*
*
* @param addressFamily
* The IP address type.
*
* Valid Values: IPv4
| IPv6
*/
public void setAddressFamily(String addressFamily) {
this.addressFamily = addressFamily;
}
/**
*
* The IP address type.
*
*
* Valid Values: IPv4
| IPv6
*
*
* @return The IP address type.
*
* Valid Values: IPv4
| IPv6
*/
public String getAddressFamily() {
return this.addressFamily;
}
/**
*
* The IP address type.
*
*
* Valid Values: IPv4
| IPv6
*
*
* @param addressFamily
* The IP address type.
*
* Valid Values: IPv4
| IPv6
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateManagedPrefixListRequest withAddressFamily(String addressFamily) {
setAddressFamily(addressFamily);
return this;
}
/**
*
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see
* Ensuring idempotency.
*
*
* Constraints: Up to 255 UTF-8 characters in length.
*
*
* @param clientToken
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more
* information, see Ensuring
* idempotency.
*
* Constraints: Up to 255 UTF-8 characters in length.
*/
public void setClientToken(String clientToken) {
this.clientToken = clientToken;
}
/**
*
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see
* Ensuring idempotency.
*
*
* Constraints: Up to 255 UTF-8 characters in length.
*
*
* @return Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more
* information, see Ensuring
* idempotency.
*
* Constraints: Up to 255 UTF-8 characters in length.
*/
public String getClientToken() {
return this.clientToken;
}
/**
*
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see
* Ensuring idempotency.
*
*
* Constraints: Up to 255 UTF-8 characters in length.
*
*
* @param clientToken
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more
* information, see Ensuring
* idempotency.
*
* Constraints: Up to 255 UTF-8 characters in length.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateManagedPrefixListRequest withClientToken(String clientToken) {
setClientToken(clientToken);
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 CreateManagedPrefixListRequestMarshaller().marshall(this);
request.addParameter("DryRun", Boolean.toString(true));
return request;
}
/**
* 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 (getPrefixListName() != null)
sb.append("PrefixListName: ").append(getPrefixListName()).append(",");
if (getEntries() != null)
sb.append("Entries: ").append(getEntries()).append(",");
if (getMaxEntries() != null)
sb.append("MaxEntries: ").append(getMaxEntries()).append(",");
if (getTagSpecifications() != null)
sb.append("TagSpecifications: ").append(getTagSpecifications()).append(",");
if (getAddressFamily() != null)
sb.append("AddressFamily: ").append(getAddressFamily()).append(",");
if (getClientToken() != null)
sb.append("ClientToken: ").append(getClientToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateManagedPrefixListRequest == false)
return false;
CreateManagedPrefixListRequest other = (CreateManagedPrefixListRequest) obj;
if (other.getPrefixListName() == null ^ this.getPrefixListName() == null)
return false;
if (other.getPrefixListName() != null && other.getPrefixListName().equals(this.getPrefixListName()) == false)
return false;
if (other.getEntries() == null ^ this.getEntries() == null)
return false;
if (other.getEntries() != null && other.getEntries().equals(this.getEntries()) == false)
return false;
if (other.getMaxEntries() == null ^ this.getMaxEntries() == null)
return false;
if (other.getMaxEntries() != null && other.getMaxEntries().equals(this.getMaxEntries()) == false)
return false;
if (other.getTagSpecifications() == null ^ this.getTagSpecifications() == null)
return false;
if (other.getTagSpecifications() != null && other.getTagSpecifications().equals(this.getTagSpecifications()) == false)
return false;
if (other.getAddressFamily() == null ^ this.getAddressFamily() == null)
return false;
if (other.getAddressFamily() != null && other.getAddressFamily().equals(this.getAddressFamily()) == false)
return false;
if (other.getClientToken() == null ^ this.getClientToken() == null)
return false;
if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getPrefixListName() == null) ? 0 : getPrefixListName().hashCode());
hashCode = prime * hashCode + ((getEntries() == null) ? 0 : getEntries().hashCode());
hashCode = prime * hashCode + ((getMaxEntries() == null) ? 0 : getMaxEntries().hashCode());
hashCode = prime * hashCode + ((getTagSpecifications() == null) ? 0 : getTagSpecifications().hashCode());
hashCode = prime * hashCode + ((getAddressFamily() == null) ? 0 : getAddressFamily().hashCode());
hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode());
return hashCode;
}
@Override
public CreateManagedPrefixListRequest clone() {
return (CreateManagedPrefixListRequest) super.clone();
}
}