/* * Copyright 2018-2023 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; /** *

* A detailed view of a component. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Component implements Serializable, Cloneable, StructuredPojo { /** *

* The Amazon Resource Name (ARN) of the component. *

*/ private String arn; /** *

* The name of the component. *

*/ private String name; /** *

* The version of the component. *

*/ private String version; /** *

* The description of the component. *

*/ private String description; /** *

* The change description of the component. *

*/ private String changeDescription; /** *

* The component type specifies whether Image Builder uses the component to build the image or only to test it. *

*/ private String type; /** *

* The operating system platform of the component. *

*/ private String platform; /** *

* The operating system (OS) version supported by the component. If the OS information is available, Image Builder * performs a prefix match against the base image OS version during image recipe creation. *

*/ private java.util.List supportedOsVersions; /** *

* Describes the current status of the component. This is used for components that are no longer active. *

*/ private ComponentState state; /** *

* Contains parameter details for each of the parameters that the component document defined for the component. *

*/ private java.util.List parameters; /** *

* The owner of the component. *

*/ private String owner; /** *

* Component data contains the YAML document content for the component. *

*/ private String data; /** *

* The KMS key identifier used to encrypt the component. *

*/ private String kmsKeyId; /** *

* The encryption status of the component. *

*/ private Boolean encrypted; /** *

* The date that Image Builder created the component. *

*/ private String dateCreated; /** *

* The tags that apply to the component. *

*/ private java.util.Map tags; /** *

* Contains the name of the publisher if this is a third-party component. Otherwise, this property is empty. *

*/ private String publisher; /** *

* Indicates whether component source is hidden from view in the console, and from component detail results for API, * CLI, or SDK operations. *

*/ private Boolean obfuscate; /** *

* The Amazon Resource Name (ARN) of the component. *

* * @param arn * The Amazon Resource Name (ARN) of the component. */ public void setArn(String arn) { this.arn = arn; } /** *

* The Amazon Resource Name (ARN) of the component. *

* * @return The Amazon Resource Name (ARN) of the component. */ public String getArn() { return this.arn; } /** *

* The Amazon Resource Name (ARN) of the component. *

* * @param arn * The Amazon Resource Name (ARN) of the component. * @return Returns a reference to this object so that method calls can be chained together. */ public Component withArn(String arn) { setArn(arn); return this; } /** *

* The name of the component. *

* * @param name * The name of the component. */ public void setName(String name) { this.name = name; } /** *

* The name of the component. *

* * @return The name of the component. */ public String getName() { return this.name; } /** *

* The name of the component. *

* * @param name * The name of the component. * @return Returns a reference to this object so that method calls can be chained together. */ public Component withName(String name) { setName(name); return this; } /** *

* The version of the component. *

* * @param version * The version of the component. */ public void setVersion(String version) { this.version = version; } /** *

* The version of the component. *

* * @return The version of the component. */ public String getVersion() { return this.version; } /** *

* The version of the component. *

* * @param version * The version of the component. * @return Returns a reference to this object so that method calls can be chained together. */ public Component withVersion(String version) { setVersion(version); return this; } /** *

* The description of the component. *

* * @param description * The description of the component. */ public void setDescription(String description) { this.description = description; } /** *

* The description of the component. *

* * @return The description of the component. */ public String getDescription() { return this.description; } /** *

* The description of the component. *

* * @param description * The description of the component. * @return Returns a reference to this object so that method calls can be chained together. */ public Component withDescription(String description) { setDescription(description); return this; } /** *

* The change description of the component. *

* * @param changeDescription * The change description of the component. */ public void setChangeDescription(String changeDescription) { this.changeDescription = changeDescription; } /** *

* The change description of the component. *

* * @return The change description of the component. */ public String getChangeDescription() { return this.changeDescription; } /** *

* The change description of the component. *

* * @param changeDescription * The change description of the component. * @return Returns a reference to this object so that method calls can be chained together. */ public Component withChangeDescription(String changeDescription) { setChangeDescription(changeDescription); return this; } /** *

* The component type specifies whether Image Builder uses the component to build the image or only to test it. *

* * @param type * The component type specifies whether Image Builder uses the component to build the image or only to test * it. * @see ComponentType */ public void setType(String type) { this.type = type; } /** *

* The component type specifies whether Image Builder uses the component to build the image or only to test it. *

* * @return The component type specifies whether Image Builder uses the component to build the image or only to test * it. * @see ComponentType */ public String getType() { return this.type; } /** *

* The component type specifies whether Image Builder uses the component to build the image or only to test it. *

* * @param type * The component type specifies whether Image Builder uses the component to build the image or only to test * it. * @return Returns a reference to this object so that method calls can be chained together. * @see ComponentType */ public Component withType(String type) { setType(type); return this; } /** *

* The component type specifies whether Image Builder uses the component to build the image or only to test it. *

* * @param type * The component type specifies whether Image Builder uses the component to build the image or only to test * it. * @return Returns a reference to this object so that method calls can be chained together. * @see ComponentType */ public Component withType(ComponentType type) { this.type = type.toString(); return this; } /** *

* The operating system platform of the component. *

* * @param platform * The operating system platform of the component. * @see Platform */ public void setPlatform(String platform) { this.platform = platform; } /** *

* The operating system platform of the component. *

* * @return The operating system platform of the component. * @see Platform */ public String getPlatform() { return this.platform; } /** *

* The operating system platform of the component. *

* * @param platform * The operating system platform of the component. * @return Returns a reference to this object so that method calls can be chained together. * @see Platform */ public Component withPlatform(String platform) { setPlatform(platform); return this; } /** *

* The operating system platform of the component. *

* * @param platform * The operating system platform of the component. * @return Returns a reference to this object so that method calls can be chained together. * @see Platform */ public Component withPlatform(Platform platform) { this.platform = platform.toString(); return this; } /** *

* The operating system (OS) version supported by the component. If the OS information is available, Image Builder * performs a prefix match against the base image OS version during image recipe creation. *

* * @return The operating system (OS) version supported by the component. If the OS information is available, Image * Builder performs a prefix match against the base image OS version during image recipe creation. */ public java.util.List getSupportedOsVersions() { return supportedOsVersions; } /** *

* The operating system (OS) version supported by the component. If the OS information is available, Image Builder * performs a prefix match against the base image OS version during image recipe creation. *

* * @param supportedOsVersions * The operating system (OS) version supported by the component. If the OS information is available, Image * Builder performs a prefix match against the base image OS version during image recipe creation. */ public void setSupportedOsVersions(java.util.Collection supportedOsVersions) { if (supportedOsVersions == null) { this.supportedOsVersions = null; return; } this.supportedOsVersions = new java.util.ArrayList(supportedOsVersions); } /** *

* The operating system (OS) version supported by the component. If the OS information is available, Image Builder * performs a prefix match against the base image OS version during image recipe creation. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setSupportedOsVersions(java.util.Collection)} or {@link #withSupportedOsVersions(java.util.Collection)} * if you want to override the existing values. *

* * @param supportedOsVersions * The operating system (OS) version supported by the component. If the OS information is available, Image * Builder performs a prefix match against the base image OS version during image recipe creation. * @return Returns a reference to this object so that method calls can be chained together. */ public Component withSupportedOsVersions(String... supportedOsVersions) { if (this.supportedOsVersions == null) { setSupportedOsVersions(new java.util.ArrayList(supportedOsVersions.length)); } for (String ele : supportedOsVersions) { this.supportedOsVersions.add(ele); } return this; } /** *

* The operating system (OS) version supported by the component. If the OS information is available, Image Builder * performs a prefix match against the base image OS version during image recipe creation. *

* * @param supportedOsVersions * The operating system (OS) version supported by the component. If the OS information is available, Image * Builder performs a prefix match against the base image OS version during image recipe creation. * @return Returns a reference to this object so that method calls can be chained together. */ public Component withSupportedOsVersions(java.util.Collection supportedOsVersions) { setSupportedOsVersions(supportedOsVersions); return this; } /** *

* Describes the current status of the component. This is used for components that are no longer active. *

* * @param state * Describes the current status of the component. This is used for components that are no longer active. */ public void setState(ComponentState state) { this.state = state; } /** *

* Describes the current status of the component. This is used for components that are no longer active. *

* * @return Describes the current status of the component. This is used for components that are no longer active. */ public ComponentState getState() { return this.state; } /** *

* Describes the current status of the component. This is used for components that are no longer active. *

* * @param state * Describes the current status of the component. This is used for components that are no longer active. * @return Returns a reference to this object so that method calls can be chained together. */ public Component withState(ComponentState state) { setState(state); return this; } /** *

* Contains parameter details for each of the parameters that the component document defined for the component. *

* * @return Contains parameter details for each of the parameters that the component document defined for the * component. */ public java.util.List getParameters() { return parameters; } /** *

* Contains parameter details for each of the parameters that the component document defined for the component. *

* * @param parameters * Contains parameter details for each of the parameters that the component document defined for the * component. */ public void setParameters(java.util.Collection parameters) { if (parameters == null) { this.parameters = null; return; } this.parameters = new java.util.ArrayList(parameters); } /** *

* Contains parameter details for each of the parameters that the component document defined for the component. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setParameters(java.util.Collection)} or {@link #withParameters(java.util.Collection)} if you want to * override the existing values. *

* * @param parameters * Contains parameter details for each of the parameters that the component document defined for the * component. * @return Returns a reference to this object so that method calls can be chained together. */ public Component withParameters(ComponentParameterDetail... parameters) { if (this.parameters == null) { setParameters(new java.util.ArrayList(parameters.length)); } for (ComponentParameterDetail ele : parameters) { this.parameters.add(ele); } return this; } /** *

* Contains parameter details for each of the parameters that the component document defined for the component. *

* * @param parameters * Contains parameter details for each of the parameters that the component document defined for the * component. * @return Returns a reference to this object so that method calls can be chained together. */ public Component withParameters(java.util.Collection parameters) { setParameters(parameters); return this; } /** *

* The owner of the component. *

* * @param owner * The owner of the component. */ public void setOwner(String owner) { this.owner = owner; } /** *

* The owner of the component. *

* * @return The owner of the component. */ public String getOwner() { return this.owner; } /** *

* The owner of the component. *

* * @param owner * The owner of the component. * @return Returns a reference to this object so that method calls can be chained together. */ public Component withOwner(String owner) { setOwner(owner); return this; } /** *

* Component data contains the YAML document content for the component. *

* * @param data * Component data contains the YAML document content for the component. */ public void setData(String data) { this.data = data; } /** *

* Component data contains the YAML document content for the component. *

* * @return Component data contains the YAML document content for the component. */ public String getData() { return this.data; } /** *

* Component data contains the YAML document content for the component. *

* * @param data * Component data contains the YAML document content for the component. * @return Returns a reference to this object so that method calls can be chained together. */ public Component withData(String data) { setData(data); return this; } /** *

* The KMS key identifier used to encrypt the component. *

* * @param kmsKeyId * The KMS key identifier used to encrypt the component. */ public void setKmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; } /** *

* The KMS key identifier used to encrypt the component. *

* * @return The KMS key identifier used to encrypt the component. */ public String getKmsKeyId() { return this.kmsKeyId; } /** *

* The KMS key identifier used to encrypt the component. *

* * @param kmsKeyId * The KMS key identifier used to encrypt the component. * @return Returns a reference to this object so that method calls can be chained together. */ public Component withKmsKeyId(String kmsKeyId) { setKmsKeyId(kmsKeyId); return this; } /** *

* The encryption status of the component. *

* * @param encrypted * The encryption status of the component. */ public void setEncrypted(Boolean encrypted) { this.encrypted = encrypted; } /** *

* The encryption status of the component. *

* * @return The encryption status of the component. */ public Boolean getEncrypted() { return this.encrypted; } /** *

* The encryption status of the component. *

* * @param encrypted * The encryption status of the component. * @return Returns a reference to this object so that method calls can be chained together. */ public Component withEncrypted(Boolean encrypted) { setEncrypted(encrypted); return this; } /** *

* The encryption status of the component. *

* * @return The encryption status of the component. */ public Boolean isEncrypted() { return this.encrypted; } /** *

* The date that Image Builder created the component. *

* * @param dateCreated * The date that Image Builder created the component. */ public void setDateCreated(String dateCreated) { this.dateCreated = dateCreated; } /** *

* The date that Image Builder created the component. *

* * @return The date that Image Builder created the component. */ public String getDateCreated() { return this.dateCreated; } /** *

* The date that Image Builder created the component. *

* * @param dateCreated * The date that Image Builder created the component. * @return Returns a reference to this object so that method calls can be chained together. */ public Component withDateCreated(String dateCreated) { setDateCreated(dateCreated); return this; } /** *

* The tags that apply to the component. *

* * @return The tags that apply to the component. */ public java.util.Map getTags() { return tags; } /** *

* The tags that apply to the component. *

* * @param tags * The tags that apply to the component. */ public void setTags(java.util.Map tags) { this.tags = tags; } /** *

* The tags that apply to the component. *

* * @param tags * The tags that apply to the component. * @return Returns a reference to this object so that method calls can be chained together. */ public Component withTags(java.util.Map tags) { setTags(tags); return this; } /** * Add a single Tags entry * * @see Component#withTags * @returns a reference to this object so that method calls can be chained together. */ public Component addTagsEntry(String key, String value) { if (null == this.tags) { this.tags = new java.util.HashMap(); } if (this.tags.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.tags.put(key, value); return this; } /** * Removes all the entries added into Tags. * * @return Returns a reference to this object so that method calls can be chained together. */ public Component clearTagsEntries() { this.tags = null; return this; } /** *

* Contains the name of the publisher if this is a third-party component. Otherwise, this property is empty. *

* * @param publisher * Contains the name of the publisher if this is a third-party component. Otherwise, this property is empty. */ public void setPublisher(String publisher) { this.publisher = publisher; } /** *

* Contains the name of the publisher if this is a third-party component. Otherwise, this property is empty. *

* * @return Contains the name of the publisher if this is a third-party component. Otherwise, this property is empty. */ public String getPublisher() { return this.publisher; } /** *

* Contains the name of the publisher if this is a third-party component. Otherwise, this property is empty. *

* * @param publisher * Contains the name of the publisher if this is a third-party component. Otherwise, this property is empty. * @return Returns a reference to this object so that method calls can be chained together. */ public Component withPublisher(String publisher) { setPublisher(publisher); return this; } /** *

* Indicates whether component source is hidden from view in the console, and from component detail results for API, * CLI, or SDK operations. *

* * @param obfuscate * Indicates whether component source is hidden from view in the console, and from component detail results * for API, CLI, or SDK operations. */ public void setObfuscate(Boolean obfuscate) { this.obfuscate = obfuscate; } /** *

* Indicates whether component source is hidden from view in the console, and from component detail results for API, * CLI, or SDK operations. *

* * @return Indicates whether component source is hidden from view in the console, and from component detail results * for API, CLI, or SDK operations. */ public Boolean getObfuscate() { return this.obfuscate; } /** *

* Indicates whether component source is hidden from view in the console, and from component detail results for API, * CLI, or SDK operations. *

* * @param obfuscate * Indicates whether component source is hidden from view in the console, and from component detail results * for API, CLI, or SDK operations. * @return Returns a reference to this object so that method calls can be chained together. */ public Component withObfuscate(Boolean obfuscate) { setObfuscate(obfuscate); return this; } /** *

* Indicates whether component source is hidden from view in the console, and from component detail results for API, * CLI, or SDK operations. *

* * @return Indicates whether component source is hidden from view in the console, and from component detail results * for API, CLI, or SDK operations. */ public Boolean isObfuscate() { return this.obfuscate; } /** * 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 (getArn() != null) sb.append("Arn: ").append(getArn()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getVersion() != null) sb.append("Version: ").append(getVersion()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getChangeDescription() != null) sb.append("ChangeDescription: ").append(getChangeDescription()).append(","); if (getType() != null) sb.append("Type: ").append(getType()).append(","); if (getPlatform() != null) sb.append("Platform: ").append(getPlatform()).append(","); if (getSupportedOsVersions() != null) sb.append("SupportedOsVersions: ").append(getSupportedOsVersions()).append(","); if (getState() != null) sb.append("State: ").append(getState()).append(","); if (getParameters() != null) sb.append("Parameters: ").append(getParameters()).append(","); if (getOwner() != null) sb.append("Owner: ").append(getOwner()).append(","); if (getData() != null) sb.append("Data: ").append(getData()).append(","); if (getKmsKeyId() != null) sb.append("KmsKeyId: ").append(getKmsKeyId()).append(","); if (getEncrypted() != null) sb.append("Encrypted: ").append(getEncrypted()).append(","); if (getDateCreated() != null) sb.append("DateCreated: ").append(getDateCreated()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getPublisher() != null) sb.append("Publisher: ").append(getPublisher()).append(","); if (getObfuscate() != null) sb.append("Obfuscate: ").append(getObfuscate()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Component == false) return false; Component other = (Component) obj; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getVersion() == null ^ this.getVersion() == null) return false; if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getChangeDescription() == null ^ this.getChangeDescription() == null) return false; if (other.getChangeDescription() != null && other.getChangeDescription().equals(this.getChangeDescription()) == false) return false; if (other.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == false) return false; if (other.getPlatform() == null ^ this.getPlatform() == null) return false; if (other.getPlatform() != null && other.getPlatform().equals(this.getPlatform()) == false) return false; if (other.getSupportedOsVersions() == null ^ this.getSupportedOsVersions() == null) return false; if (other.getSupportedOsVersions() != null && other.getSupportedOsVersions().equals(this.getSupportedOsVersions()) == false) return false; if (other.getState() == null ^ this.getState() == null) return false; if (other.getState() != null && other.getState().equals(this.getState()) == false) return false; if (other.getParameters() == null ^ this.getParameters() == null) return false; if (other.getParameters() != null && other.getParameters().equals(this.getParameters()) == false) return false; if (other.getOwner() == null ^ this.getOwner() == null) return false; if (other.getOwner() != null && other.getOwner().equals(this.getOwner()) == false) return false; if (other.getData() == null ^ this.getData() == null) return false; if (other.getData() != null && other.getData().equals(this.getData()) == false) return false; if (other.getKmsKeyId() == null ^ this.getKmsKeyId() == null) return false; if (other.getKmsKeyId() != null && other.getKmsKeyId().equals(this.getKmsKeyId()) == false) return false; if (other.getEncrypted() == null ^ this.getEncrypted() == null) return false; if (other.getEncrypted() != null && other.getEncrypted().equals(this.getEncrypted()) == false) return false; if (other.getDateCreated() == null ^ this.getDateCreated() == null) return false; if (other.getDateCreated() != null && other.getDateCreated().equals(this.getDateCreated()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getPublisher() == null ^ this.getPublisher() == null) return false; if (other.getPublisher() != null && other.getPublisher().equals(this.getPublisher()) == false) return false; if (other.getObfuscate() == null ^ this.getObfuscate() == null) return false; if (other.getObfuscate() != null && other.getObfuscate().equals(this.getObfuscate()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getChangeDescription() == null) ? 0 : getChangeDescription().hashCode()); hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); hashCode = prime * hashCode + ((getPlatform() == null) ? 0 : getPlatform().hashCode()); hashCode = prime * hashCode + ((getSupportedOsVersions() == null) ? 0 : getSupportedOsVersions().hashCode()); hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); hashCode = prime * hashCode + ((getParameters() == null) ? 0 : getParameters().hashCode()); hashCode = prime * hashCode + ((getOwner() == null) ? 0 : getOwner().hashCode()); hashCode = prime * hashCode + ((getData() == null) ? 0 : getData().hashCode()); hashCode = prime * hashCode + ((getKmsKeyId() == null) ? 0 : getKmsKeyId().hashCode()); hashCode = prime * hashCode + ((getEncrypted() == null) ? 0 : getEncrypted().hashCode()); hashCode = prime * hashCode + ((getDateCreated() == null) ? 0 : getDateCreated().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getPublisher() == null) ? 0 : getPublisher().hashCode()); hashCode = prime * hashCode + ((getObfuscate() == null) ? 0 : getObfuscate().hashCode()); return hashCode; } @Override public Component clone() { try { return (Component) 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.ComponentMarshaller.getInstance().marshall(this, protocolMarshaller); } }