com.amazonaws.services.codeartifact.model.ListPackageVersionsResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-codeartifact Show documentation
/*
* Copyright 2015-2020 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 ListPackageVersionsResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* The default package version to display. This depends on the package format:
*
*
* -
*
* For Maven and PyPI packages, it's the most recently published package version.
*
*
* -
*
* For npm packages, it's the version referenced by the latest
tag. If the latest
tag is
* not set, it's the most recently published package version.
*
*
*
*/
private String defaultDisplayVersion;
/**
*
* A format of the package. Valid package format values are:
*
*
* -
*
* npm
*
*
* -
*
* pypi
*
*
* -
*
* maven
*
*
*
*/
private String format;
/**
*
* The namespace of the package. The package component that specifies its namespace depends on its type. For
* example:
*
*
* -
*
* The namespace of a Maven package is its groupId
.
*
*
* -
*
* The namespace of an npm package is its scope
.
*
*
* -
*
* A Python package does not contain a corresponding component, so Python packages do not have a namespace.
*
*
*
*/
private String namespace;
/**
*
* The name of the package.
*
*/
private String packageValue;
/**
*
* The returned list of
* PackageVersionSummary
objects.
*
*/
private java.util.List versions;
/**
*
* If there are additional results, this is the token for the next set of results.
*
*/
private String nextToken;
/**
*
* The default package version to display. This depends on the package format:
*
*
* -
*
* For Maven and PyPI packages, it's the most recently published package version.
*
*
* -
*
* For npm packages, it's the version referenced by the latest
tag. If the latest
tag is
* not set, it's the most recently published package version.
*
*
*
*
* @param defaultDisplayVersion
* The default package version to display. This depends on the package format:
*
* -
*
* For Maven and PyPI packages, it's the most recently published package version.
*
*
* -
*
* For npm packages, it's the version referenced by the latest
tag. If the latest
* tag is not set, it's the most recently published package version.
*
*
*/
public void setDefaultDisplayVersion(String defaultDisplayVersion) {
this.defaultDisplayVersion = defaultDisplayVersion;
}
/**
*
* The default package version to display. This depends on the package format:
*
*
* -
*
* For Maven and PyPI packages, it's the most recently published package version.
*
*
* -
*
* For npm packages, it's the version referenced by the latest
tag. If the latest
tag is
* not set, it's the most recently published package version.
*
*
*
*
* @return The default package version to display. This depends on the package format:
*
* -
*
* For Maven and PyPI packages, it's the most recently published package version.
*
*
* -
*
* For npm packages, it's the version referenced by the latest
tag. If the latest
* tag is not set, it's the most recently published package version.
*
*
*/
public String getDefaultDisplayVersion() {
return this.defaultDisplayVersion;
}
/**
*
* The default package version to display. This depends on the package format:
*
*
* -
*
* For Maven and PyPI packages, it's the most recently published package version.
*
*
* -
*
* For npm packages, it's the version referenced by the latest
tag. If the latest
tag is
* not set, it's the most recently published package version.
*
*
*
*
* @param defaultDisplayVersion
* The default package version to display. This depends on the package format:
*
* -
*
* For Maven and PyPI packages, it's the most recently published package version.
*
*
* -
*
* For npm packages, it's the version referenced by the latest
tag. If the latest
* tag is not set, it's the most recently published package version.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListPackageVersionsResult withDefaultDisplayVersion(String defaultDisplayVersion) {
setDefaultDisplayVersion(defaultDisplayVersion);
return this;
}
/**
*
* A format of the package. Valid package format values are:
*
*
* -
*
* npm
*
*
* -
*
* pypi
*
*
* -
*
* maven
*
*
*
*
* @param format
* A format of the package. Valid package format values are:
*
* -
*
* npm
*
*
* -
*
* pypi
*
*
* -
*
* maven
*
*
* @see PackageFormat
*/
public void setFormat(String format) {
this.format = format;
}
/**
*
* A format of the package. Valid package format values are:
*
*
* -
*
* npm
*
*
* -
*
* pypi
*
*
* -
*
* maven
*
*
*
*
* @return A format of the package. Valid package format values are:
*
* -
*
* npm
*
*
* -
*
* pypi
*
*
* -
*
* maven
*
*
* @see PackageFormat
*/
public String getFormat() {
return this.format;
}
/**
*
* A format of the package. Valid package format values are:
*
*
* -
*
* npm
*
*
* -
*
* pypi
*
*
* -
*
* maven
*
*
*
*
* @param format
* A format of the package. Valid package format values are:
*
* -
*
* npm
*
*
* -
*
* pypi
*
*
* -
*
* maven
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see PackageFormat
*/
public ListPackageVersionsResult withFormat(String format) {
setFormat(format);
return this;
}
/**
*
* A format of the package. Valid package format values are:
*
*
* -
*
* npm
*
*
* -
*
* pypi
*
*
* -
*
* maven
*
*
*
*
* @param format
* A format of the package. Valid package format values are:
*
* -
*
* npm
*
*
* -
*
* pypi
*
*
* -
*
* maven
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see PackageFormat
*/
public ListPackageVersionsResult withFormat(PackageFormat format) {
this.format = format.toString();
return this;
}
/**
*
* The namespace of the package. The package component that specifies its namespace depends on its type. For
* example:
*
*
* -
*
* The namespace of a Maven package is its groupId
.
*
*
* -
*
* The namespace of an npm package is its scope
.
*
*
* -
*
* A Python package does not contain a corresponding component, so Python packages do not have a namespace.
*
*
*
*
* @param namespace
* The namespace of the package. The package component that specifies its namespace depends on its type. For
* example:
*
* -
*
* The namespace of a Maven package is its groupId
.
*
*
* -
*
* The namespace of an npm package is its scope
.
*
*
* -
*
* A Python package does not contain a corresponding component, so Python packages do not have a namespace.
*
*
*/
public void setNamespace(String namespace) {
this.namespace = namespace;
}
/**
*
* The namespace of the package. The package component that specifies its namespace depends on its type. For
* example:
*
*
* -
*
* The namespace of a Maven package is its groupId
.
*
*
* -
*
* The namespace of an npm package is its scope
.
*
*
* -
*
* A Python package does not contain a corresponding component, so Python packages do not have a namespace.
*
*
*
*
* @return The namespace of the package. The package component that specifies its namespace depends on its type. For
* example:
*
* -
*
* The namespace of a Maven package is its groupId
.
*
*
* -
*
* The namespace of an npm package is its scope
.
*
*
* -
*
* A Python package does not contain a corresponding component, so Python packages do not have a namespace.
*
*
*/
public String getNamespace() {
return this.namespace;
}
/**
*
* The namespace of the package. The package component that specifies its namespace depends on its type. For
* example:
*
*
* -
*
* The namespace of a Maven package is its groupId
.
*
*
* -
*
* The namespace of an npm package is its scope
.
*
*
* -
*
* A Python package does not contain a corresponding component, so Python packages do not have a namespace.
*
*
*
*
* @param namespace
* The namespace of the package. The package component that specifies its namespace depends on its type. For
* example:
*
* -
*
* The namespace of a Maven package is its groupId
.
*
*
* -
*
* The namespace of an npm package is its scope
.
*
*
* -
*
* A Python package does not contain a corresponding component, so Python packages do not have a namespace.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListPackageVersionsResult 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 ListPackageVersionsResult withPackage(String packageValue) {
setPackage(packageValue);
return this;
}
/**
*
* The returned list of
* PackageVersionSummary
objects.
*
*
* @return The returned list of
* PackageVersionSummary
objects.
*/
public java.util.List getVersions() {
return versions;
}
/**
*
* The returned list of
* PackageVersionSummary
objects.
*
*
* @param versions
* The returned list of
* PackageVersionSummary
objects.
*/
public void setVersions(java.util.Collection versions) {
if (versions == null) {
this.versions = null;
return;
}
this.versions = new java.util.ArrayList(versions);
}
/**
*
* The returned list of
* PackageVersionSummary
objects.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setVersions(java.util.Collection)} or {@link #withVersions(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param versions
* The returned list of
* PackageVersionSummary
objects.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListPackageVersionsResult withVersions(PackageVersionSummary... versions) {
if (this.versions == null) {
setVersions(new java.util.ArrayList(versions.length));
}
for (PackageVersionSummary ele : versions) {
this.versions.add(ele);
}
return this;
}
/**
*
* The returned list of
* PackageVersionSummary
objects.
*
*
* @param versions
* The returned list of
* PackageVersionSummary
objects.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListPackageVersionsResult withVersions(java.util.Collection versions) {
setVersions(versions);
return this;
}
/**
*
* If there are additional results, this is the token for the next set of results.
*
*
* @param nextToken
* If there are additional results, this is the token for the next set of results.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
*
* If there are additional results, this is the token for the next set of results.
*
*
* @return If there are additional results, this is the token for the next set of results.
*/
public String getNextToken() {
return this.nextToken;
}
/**
*
* If there are additional results, this is the token for the next set of results.
*
*
* @param nextToken
* If there are additional results, this is the token for the next set of results.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListPackageVersionsResult withNextToken(String nextToken) {
setNextToken(nextToken);
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 (getDefaultDisplayVersion() != null)
sb.append("DefaultDisplayVersion: ").append(getDefaultDisplayVersion()).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 (getVersions() != null)
sb.append("Versions: ").append(getVersions()).append(",");
if (getNextToken() != null)
sb.append("NextToken: ").append(getNextToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ListPackageVersionsResult == false)
return false;
ListPackageVersionsResult other = (ListPackageVersionsResult) obj;
if (other.getDefaultDisplayVersion() == null ^ this.getDefaultDisplayVersion() == null)
return false;
if (other.getDefaultDisplayVersion() != null && other.getDefaultDisplayVersion().equals(this.getDefaultDisplayVersion()) == false)
return false;
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.getVersions() == null ^ this.getVersions() == null)
return false;
if (other.getVersions() != null && other.getVersions().equals(this.getVersions()) == false)
return false;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDefaultDisplayVersion() == null) ? 0 : getDefaultDisplayVersion().hashCode());
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 + ((getVersions() == null) ? 0 : getVersions().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
return hashCode;
}
@Override
public ListPackageVersionsResult clone() {
try {
return (ListPackageVersionsResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}