com.amazonaws.services.codeartifact.model.PackageDescription Maven / Gradle / Ivy
Show all versions of aws-java-sdk-codeartifact Show documentation
/*
* Copyright 2019-2024 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.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class PackageDescription implements Serializable, Cloneable, StructuredPojo {
/**
*
* A format that specifies the type of the package.
*
*/
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 version is its groupId
.
*
*
* -
*
* The namespace of an npm or Swift package version is its scope
.
*
*
* -
*
* The namespace of a generic package is its namespace
.
*
*
* -
*
* Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of
* those formats do not have a namespace.
*
*
*
*/
private String namespace;
/**
*
* The name of the package.
*
*/
private String name;
/**
*
* The package origin configuration for the package.
*
*/
private PackageOriginConfiguration originConfiguration;
/**
*
* A format that specifies the type of the package.
*
*
* @param format
* A format that specifies the type of the package.
* @see PackageFormat
*/
public void setFormat(String format) {
this.format = format;
}
/**
*
* A format that specifies the type of the package.
*
*
* @return A format that specifies the type of the package.
* @see PackageFormat
*/
public String getFormat() {
return this.format;
}
/**
*
* A format that specifies the type of the package.
*
*
* @param format
* A format that specifies the type of the package.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PackageFormat
*/
public PackageDescription withFormat(String format) {
setFormat(format);
return this;
}
/**
*
* A format that specifies the type of the package.
*
*
* @param format
* A format that specifies the type of the package.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PackageFormat
*/
public PackageDescription 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 version is its groupId
.
*
*
* -
*
* The namespace of an npm or Swift package version is its scope
.
*
*
* -
*
* The namespace of a generic package is its namespace
.
*
*
* -
*
* Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of
* those formats 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 version is its groupId
.
*
*
* -
*
* The namespace of an npm or Swift package version is its scope
.
*
*
* -
*
* The namespace of a generic package is its namespace
.
*
*
* -
*
* Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions
* of those formats 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 version is its groupId
.
*
*
* -
*
* The namespace of an npm or Swift package version is its scope
.
*
*
* -
*
* The namespace of a generic package is its namespace
.
*
*
* -
*
* Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of
* those formats 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 version is its groupId
.
*
*
* -
*
* The namespace of an npm or Swift package version is its scope
.
*
*
* -
*
* The namespace of a generic package is its namespace
.
*
*
* -
*
* Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package
* versions of those formats 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 version is its groupId
.
*
*
* -
*
* The namespace of an npm or Swift package version is its scope
.
*
*
* -
*
* The namespace of a generic package is its namespace
.
*
*
* -
*
* Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of
* those formats 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 version is its groupId
.
*
*
* -
*
* The namespace of an npm or Swift package version is its scope
.
*
*
* -
*
* The namespace of a generic package is its namespace
.
*
*
* -
*
* Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions
* of those formats do not have a namespace.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PackageDescription withNamespace(String namespace) {
setNamespace(namespace);
return this;
}
/**
*
* The name of the package.
*
*
* @param name
* The name of the package.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the package.
*
*
* @return The name of the package.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the package.
*
*
* @param name
* The name of the package.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PackageDescription withName(String name) {
setName(name);
return this;
}
/**
*
* The package origin configuration for the package.
*
*
* @param originConfiguration
* The package origin configuration for the package.
*/
public void setOriginConfiguration(PackageOriginConfiguration originConfiguration) {
this.originConfiguration = originConfiguration;
}
/**
*
* The package origin configuration for the package.
*
*
* @return The package origin configuration for the package.
*/
public PackageOriginConfiguration getOriginConfiguration() {
return this.originConfiguration;
}
/**
*
* The package origin configuration for the package.
*
*
* @param originConfiguration
* The package origin configuration for the package.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PackageDescription withOriginConfiguration(PackageOriginConfiguration originConfiguration) {
setOriginConfiguration(originConfiguration);
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 (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getOriginConfiguration() != null)
sb.append("OriginConfiguration: ").append(getOriginConfiguration());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof PackageDescription == false)
return false;
PackageDescription other = (PackageDescription) 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.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getOriginConfiguration() == null ^ this.getOriginConfiguration() == null)
return false;
if (other.getOriginConfiguration() != null && other.getOriginConfiguration().equals(this.getOriginConfiguration()) == 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 + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getOriginConfiguration() == null) ? 0 : getOriginConfiguration().hashCode());
return hashCode;
}
@Override
public PackageDescription clone() {
try {
return (PackageDescription) 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.PackageDescriptionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}