/* * 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; /** *
* The defining characteristics of a specific version of an Amazon Web Services TOE component. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ComponentVersion implements Serializable, Cloneable, StructuredPojo { /** ** The Amazon Resource Name (ARN) of the component. *
** Semantic versioning is included in each object's Amazon Resource Name (ARN), at the level that applies to that * object as follows: *
** Versionless ARNs and Name ARNs do not include specific values in any of the nodes. The nodes are either left off * entirely, or they are specified as wildcards, for example: x.x.x. *
** Version ARNs have only the first three nodes: <major>.<minor>.<patch> *
** Build version ARNs have all four nodes, and point to a specific build for a specific version of an object. *
** The name of the component. *
*/ private String name; /** ** The semantic version of the component. *
** The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can assign * values for the first three, and can filter on all of them. *
** Assignment: For the first three nodes you can assign any positive integer value, including zero, with an * upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the * fourth node. *
** Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes that * you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as * 2021.01.01. *
** Filtering: With semantic versioning, you have the flexibility to use wildcards (x) to specify the most * recent versions or nodes when selecting the base image or components for your recipe. When you use a wildcard in * any node, all nodes to the right of the first wildcard must also be wildcards. *
** The description of the component. *
*/ private String description; /** ** The platform of the component. *
*/ private String platform; /** ** he operating system (OS) version supported by the component. If the OS information is available, a prefix match * is performed against the base image OS version during image recipe creation. *
*/ private java.util.List* The type of the component denotes whether the component is used to build the image or only to test it. *
*/ private String type; /** ** The owner of the component. *
*/ private String owner; /** ** The date that the component was created. *
*/ private String dateCreated; /** ** The Amazon Resource Name (ARN) of the component. *
** Semantic versioning is included in each object's Amazon Resource Name (ARN), at the level that applies to that * object as follows: *
** Versionless ARNs and Name ARNs do not include specific values in any of the nodes. The nodes are either left off * entirely, or they are specified as wildcards, for example: x.x.x. *
** Version ARNs have only the first three nodes: <major>.<minor>.<patch> *
** Build version ARNs have all four nodes, and point to a specific build for a specific version of an object. *
** Semantic versioning is included in each object's Amazon Resource Name (ARN), at the level that applies to * that object as follows: *
** Versionless ARNs and Name ARNs do not include specific values in any of the nodes. The nodes are either * left off entirely, or they are specified as wildcards, for example: x.x.x. *
** Version ARNs have only the first three nodes: <major>.<minor>.<patch> *
** Build version ARNs have all four nodes, and point to a specific build for a specific version of an object. *
** The Amazon Resource Name (ARN) of the component. *
** Semantic versioning is included in each object's Amazon Resource Name (ARN), at the level that applies to that * object as follows: *
** Versionless ARNs and Name ARNs do not include specific values in any of the nodes. The nodes are either left off * entirely, or they are specified as wildcards, for example: x.x.x. *
** Version ARNs have only the first three nodes: <major>.<minor>.<patch> *
** Build version ARNs have all four nodes, and point to a specific build for a specific version of an object. *
** Semantic versioning is included in each object's Amazon Resource Name (ARN), at the level that applies to * that object as follows: *
** Versionless ARNs and Name ARNs do not include specific values in any of the nodes. The nodes are either * left off entirely, or they are specified as wildcards, for example: x.x.x. *
** Version ARNs have only the first three nodes: <major>.<minor>.<patch> *
** Build version ARNs have all four nodes, and point to a specific build for a specific version of an * object. *
** The Amazon Resource Name (ARN) of the component. *
** Semantic versioning is included in each object's Amazon Resource Name (ARN), at the level that applies to that * object as follows: *
** Versionless ARNs and Name ARNs do not include specific values in any of the nodes. The nodes are either left off * entirely, or they are specified as wildcards, for example: x.x.x. *
** Version ARNs have only the first three nodes: <major>.<minor>.<patch> *
** Build version ARNs have all four nodes, and point to a specific build for a specific version of an object. *
** Semantic versioning is included in each object's Amazon Resource Name (ARN), at the level that applies to * that object as follows: *
** Versionless ARNs and Name ARNs do not include specific values in any of the nodes. The nodes are either * left off entirely, or they are specified as wildcards, for example: x.x.x. *
** Version ARNs have only the first three nodes: <major>.<minor>.<patch> *
** Build version ARNs have all four nodes, and point to a specific build for a specific version of an object. *
** 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 ComponentVersion withName(String name) { setName(name); return this; } /** ** The semantic version of the component. *
** The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can assign * values for the first three, and can filter on all of them. *
** Assignment: For the first three nodes you can assign any positive integer value, including zero, with an * upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the * fourth node. *
** Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes that * you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as * 2021.01.01. *
** Filtering: With semantic versioning, you have the flexibility to use wildcards (x) to specify the most * recent versions or nodes when selecting the base image or components for your recipe. When you use a wildcard in * any node, all nodes to the right of the first wildcard must also be wildcards. *
** The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can * assign values for the first three, and can filter on all of them. *
** Assignment: For the first three nodes you can assign any positive integer value, including zero, * with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build * number to the fourth node. *
** Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes * that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, * such as 2021.01.01. *
** Filtering: With semantic versioning, you have the flexibility to use wildcards (x) to specify the * most recent versions or nodes when selecting the base image or components for your recipe. When you use a * wildcard in any node, all nodes to the right of the first wildcard must also be wildcards. *
*/ public void setVersion(String version) { this.version = version; } /** ** The semantic version of the component. *
** The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can assign * values for the first three, and can filter on all of them. *
** Assignment: For the first three nodes you can assign any positive integer value, including zero, with an * upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the * fourth node. *
** Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes that * you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as * 2021.01.01. *
** Filtering: With semantic versioning, you have the flexibility to use wildcards (x) to specify the most * recent versions or nodes when selecting the base image or components for your recipe. When you use a wildcard in * any node, all nodes to the right of the first wildcard must also be wildcards. *
** The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can * assign values for the first three, and can filter on all of them. *
** Assignment: For the first three nodes you can assign any positive integer value, including zero, * with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build * number to the fourth node. *
** Patterns: You can use any numeric pattern that adheres to the assignment requirements for the * nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a * date, such as 2021.01.01. *
** Filtering: With semantic versioning, you have the flexibility to use wildcards (x) to specify the * most recent versions or nodes when selecting the base image or components for your recipe. When you use a * wildcard in any node, all nodes to the right of the first wildcard must also be wildcards. *
*/ public String getVersion() { return this.version; } /** ** The semantic version of the component. *
** The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can assign * values for the first three, and can filter on all of them. *
** Assignment: For the first three nodes you can assign any positive integer value, including zero, with an * upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the * fourth node. *
** Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes that * you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as * 2021.01.01. *
** Filtering: With semantic versioning, you have the flexibility to use wildcards (x) to specify the most * recent versions or nodes when selecting the base image or components for your recipe. When you use a wildcard in * any node, all nodes to the right of the first wildcard must also be wildcards. *
** The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can * assign values for the first three, and can filter on all of them. *
** Assignment: For the first three nodes you can assign any positive integer value, including zero, * with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build * number to the fourth node. *
** Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes * that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, * such as 2021.01.01. *
** Filtering: With semantic versioning, you have the flexibility to use wildcards (x) to specify the * most recent versions or nodes when selecting the base image or components for your recipe. When you use a * wildcard in any node, all nodes to the right of the first wildcard must also be wildcards. *
* @return Returns a reference to this object so that method calls can be chained together. */ public ComponentVersion 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 ComponentVersion withDescription(String description) { setDescription(description); return this; } /** ** The platform of the component. *
* * @param platform * The platform of the component. * @see Platform */ public void setPlatform(String platform) { this.platform = platform; } /** ** The platform of the component. *
* * @return The platform of the component. * @see Platform */ public String getPlatform() { return this.platform; } /** ** The platform of the component. *
* * @param platform * The platform of the component. * @return Returns a reference to this object so that method calls can be chained together. * @see Platform */ public ComponentVersion withPlatform(String platform) { setPlatform(platform); return this; } /** ** The platform of the component. *
* * @param platform * The platform of the component. * @return Returns a reference to this object so that method calls can be chained together. * @see Platform */ public ComponentVersion withPlatform(Platform platform) { this.platform = platform.toString(); return this; } /** ** he operating system (OS) version supported by the component. If the OS information is available, a prefix match * is performed against the base image OS version during image recipe creation. *
* * @return he operating system (OS) version supported by the component. If the OS information is available, a prefix * match is performed against the base image OS version during image recipe creation. */ public java.util.List* he operating system (OS) version supported by the component. If the OS information is available, a prefix match * is performed against the base image OS version during image recipe creation. *
* * @param supportedOsVersions * he operating system (OS) version supported by the component. If the OS information is available, a prefix * match is performed against the base image OS version during image recipe creation. */ public void setSupportedOsVersions(java.util.Collection* he operating system (OS) version supported by the component. If the OS information is available, a prefix match * is performed 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 * he operating system (OS) version supported by the component. If the OS information is available, a prefix * match is performed 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 ComponentVersion withSupportedOsVersions(String... supportedOsVersions) { if (this.supportedOsVersions == null) { setSupportedOsVersions(new java.util.ArrayList* he operating system (OS) version supported by the component. If the OS information is available, a prefix match * is performed against the base image OS version during image recipe creation. *
* * @param supportedOsVersions * he operating system (OS) version supported by the component. If the OS information is available, a prefix * match is performed 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 ComponentVersion withSupportedOsVersions(java.util.Collection* The type of the component denotes whether the component is used to build the image or only to test it. *
* * @param type * The type of the component denotes whether the component is used to build the image or only to test it. * @see ComponentType */ public void setType(String type) { this.type = type; } /** ** The type of the component denotes whether the component is used to build the image or only to test it. *
* * @return The type of the component denotes whether the component is used to build the image or only to test it. * @see ComponentType */ public String getType() { return this.type; } /** ** The type of the component denotes whether the component is used to build the image or only to test it. *
* * @param type * The type of the component denotes whether the component is used 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 ComponentVersion withType(String type) { setType(type); return this; } /** ** The type of the component denotes whether the component is used to build the image or only to test it. *
* * @param type * The type of the component denotes whether the component is used 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 ComponentVersion withType(ComponentType type) { this.type = type.toString(); 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 ComponentVersion withOwner(String owner) { setOwner(owner); return this; } /** ** The date that the component was created. *
* * @param dateCreated * The date that the component was created. */ public void setDateCreated(String dateCreated) { this.dateCreated = dateCreated; } /** ** The date that the component was created. *
* * @return The date that the component was created. */ public String getDateCreated() { return this.dateCreated; } /** ** The date that the component was created. *
* * @param dateCreated * The date that the component was created. * @return Returns a reference to this object so that method calls can be chained together. */ public ComponentVersion withDateCreated(String dateCreated) { setDateCreated(dateCreated); 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 (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 (getPlatform() != null) sb.append("Platform: ").append(getPlatform()).append(","); if (getSupportedOsVersions() != null) sb.append("SupportedOsVersions: ").append(getSupportedOsVersions()).append(","); if (getType() != null) sb.append("Type: ").append(getType()).append(","); if (getOwner() != null) sb.append("Owner: ").append(getOwner()).append(","); if (getDateCreated() != null) sb.append("DateCreated: ").append(getDateCreated()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ComponentVersion == false) return false; ComponentVersion other = (ComponentVersion) 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.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.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == 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.getDateCreated() == null ^ this.getDateCreated() == null) return false; if (other.getDateCreated() != null && other.getDateCreated().equals(this.getDateCreated()) == 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 + ((getPlatform() == null) ? 0 : getPlatform().hashCode()); hashCode = prime * hashCode + ((getSupportedOsVersions() == null) ? 0 : getSupportedOsVersions().hashCode()); hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); hashCode = prime * hashCode + ((getOwner() == null) ? 0 : getOwner().hashCode()); hashCode = prime * hashCode + ((getDateCreated() == null) ? 0 : getDateCreated().hashCode()); return hashCode; } @Override public ComponentVersion clone() { try { return (ComponentVersion) 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.ComponentVersionMarshaller.getInstance().marshall(this, protocolMarshaller); } }