com.amazonaws.services.cloudformation.model.ResourceIdentifierSummary Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudformation 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.cloudformation.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Describes the target resources of a specific type in your import template (for example, all
* AWS::S3::Bucket
resources) and the properties you can provide during the import to identify resources of
* that type.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ResourceIdentifierSummary implements Serializable, Cloneable {
/**
*
* The template resource type of the target resources, such as AWS::S3::Bucket
.
*
*/
private String resourceType;
/**
*
* The logical IDs of the target resources of the specified ResourceType
, as defined in the import
* template.
*
*/
private com.amazonaws.internal.SdkInternalList logicalResourceIds;
/**
*
* The resource properties you can provide during the import to identify your target resources. For example,
* BucketName
is a possible identifier property for AWS::S3::Bucket
resources.
*
*/
private com.amazonaws.internal.SdkInternalList resourceIdentifiers;
/**
*
* The template resource type of the target resources, such as AWS::S3::Bucket
.
*
*
* @param resourceType
* The template resource type of the target resources, such as AWS::S3::Bucket
.
*/
public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
/**
*
* The template resource type of the target resources, such as AWS::S3::Bucket
.
*
*
* @return The template resource type of the target resources, such as AWS::S3::Bucket
.
*/
public String getResourceType() {
return this.resourceType;
}
/**
*
* The template resource type of the target resources, such as AWS::S3::Bucket
.
*
*
* @param resourceType
* The template resource type of the target resources, such as AWS::S3::Bucket
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceIdentifierSummary withResourceType(String resourceType) {
setResourceType(resourceType);
return this;
}
/**
*
* The logical IDs of the target resources of the specified ResourceType
, as defined in the import
* template.
*
*
* @return The logical IDs of the target resources of the specified ResourceType
, as defined in the
* import template.
*/
public java.util.List getLogicalResourceIds() {
if (logicalResourceIds == null) {
logicalResourceIds = new com.amazonaws.internal.SdkInternalList();
}
return logicalResourceIds;
}
/**
*
* The logical IDs of the target resources of the specified ResourceType
, as defined in the import
* template.
*
*
* @param logicalResourceIds
* The logical IDs of the target resources of the specified ResourceType
, as defined in the
* import template.
*/
public void setLogicalResourceIds(java.util.Collection logicalResourceIds) {
if (logicalResourceIds == null) {
this.logicalResourceIds = null;
return;
}
this.logicalResourceIds = new com.amazonaws.internal.SdkInternalList(logicalResourceIds);
}
/**
*
* The logical IDs of the target resources of the specified ResourceType
, as defined in the import
* template.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setLogicalResourceIds(java.util.Collection)} or {@link #withLogicalResourceIds(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param logicalResourceIds
* The logical IDs of the target resources of the specified ResourceType
, as defined in the
* import template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceIdentifierSummary withLogicalResourceIds(String... logicalResourceIds) {
if (this.logicalResourceIds == null) {
setLogicalResourceIds(new com.amazonaws.internal.SdkInternalList(logicalResourceIds.length));
}
for (String ele : logicalResourceIds) {
this.logicalResourceIds.add(ele);
}
return this;
}
/**
*
* The logical IDs of the target resources of the specified ResourceType
, as defined in the import
* template.
*
*
* @param logicalResourceIds
* The logical IDs of the target resources of the specified ResourceType
, as defined in the
* import template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceIdentifierSummary withLogicalResourceIds(java.util.Collection logicalResourceIds) {
setLogicalResourceIds(logicalResourceIds);
return this;
}
/**
*
* The resource properties you can provide during the import to identify your target resources. For example,
* BucketName
is a possible identifier property for AWS::S3::Bucket
resources.
*
*
* @return The resource properties you can provide during the import to identify your target resources. For example,
* BucketName
is a possible identifier property for AWS::S3::Bucket
resources.
*/
public java.util.List getResourceIdentifiers() {
if (resourceIdentifiers == null) {
resourceIdentifiers = new com.amazonaws.internal.SdkInternalList();
}
return resourceIdentifiers;
}
/**
*
* The resource properties you can provide during the import to identify your target resources. For example,
* BucketName
is a possible identifier property for AWS::S3::Bucket
resources.
*
*
* @param resourceIdentifiers
* The resource properties you can provide during the import to identify your target resources. For example,
* BucketName
is a possible identifier property for AWS::S3::Bucket
resources.
*/
public void setResourceIdentifiers(java.util.Collection resourceIdentifiers) {
if (resourceIdentifiers == null) {
this.resourceIdentifiers = null;
return;
}
this.resourceIdentifiers = new com.amazonaws.internal.SdkInternalList(resourceIdentifiers);
}
/**
*
* The resource properties you can provide during the import to identify your target resources. For example,
* BucketName
is a possible identifier property for AWS::S3::Bucket
resources.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setResourceIdentifiers(java.util.Collection)} or {@link #withResourceIdentifiers(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param resourceIdentifiers
* The resource properties you can provide during the import to identify your target resources. For example,
* BucketName
is a possible identifier property for AWS::S3::Bucket
resources.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceIdentifierSummary withResourceIdentifiers(String... resourceIdentifiers) {
if (this.resourceIdentifiers == null) {
setResourceIdentifiers(new com.amazonaws.internal.SdkInternalList(resourceIdentifiers.length));
}
for (String ele : resourceIdentifiers) {
this.resourceIdentifiers.add(ele);
}
return this;
}
/**
*
* The resource properties you can provide during the import to identify your target resources. For example,
* BucketName
is a possible identifier property for AWS::S3::Bucket
resources.
*
*
* @param resourceIdentifiers
* The resource properties you can provide during the import to identify your target resources. For example,
* BucketName
is a possible identifier property for AWS::S3::Bucket
resources.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceIdentifierSummary withResourceIdentifiers(java.util.Collection resourceIdentifiers) {
setResourceIdentifiers(resourceIdentifiers);
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 (getResourceType() != null)
sb.append("ResourceType: ").append(getResourceType()).append(",");
if (getLogicalResourceIds() != null)
sb.append("LogicalResourceIds: ").append(getLogicalResourceIds()).append(",");
if (getResourceIdentifiers() != null)
sb.append("ResourceIdentifiers: ").append(getResourceIdentifiers());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ResourceIdentifierSummary == false)
return false;
ResourceIdentifierSummary other = (ResourceIdentifierSummary) obj;
if (other.getResourceType() == null ^ this.getResourceType() == null)
return false;
if (other.getResourceType() != null && other.getResourceType().equals(this.getResourceType()) == false)
return false;
if (other.getLogicalResourceIds() == null ^ this.getLogicalResourceIds() == null)
return false;
if (other.getLogicalResourceIds() != null && other.getLogicalResourceIds().equals(this.getLogicalResourceIds()) == false)
return false;
if (other.getResourceIdentifiers() == null ^ this.getResourceIdentifiers() == null)
return false;
if (other.getResourceIdentifiers() != null && other.getResourceIdentifiers().equals(this.getResourceIdentifiers()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getResourceType() == null) ? 0 : getResourceType().hashCode());
hashCode = prime * hashCode + ((getLogicalResourceIds() == null) ? 0 : getLogicalResourceIds().hashCode());
hashCode = prime * hashCode + ((getResourceIdentifiers() == null) ? 0 : getResourceIdentifiers().hashCode());
return hashCode;
}
@Override
public ResourceIdentifierSummary clone() {
try {
return (ResourceIdentifierSummary) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}