/* * 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 dependency. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class PackageDependency implements Serializable, Cloneable, StructuredPojo { /** ** The namespace of the package that this package depends on. 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
.
*
* Python and NuGet packages do not contain a corresponding component, packages of those formats do not have a * namespace. *
** The name of the package that this package depends on. *
*/ private String packageValue; /** ** The type of a package dependency. The possible values depend on the package type. *
*
* npm: regular
, dev
, peer
, optional
*
* maven: optional
, parent
, compile
, runtime
, test
,
* system
, provided
.
*
* Note that parent
is not a regular Maven dependency type; instead this is extracted from the
* <parent>
element if one is defined in the package version's POM file.
*
* nuget: The dependencyType
field is never set for NuGet packages.
*
* pypi: Requires-Dist
*
* The required version, or version range, of the package that this package depends on. The version format is
* specific to the package type. For example, the following are possible valid required versions: 1.2.3
, ^2.3.4
, or 4.x
.
*
* The namespace of the package that this package depends on. 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
.
*
* Python and NuGet packages do not contain a corresponding component, packages of those formats do not have a * namespace. *
*
* The namespace of a Maven package is its groupId
.
*
* The namespace of an npm package is its scope
.
*
* Python and NuGet packages do not contain a corresponding component, packages of those formats do not have * a namespace. *
** The namespace of the package that this package depends on. 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
.
*
* Python and NuGet packages do not contain a corresponding component, packages of those formats do not have a * namespace. *
*
* The namespace of a Maven package is its groupId
.
*
* The namespace of an npm package is its scope
.
*
* Python and NuGet packages do not contain a corresponding component, packages of those formats do not have * a namespace. *
** The namespace of the package that this package depends on. 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
.
*
* Python and NuGet packages do not contain a corresponding component, packages of those formats do not have a * namespace. *
*
* The namespace of a Maven package is its groupId
.
*
* The namespace of an npm package is its scope
.
*
* Python and NuGet packages do not contain a corresponding component, packages of those formats do not have * a namespace. *
** The name of the package that this package depends on. *
* * @param packageValue * The name of the package that this package depends on. */ public void setPackage(String packageValue) { this.packageValue = packageValue; } /** ** The name of the package that this package depends on. *
* * @return The name of the package that this package depends on. */ public String getPackage() { return this.packageValue; } /** ** The name of the package that this package depends on. *
* * @param packageValue * The name of the package that this package depends on. * @return Returns a reference to this object so that method calls can be chained together. */ public PackageDependency withPackage(String packageValue) { setPackage(packageValue); return this; } /** ** The type of a package dependency. The possible values depend on the package type. *
*
* npm: regular
, dev
, peer
, optional
*
* maven: optional
, parent
, compile
, runtime
, test
,
* system
, provided
.
*
* Note that parent
is not a regular Maven dependency type; instead this is extracted from the
* <parent>
element if one is defined in the package version's POM file.
*
* nuget: The dependencyType
field is never set for NuGet packages.
*
* pypi: Requires-Dist
*
* npm: regular
, dev
, peer
, optional
*
* maven: optional
, parent
, compile
, runtime
,
* test
, system
, provided
.
*
* Note that parent
is not a regular Maven dependency type; instead this is extracted from the
* <parent>
element if one is defined in the package version's POM file.
*
* nuget: The dependencyType
field is never set for NuGet packages.
*
* pypi: Requires-Dist
*
* The type of a package dependency. The possible values depend on the package type. *
*
* npm: regular
, dev
, peer
, optional
*
* maven: optional
, parent
, compile
, runtime
, test
,
* system
, provided
.
*
* Note that parent
is not a regular Maven dependency type; instead this is extracted from the
* <parent>
element if one is defined in the package version's POM file.
*
* nuget: The dependencyType
field is never set for NuGet packages.
*
* pypi: Requires-Dist
*
* npm: regular
, dev
, peer
, optional
*
* maven: optional
, parent
, compile
, runtime
,
* test
, system
, provided
.
*
* Note that parent
is not a regular Maven dependency type; instead this is extracted from the
* <parent>
element if one is defined in the package version's POM file.
*
* nuget: The dependencyType
field is never set for NuGet packages.
*
* pypi: Requires-Dist
*
* The type of a package dependency. The possible values depend on the package type. *
*
* npm: regular
, dev
, peer
, optional
*
* maven: optional
, parent
, compile
, runtime
, test
,
* system
, provided
.
*
* Note that parent
is not a regular Maven dependency type; instead this is extracted from the
* <parent>
element if one is defined in the package version's POM file.
*
* nuget: The dependencyType
field is never set for NuGet packages.
*
* pypi: Requires-Dist
*
* npm: regular
, dev
, peer
, optional
*
* maven: optional
, parent
, compile
, runtime
,
* test
, system
, provided
.
*
* Note that parent
is not a regular Maven dependency type; instead this is extracted from the
* <parent>
element if one is defined in the package version's POM file.
*
* nuget: The dependencyType
field is never set for NuGet packages.
*
* pypi: Requires-Dist
*
* The required version, or version range, of the package that this package depends on. The version format is
* specific to the package type. For example, the following are possible valid required versions: 1.2.3
, ^2.3.4
, or 4.x
.
*
1.2.3
, ^2.3.4
, or 4.x
.
*/
public void setVersionRequirement(String versionRequirement) {
this.versionRequirement = versionRequirement;
}
/**
*
* The required version, or version range, of the package that this package depends on. The version format is
* specific to the package type. For example, the following are possible valid required versions: 1.2.3
, ^2.3.4
, or 4.x
.
*
1.2.3
, ^2.3.4
, or 4.x
.
*/
public String getVersionRequirement() {
return this.versionRequirement;
}
/**
*
* The required version, or version range, of the package that this package depends on. The version format is
* specific to the package type. For example, the following are possible valid required versions: 1.2.3
, ^2.3.4
, or 4.x
.
*
1.2.3
, ^2.3.4
, or 4.x
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PackageDependency withVersionRequirement(String versionRequirement) {
setVersionRequirement(versionRequirement);
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 (getNamespace() != null)
sb.append("Namespace: ").append(getNamespace()).append(",");
if (getPackage() != null)
sb.append("Package: ").append(getPackage()).append(",");
if (getDependencyType() != null)
sb.append("DependencyType: ").append(getDependencyType()).append(",");
if (getVersionRequirement() != null)
sb.append("VersionRequirement: ").append(getVersionRequirement());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof PackageDependency == false)
return false;
PackageDependency other = (PackageDependency) obj;
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.getDependencyType() == null ^ this.getDependencyType() == null)
return false;
if (other.getDependencyType() != null && other.getDependencyType().equals(this.getDependencyType()) == false)
return false;
if (other.getVersionRequirement() == null ^ this.getVersionRequirement() == null)
return false;
if (other.getVersionRequirement() != null && other.getVersionRequirement().equals(this.getVersionRequirement()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getNamespace() == null) ? 0 : getNamespace().hashCode());
hashCode = prime * hashCode + ((getPackage() == null) ? 0 : getPackage().hashCode());
hashCode = prime * hashCode + ((getDependencyType() == null) ? 0 : getDependencyType().hashCode());
hashCode = prime * hashCode + ((getVersionRequirement() == null) ? 0 : getVersionRequirement().hashCode());
return hashCode;
}
@Override
public PackageDependency clone() {
try {
return (PackageDependency) 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.PackageDependencyMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}