com.amazonaws.services.codeartifact.model.AssociatedPackage 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;
/**
*
* A package associated with a package group.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AssociatedPackage implements Serializable, Cloneable, StructuredPojo {
/**
*
* A format that specifies the type of the associated package.
*
*/
private String format;
/**
*
* The namespace of the associated 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 associated package.
*
*/
private String packageValue;
/**
*
* Describes the strength of the association between the package and package group. A strong match can be thought of
* as an exact match, and a weak match can be thought of as a variation match, for example, the package name matches
* a variation of the package group pattern. For more information about package group pattern matching, including
* strong and weak matches, see Package group definition syntax and matching behavior in the CodeArtifact User Guide.
*
*/
private String associationType;
/**
*
* A format that specifies the type of the associated package.
*
*
* @param format
* A format that specifies the type of the associated package.
* @see PackageFormat
*/
public void setFormat(String format) {
this.format = format;
}
/**
*
* A format that specifies the type of the associated package.
*
*
* @return A format that specifies the type of the associated package.
* @see PackageFormat
*/
public String getFormat() {
return this.format;
}
/**
*
* A format that specifies the type of the associated package.
*
*
* @param format
* A format that specifies the type of the associated package.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PackageFormat
*/
public AssociatedPackage withFormat(String format) {
setFormat(format);
return this;
}
/**
*
* A format that specifies the type of the associated package.
*
*
* @param format
* A format that specifies the type of the associated package.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PackageFormat
*/
public AssociatedPackage withFormat(PackageFormat format) {
this.format = format.toString();
return this;
}
/**
*
* The namespace of the associated 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 associated 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 associated 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 associated 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 associated 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 associated 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 AssociatedPackage withNamespace(String namespace) {
setNamespace(namespace);
return this;
}
/**
*
* The name of the associated package.
*
*
* @param packageValue
* The name of the associated package.
*/
public void setPackage(String packageValue) {
this.packageValue = packageValue;
}
/**
*
* The name of the associated package.
*
*
* @return The name of the associated package.
*/
public String getPackage() {
return this.packageValue;
}
/**
*
* The name of the associated package.
*
*
* @param packageValue
* The name of the associated package.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociatedPackage withPackage(String packageValue) {
setPackage(packageValue);
return this;
}
/**
*
* Describes the strength of the association between the package and package group. A strong match can be thought of
* as an exact match, and a weak match can be thought of as a variation match, for example, the package name matches
* a variation of the package group pattern. For more information about package group pattern matching, including
* strong and weak matches, see Package group definition syntax and matching behavior in the CodeArtifact User Guide.
*
*
* @param associationType
* Describes the strength of the association between the package and package group. A strong match can be
* thought of as an exact match, and a weak match can be thought of as a variation match, for example, the
* package name matches a variation of the package group pattern. For more information about package group
* pattern matching, including strong and weak matches, see Package group definition syntax and matching behavior in the CodeArtifact User Guide.
* @see PackageGroupAssociationType
*/
public void setAssociationType(String associationType) {
this.associationType = associationType;
}
/**
*
* Describes the strength of the association between the package and package group. A strong match can be thought of
* as an exact match, and a weak match can be thought of as a variation match, for example, the package name matches
* a variation of the package group pattern. For more information about package group pattern matching, including
* strong and weak matches, see Package group definition syntax and matching behavior in the CodeArtifact User Guide.
*
*
* @return Describes the strength of the association between the package and package group. A strong match can be
* thought of as an exact match, and a weak match can be thought of as a variation match, for example, the
* package name matches a variation of the package group pattern. For more information about package group
* pattern matching, including strong and weak matches, see Package group definition syntax and matching behavior in the CodeArtifact User Guide.
* @see PackageGroupAssociationType
*/
public String getAssociationType() {
return this.associationType;
}
/**
*
* Describes the strength of the association between the package and package group. A strong match can be thought of
* as an exact match, and a weak match can be thought of as a variation match, for example, the package name matches
* a variation of the package group pattern. For more information about package group pattern matching, including
* strong and weak matches, see Package group definition syntax and matching behavior in the CodeArtifact User Guide.
*
*
* @param associationType
* Describes the strength of the association between the package and package group. A strong match can be
* thought of as an exact match, and a weak match can be thought of as a variation match, for example, the
* package name matches a variation of the package group pattern. For more information about package group
* pattern matching, including strong and weak matches, see Package group definition syntax and matching behavior in the CodeArtifact User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PackageGroupAssociationType
*/
public AssociatedPackage withAssociationType(String associationType) {
setAssociationType(associationType);
return this;
}
/**
*
* Describes the strength of the association between the package and package group. A strong match can be thought of
* as an exact match, and a weak match can be thought of as a variation match, for example, the package name matches
* a variation of the package group pattern. For more information about package group pattern matching, including
* strong and weak matches, see Package group definition syntax and matching behavior in the CodeArtifact User Guide.
*
*
* @param associationType
* Describes the strength of the association between the package and package group. A strong match can be
* thought of as an exact match, and a weak match can be thought of as a variation match, for example, the
* package name matches a variation of the package group pattern. For more information about package group
* pattern matching, including strong and weak matches, see Package group definition syntax and matching behavior in the CodeArtifact User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PackageGroupAssociationType
*/
public AssociatedPackage withAssociationType(PackageGroupAssociationType associationType) {
this.associationType = associationType.toString();
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 (getAssociationType() != null)
sb.append("AssociationType: ").append(getAssociationType());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AssociatedPackage == false)
return false;
AssociatedPackage other = (AssociatedPackage) 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.getAssociationType() == null ^ this.getAssociationType() == null)
return false;
if (other.getAssociationType() != null && other.getAssociationType().equals(this.getAssociationType()) == 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 + ((getAssociationType() == null) ? 0 : getAssociationType().hashCode());
return hashCode;
}
@Override
public AssociatedPackage clone() {
try {
return (AssociatedPackage) 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.AssociatedPackageMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}