/* * 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.codeartifact.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Details about a package version. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class PackageVersionDescription implements Serializable, Cloneable, StructuredPojo { /** ** The format of the package version. *
*/ private String format; /** ** The namespace of the package version. The package version component that specifies its namespace depends on its * type. For example: *
*
* The namespace of a Maven package version is its groupId
.
*
* The namespace of an npm package version is its scope
.
*
* Python and NuGet package versions do not contain a corresponding component, package versions of those formats do * not have a namespace. *
*
* The namespace of a generic package is its namespace
.
*
* The name of the requested package. *
*/ private String packageName; /** *
* The name of the package that is displayed. The displayName
varies depending on the package version's
* format. For example, if an npm package is named ui
, is in the namespace vue
, and has
* the format npm
, then the displayName
is @vue/ui
.
*
* The version of the package. *
*/ private String version; /** ** A summary of the package version. The summary is extracted from the package. The information in and detail level * of the summary depends on the package version's format. *
*/ private String summary; /** ** The homepage associated with the package. *
*/ private String homePage; /** ** The repository for the source code in the package version, or the source code used to build it. *
*/ private String sourceCodeRepository; /** ** A timestamp that contains the date and time the package version was published. *
*/ private java.util.Date publishedTime; /** ** Information about licenses associated with the package version. *
*/ private java.util.List* The revision of the package version. *
*/ private String revision; /** ** A string that contains the status of the package version. *
*/ private String status; /** ** A * PackageVersionOrigin object that contains information about how the package version was added to the * repository. *
*/ private PackageVersionOrigin origin; /** ** The format of the package version. *
* * @param format * The format of the package version. * @see PackageFormat */ public void setFormat(String format) { this.format = format; } /** ** The format of the package version. *
* * @return The format of the package version. * @see PackageFormat */ public String getFormat() { return this.format; } /** ** The format of the package version. *
* * @param format * The format of the package version. * @return Returns a reference to this object so that method calls can be chained together. * @see PackageFormat */ public PackageVersionDescription withFormat(String format) { setFormat(format); return this; } /** ** The format of the package version. *
* * @param format * The format of the package version. * @return Returns a reference to this object so that method calls can be chained together. * @see PackageFormat */ public PackageVersionDescription withFormat(PackageFormat format) { this.format = format.toString(); return this; } /** ** The namespace of the package version. The package version component that specifies its namespace depends on its * type. For example: *
*
* The namespace of a Maven package version is its groupId
.
*
* The namespace of an npm package version is its scope
.
*
* Python and NuGet package versions do not contain a corresponding component, package versions of those formats do * not have a namespace. *
*
* The namespace of a generic package is its namespace
.
*
* The namespace of a Maven package version is its groupId
.
*
* The namespace of an npm package version is its scope
.
*
* Python and NuGet package versions do not contain a corresponding component, package versions of those * formats do not have a namespace. *
*
* The namespace of a generic package is its namespace
.
*
* The namespace of the package version. The package version component that specifies its namespace depends on its * type. For example: *
*
* The namespace of a Maven package version is its groupId
.
*
* The namespace of an npm package version is its scope
.
*
* Python and NuGet package versions do not contain a corresponding component, package versions of those formats do * not have a namespace. *
*
* The namespace of a generic package is its namespace
.
*
* The namespace of a Maven package version is its groupId
.
*
* The namespace of an npm package version is its scope
.
*
* Python and NuGet package versions do not contain a corresponding component, package versions of those * formats do not have a namespace. *
*
* The namespace of a generic package is its namespace
.
*
* The namespace of the package version. The package version component that specifies its namespace depends on its * type. For example: *
*
* The namespace of a Maven package version is its groupId
.
*
* The namespace of an npm package version is its scope
.
*
* Python and NuGet package versions do not contain a corresponding component, package versions of those formats do * not have a namespace. *
*
* The namespace of a generic package is its namespace
.
*
* The namespace of a Maven package version is its groupId
.
*
* The namespace of an npm package version is its scope
.
*
* Python and NuGet package versions do not contain a corresponding component, package versions of those * formats do not have a namespace. *
*
* The namespace of a generic package is its namespace
.
*
* The name of the requested package. *
* * @param packageName * The name of the requested package. */ public void setPackageName(String packageName) { this.packageName = packageName; } /** ** The name of the requested package. *
* * @return The name of the requested package. */ public String getPackageName() { return this.packageName; } /** ** The name of the requested package. *
* * @param packageName * The name of the requested package. * @return Returns a reference to this object so that method calls can be chained together. */ public PackageVersionDescription withPackageName(String packageName) { setPackageName(packageName); return this; } /** *
* The name of the package that is displayed. The displayName
varies depending on the package version's
* format. For example, if an npm package is named ui
, is in the namespace vue
, and has
* the format npm
, then the displayName
is @vue/ui
.
*
displayName
varies depending on the package
* version's format. For example, if an npm package is named ui
, is in the namespace
* vue
, and has the format npm
, then the displayName
is
* @vue/ui
.
*/
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
/**
*
* The name of the package that is displayed. The displayName
varies depending on the package version's
* format. For example, if an npm package is named ui
, is in the namespace vue
, and has
* the format npm
, then the displayName
is @vue/ui
.
*
displayName
varies depending on the package
* version's format. For example, if an npm package is named ui
, is in the namespace
* vue
, and has the format npm
, then the displayName
is
* @vue/ui
.
*/
public String getDisplayName() {
return this.displayName;
}
/**
*
* The name of the package that is displayed. The displayName
varies depending on the package version's
* format. For example, if an npm package is named ui
, is in the namespace vue
, and has
* the format npm
, then the displayName
is @vue/ui
.
*
displayName
varies depending on the package
* version's format. For example, if an npm package is named ui
, is in the namespace
* vue
, and has the format npm
, then the displayName
is
* @vue/ui
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PackageVersionDescription withDisplayName(String displayName) {
setDisplayName(displayName);
return this;
}
/**
* * The version of the package. *
* * @param version * The version of the package. */ public void setVersion(String version) { this.version = version; } /** ** The version of the package. *
* * @return The version of the package. */ public String getVersion() { return this.version; } /** ** The version of the package. *
* * @param version * The version of the package. * @return Returns a reference to this object so that method calls can be chained together. */ public PackageVersionDescription withVersion(String version) { setVersion(version); return this; } /** ** A summary of the package version. The summary is extracted from the package. The information in and detail level * of the summary depends on the package version's format. *
* * @param summary * A summary of the package version. The summary is extracted from the package. The information in and detail * level of the summary depends on the package version's format. */ public void setSummary(String summary) { this.summary = summary; } /** ** A summary of the package version. The summary is extracted from the package. The information in and detail level * of the summary depends on the package version's format. *
* * @return A summary of the package version. The summary is extracted from the package. The information in and * detail level of the summary depends on the package version's format. */ public String getSummary() { return this.summary; } /** ** A summary of the package version. The summary is extracted from the package. The information in and detail level * of the summary depends on the package version's format. *
* * @param summary * A summary of the package version. The summary is extracted from the package. The information in and detail * level of the summary depends on the package version's format. * @return Returns a reference to this object so that method calls can be chained together. */ public PackageVersionDescription withSummary(String summary) { setSummary(summary); return this; } /** ** The homepage associated with the package. *
* * @param homePage * The homepage associated with the package. */ public void setHomePage(String homePage) { this.homePage = homePage; } /** ** The homepage associated with the package. *
* * @return The homepage associated with the package. */ public String getHomePage() { return this.homePage; } /** ** The homepage associated with the package. *
* * @param homePage * The homepage associated with the package. * @return Returns a reference to this object so that method calls can be chained together. */ public PackageVersionDescription withHomePage(String homePage) { setHomePage(homePage); return this; } /** ** The repository for the source code in the package version, or the source code used to build it. *
* * @param sourceCodeRepository * The repository for the source code in the package version, or the source code used to build it. */ public void setSourceCodeRepository(String sourceCodeRepository) { this.sourceCodeRepository = sourceCodeRepository; } /** ** The repository for the source code in the package version, or the source code used to build it. *
* * @return The repository for the source code in the package version, or the source code used to build it. */ public String getSourceCodeRepository() { return this.sourceCodeRepository; } /** ** The repository for the source code in the package version, or the source code used to build it. *
* * @param sourceCodeRepository * The repository for the source code in the package version, or the source code used to build it. * @return Returns a reference to this object so that method calls can be chained together. */ public PackageVersionDescription withSourceCodeRepository(String sourceCodeRepository) { setSourceCodeRepository(sourceCodeRepository); return this; } /** ** A timestamp that contains the date and time the package version was published. *
* * @param publishedTime * A timestamp that contains the date and time the package version was published. */ public void setPublishedTime(java.util.Date publishedTime) { this.publishedTime = publishedTime; } /** ** A timestamp that contains the date and time the package version was published. *
* * @return A timestamp that contains the date and time the package version was published. */ public java.util.Date getPublishedTime() { return this.publishedTime; } /** ** A timestamp that contains the date and time the package version was published. *
* * @param publishedTime * A timestamp that contains the date and time the package version was published. * @return Returns a reference to this object so that method calls can be chained together. */ public PackageVersionDescription withPublishedTime(java.util.Date publishedTime) { setPublishedTime(publishedTime); return this; } /** ** Information about licenses associated with the package version. *
* * @return Information about licenses associated with the package version. */ public java.util.List* Information about licenses associated with the package version. *
* * @param licenses * Information about licenses associated with the package version. */ public void setLicenses(java.util.Collection* Information about licenses associated with the package version. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setLicenses(java.util.Collection)} or {@link #withLicenses(java.util.Collection)} if you want to override * the existing values. *
* * @param licenses * Information about licenses associated with the package version. * @return Returns a reference to this object so that method calls can be chained together. */ public PackageVersionDescription withLicenses(LicenseInfo... licenses) { if (this.licenses == null) { setLicenses(new java.util.ArrayList* Information about licenses associated with the package version. *
* * @param licenses * Information about licenses associated with the package version. * @return Returns a reference to this object so that method calls can be chained together. */ public PackageVersionDescription withLicenses(java.util.Collection* The revision of the package version. *
* * @param revision * The revision of the package version. */ public void setRevision(String revision) { this.revision = revision; } /** ** The revision of the package version. *
* * @return The revision of the package version. */ public String getRevision() { return this.revision; } /** ** The revision of the package version. *
* * @param revision * The revision of the package version. * @return Returns a reference to this object so that method calls can be chained together. */ public PackageVersionDescription withRevision(String revision) { setRevision(revision); return this; } /** ** A string that contains the status of the package version. *
* * @param status * A string that contains the status of the package version. * @see PackageVersionStatus */ public void setStatus(String status) { this.status = status; } /** ** A string that contains the status of the package version. *
* * @return A string that contains the status of the package version. * @see PackageVersionStatus */ public String getStatus() { return this.status; } /** ** A string that contains the status of the package version. *
* * @param status * A string that contains the status of the package version. * @return Returns a reference to this object so that method calls can be chained together. * @see PackageVersionStatus */ public PackageVersionDescription withStatus(String status) { setStatus(status); return this; } /** ** A string that contains the status of the package version. *
* * @param status * A string that contains the status of the package version. * @return Returns a reference to this object so that method calls can be chained together. * @see PackageVersionStatus */ public PackageVersionDescription withStatus(PackageVersionStatus status) { this.status = status.toString(); return this; } /** ** A * PackageVersionOrigin object that contains information about how the package version was added to the * repository. *
* * @param origin * A * PackageVersionOrigin object that contains information about how the package version was added to the * repository. */ public void setOrigin(PackageVersionOrigin origin) { this.origin = origin; } /** ** A * PackageVersionOrigin object that contains information about how the package version was added to the * repository. *
* * @return A * PackageVersionOrigin object that contains information about how the package version was added to the * repository. */ public PackageVersionOrigin getOrigin() { return this.origin; } /** ** A * PackageVersionOrigin object that contains information about how the package version was added to the * repository. *
* * @param origin * A * PackageVersionOrigin object that contains information about how the package version was added to the * repository. * @return Returns a reference to this object so that method calls can be chained together. */ public PackageVersionDescription withOrigin(PackageVersionOrigin origin) { setOrigin(origin); 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 (getFormat() != null) sb.append("Format: ").append(getFormat()).append(","); if (getNamespace() != null) sb.append("Namespace: ").append(getNamespace()).append(","); if (getPackageName() != null) sb.append("PackageName: ").append(getPackageName()).append(","); if (getDisplayName() != null) sb.append("DisplayName: ").append(getDisplayName()).append(","); if (getVersion() != null) sb.append("Version: ").append(getVersion()).append(","); if (getSummary() != null) sb.append("Summary: ").append(getSummary()).append(","); if (getHomePage() != null) sb.append("HomePage: ").append(getHomePage()).append(","); if (getSourceCodeRepository() != null) sb.append("SourceCodeRepository: ").append(getSourceCodeRepository()).append(","); if (getPublishedTime() != null) sb.append("PublishedTime: ").append(getPublishedTime()).append(","); if (getLicenses() != null) sb.append("Licenses: ").append(getLicenses()).append(","); if (getRevision() != null) sb.append("Revision: ").append(getRevision()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getOrigin() != null) sb.append("Origin: ").append(getOrigin()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof PackageVersionDescription == false) return false; PackageVersionDescription other = (PackageVersionDescription) obj; if (other.getFormat() == null ^ this.getFormat() == null) return false; if (other.getFormat() != null && other.getFormat().equals(this.getFormat()) == false) return false; if (other.getNamespace() == null ^ this.getNamespace() == null) return false; if (other.getNamespace() != null && other.getNamespace().equals(this.getNamespace()) == false) return false; if (other.getPackageName() == null ^ this.getPackageName() == null) return false; if (other.getPackageName() != null && other.getPackageName().equals(this.getPackageName()) == false) return false; if (other.getDisplayName() == null ^ this.getDisplayName() == null) return false; if (other.getDisplayName() != null && other.getDisplayName().equals(this.getDisplayName()) == 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.getSummary() == null ^ this.getSummary() == null) return false; if (other.getSummary() != null && other.getSummary().equals(this.getSummary()) == false) return false; if (other.getHomePage() == null ^ this.getHomePage() == null) return false; if (other.getHomePage() != null && other.getHomePage().equals(this.getHomePage()) == false) return false; if (other.getSourceCodeRepository() == null ^ this.getSourceCodeRepository() == null) return false; if (other.getSourceCodeRepository() != null && other.getSourceCodeRepository().equals(this.getSourceCodeRepository()) == false) return false; if (other.getPublishedTime() == null ^ this.getPublishedTime() == null) return false; if (other.getPublishedTime() != null && other.getPublishedTime().equals(this.getPublishedTime()) == false) return false; if (other.getLicenses() == null ^ this.getLicenses() == null) return false; if (other.getLicenses() != null && other.getLicenses().equals(this.getLicenses()) == false) return false; if (other.getRevision() == null ^ this.getRevision() == null) return false; if (other.getRevision() != null && other.getRevision().equals(this.getRevision()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getOrigin() == null ^ this.getOrigin() == null) return false; if (other.getOrigin() != null && other.getOrigin().equals(this.getOrigin()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getFormat() == null) ? 0 : getFormat().hashCode()); hashCode = prime * hashCode + ((getNamespace() == null) ? 0 : getNamespace().hashCode()); hashCode = prime * hashCode + ((getPackageName() == null) ? 0 : getPackageName().hashCode()); hashCode = prime * hashCode + ((getDisplayName() == null) ? 0 : getDisplayName().hashCode()); hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode()); hashCode = prime * hashCode + ((getSummary() == null) ? 0 : getSummary().hashCode()); hashCode = prime * hashCode + ((getHomePage() == null) ? 0 : getHomePage().hashCode()); hashCode = prime * hashCode + ((getSourceCodeRepository() == null) ? 0 : getSourceCodeRepository().hashCode()); hashCode = prime * hashCode + ((getPublishedTime() == null) ? 0 : getPublishedTime().hashCode()); hashCode = prime * hashCode + ((getLicenses() == null) ? 0 : getLicenses().hashCode()); hashCode = prime * hashCode + ((getRevision() == null) ? 0 : getRevision().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getOrigin() == null) ? 0 : getOrigin().hashCode()); return hashCode; } @Override public PackageVersionDescription clone() { try { return (PackageVersionDescription) 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.codeartifact.model.transform.PackageVersionDescriptionMarshaller.getInstance().marshall(this, protocolMarshaller); } }