com.amazonaws.services.codeartifact.model.PublishPackageVersionResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-codeartifact Show documentation
/*
* 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;
/**
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class PublishPackageVersionResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* The format of the package version.
*
*/
private String format;
/**
*
* The namespace of the package version.
*
*/
private String namespace;
/**
*
* The name of the package.
*
*/
private String packageValue;
/**
*
* The version of the package.
*
*/
private String version;
/**
*
* The revision of the package version.
*
*/
private String versionRevision;
/**
*
* A string that contains the status of the package version. For more information, see Package version status in the CodeArtifact User Guide.
*
*/
private String status;
/**
*
* An AssetSummary
* for the published asset.
*
*/
private AssetSummary asset;
/**
*
* 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 PublishPackageVersionResult 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 PublishPackageVersionResult withFormat(PackageFormat format) {
this.format = format.toString();
return this;
}
/**
*
* The namespace of the package version.
*
*
* @param namespace
* The namespace of the package version.
*/
public void setNamespace(String namespace) {
this.namespace = namespace;
}
/**
*
* The namespace of the package version.
*
*
* @return The namespace of the package version.
*/
public String getNamespace() {
return this.namespace;
}
/**
*
* The namespace of the package version.
*
*
* @param namespace
* The namespace of the package version.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PublishPackageVersionResult withNamespace(String namespace) {
setNamespace(namespace);
return this;
}
/**
*
* The name of the package.
*
*
* @param packageValue
* The name of the package.
*/
public void setPackage(String packageValue) {
this.packageValue = packageValue;
}
/**
*
* The name of the package.
*
*
* @return The name of the package.
*/
public String getPackage() {
return this.packageValue;
}
/**
*
* The name of the package.
*
*
* @param packageValue
* The name of the package.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PublishPackageVersionResult withPackage(String packageValue) {
setPackage(packageValue);
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 PublishPackageVersionResult withVersion(String version) {
setVersion(version);
return this;
}
/**
*
* The revision of the package version.
*
*
* @param versionRevision
* The revision of the package version.
*/
public void setVersionRevision(String versionRevision) {
this.versionRevision = versionRevision;
}
/**
*
* The revision of the package version.
*
*
* @return The revision of the package version.
*/
public String getVersionRevision() {
return this.versionRevision;
}
/**
*
* The revision of the package version.
*
*
* @param versionRevision
* The revision of the package version.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PublishPackageVersionResult withVersionRevision(String versionRevision) {
setVersionRevision(versionRevision);
return this;
}
/**
*
* A string that contains the status of the package version. For more information, see Package version status in the CodeArtifact User Guide.
*
*
* @param status
* A string that contains the status of the package version. For more information, see Package version status in the CodeArtifact User Guide.
* @see PackageVersionStatus
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* A string that contains the status of the package version. For more information, see Package version status in the CodeArtifact User Guide.
*
*
* @return A string that contains the status of the package version. For more information, see Package version status in the CodeArtifact User Guide.
* @see PackageVersionStatus
*/
public String getStatus() {
return this.status;
}
/**
*
* A string that contains the status of the package version. For more information, see Package version status in the CodeArtifact User Guide.
*
*
* @param status
* A string that contains the status of the package version. For more information, see Package version status in the CodeArtifact User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PackageVersionStatus
*/
public PublishPackageVersionResult withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* A string that contains the status of the package version. For more information, see Package version status in the CodeArtifact User Guide.
*
*
* @param status
* A string that contains the status of the package version. For more information, see Package version status in the CodeArtifact User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PackageVersionStatus
*/
public PublishPackageVersionResult withStatus(PackageVersionStatus status) {
this.status = status.toString();
return this;
}
/**
*
* An AssetSummary
* for the published asset.
*
*
* @param asset
* An AssetSummary
* for the published asset.
*/
public void setAsset(AssetSummary asset) {
this.asset = asset;
}
/**
*
* An AssetSummary
* for the published asset.
*
*
* @return An AssetSummary
* for the published asset.
*/
public AssetSummary getAsset() {
return this.asset;
}
/**
*
* An AssetSummary
* for the published asset.
*
*
* @param asset
* An AssetSummary
* for the published asset.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PublishPackageVersionResult withAsset(AssetSummary asset) {
setAsset(asset);
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 (getPackage() != null)
sb.append("Package: ").append(getPackage()).append(",");
if (getVersion() != null)
sb.append("Version: ").append(getVersion()).append(",");
if (getVersionRevision() != null)
sb.append("VersionRevision: ").append(getVersionRevision()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getAsset() != null)
sb.append("Asset: ").append(getAsset());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof PublishPackageVersionResult == false)
return false;
PublishPackageVersionResult other = (PublishPackageVersionResult) 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.getPackage() == null ^ this.getPackage() == null)
return false;
if (other.getPackage() != null && other.getPackage().equals(this.getPackage()) == 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.getVersionRevision() == null ^ this.getVersionRevision() == null)
return false;
if (other.getVersionRevision() != null && other.getVersionRevision().equals(this.getVersionRevision()) == 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.getAsset() == null ^ this.getAsset() == null)
return false;
if (other.getAsset() != null && other.getAsset().equals(this.getAsset()) == 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 + ((getPackage() == null) ? 0 : getPackage().hashCode());
hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode());
hashCode = prime * hashCode + ((getVersionRevision() == null) ? 0 : getVersionRevision().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getAsset() == null) ? 0 : getAsset().hashCode());
return hashCode;
}
@Override
public PublishPackageVersionResult clone() {
try {
return (PublishPackageVersionResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}