
com.amazonaws.services.imagebuilder.model.ContainerDistributionConfiguration Maven / Gradle / Ivy
/*
* 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.imagebuilder.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Container distribution settings for encryption, licensing, and sharing in a specific Region.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ContainerDistributionConfiguration implements Serializable, Cloneable, StructuredPojo {
/**
*
* The description of the container distribution configuration.
*
*/
private String description;
/**
*
* Tags that are attached to the container distribution configuration.
*
*/
private java.util.List containerTags;
/**
*
* The destination repository for the container distribution configuration.
*
*/
private TargetContainerRepository targetRepository;
/**
*
* The description of the container distribution configuration.
*
*
* @param description
* The description of the container distribution configuration.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* The description of the container distribution configuration.
*
*
* @return The description of the container distribution configuration.
*/
public String getDescription() {
return this.description;
}
/**
*
* The description of the container distribution configuration.
*
*
* @param description
* The description of the container distribution configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ContainerDistributionConfiguration withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* Tags that are attached to the container distribution configuration.
*
*
* @return Tags that are attached to the container distribution configuration.
*/
public java.util.List getContainerTags() {
return containerTags;
}
/**
*
* Tags that are attached to the container distribution configuration.
*
*
* @param containerTags
* Tags that are attached to the container distribution configuration.
*/
public void setContainerTags(java.util.Collection containerTags) {
if (containerTags == null) {
this.containerTags = null;
return;
}
this.containerTags = new java.util.ArrayList(containerTags);
}
/**
*
* Tags that are attached to the container distribution configuration.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setContainerTags(java.util.Collection)} or {@link #withContainerTags(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param containerTags
* Tags that are attached to the container distribution configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ContainerDistributionConfiguration withContainerTags(String... containerTags) {
if (this.containerTags == null) {
setContainerTags(new java.util.ArrayList(containerTags.length));
}
for (String ele : containerTags) {
this.containerTags.add(ele);
}
return this;
}
/**
*
* Tags that are attached to the container distribution configuration.
*
*
* @param containerTags
* Tags that are attached to the container distribution configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ContainerDistributionConfiguration withContainerTags(java.util.Collection containerTags) {
setContainerTags(containerTags);
return this;
}
/**
*
* The destination repository for the container distribution configuration.
*
*
* @param targetRepository
* The destination repository for the container distribution configuration.
*/
public void setTargetRepository(TargetContainerRepository targetRepository) {
this.targetRepository = targetRepository;
}
/**
*
* The destination repository for the container distribution configuration.
*
*
* @return The destination repository for the container distribution configuration.
*/
public TargetContainerRepository getTargetRepository() {
return this.targetRepository;
}
/**
*
* The destination repository for the container distribution configuration.
*
*
* @param targetRepository
* The destination repository for the container distribution configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ContainerDistributionConfiguration withTargetRepository(TargetContainerRepository targetRepository) {
setTargetRepository(targetRepository);
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 (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getContainerTags() != null)
sb.append("ContainerTags: ").append(getContainerTags()).append(",");
if (getTargetRepository() != null)
sb.append("TargetRepository: ").append(getTargetRepository());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ContainerDistributionConfiguration == false)
return false;
ContainerDistributionConfiguration other = (ContainerDistributionConfiguration) obj;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getContainerTags() == null ^ this.getContainerTags() == null)
return false;
if (other.getContainerTags() != null && other.getContainerTags().equals(this.getContainerTags()) == false)
return false;
if (other.getTargetRepository() == null ^ this.getTargetRepository() == null)
return false;
if (other.getTargetRepository() != null && other.getTargetRepository().equals(this.getTargetRepository()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getContainerTags() == null) ? 0 : getContainerTags().hashCode());
hashCode = prime * hashCode + ((getTargetRepository() == null) ? 0 : getTargetRepository().hashCode());
return hashCode;
}
@Override
public ContainerDistributionConfiguration clone() {
try {
return (ContainerDistributionConfiguration) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.imagebuilder.model.transform.ContainerDistributionConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}