software.amazon.awssdk.services.ecr.model.VulnerablePackage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ecr Show documentation
Show all versions of ecr Show documentation
The AWS Java SDK for the Amazon EC2 Container Registry holds the client classes that are used for
communicating with the
Amazon EC2 Container Registry Service
/*
* Copyright 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 software.amazon.awssdk.services.ecr.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Information on the vulnerable package identified by a finding.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class VulnerablePackage implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ARCH_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arch")
.getter(getter(VulnerablePackage::arch)).setter(setter(Builder::arch))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arch").build()).build();
private static final SdkField EPOCH_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("epoch")
.getter(getter(VulnerablePackage::epoch)).setter(setter(Builder::epoch))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("epoch").build()).build();
private static final SdkField FILE_PATH_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("filePath").getter(getter(VulnerablePackage::filePath)).setter(setter(Builder::filePath))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("filePath").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
.getter(getter(VulnerablePackage::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField PACKAGE_MANAGER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("packageManager").getter(getter(VulnerablePackage::packageManager))
.setter(setter(Builder::packageManager))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("packageManager").build()).build();
private static final SdkField RELEASE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("release")
.getter(getter(VulnerablePackage::release)).setter(setter(Builder::release))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("release").build()).build();
private static final SdkField SOURCE_LAYER_HASH_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("sourceLayerHash").getter(getter(VulnerablePackage::sourceLayerHash))
.setter(setter(Builder::sourceLayerHash))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("sourceLayerHash").build()).build();
private static final SdkField VERSION_FIELD = SdkField. builder(MarshallingType.STRING).memberName("version")
.getter(getter(VulnerablePackage::version)).setter(setter(Builder::version))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("version").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARCH_FIELD, EPOCH_FIELD,
FILE_PATH_FIELD, NAME_FIELD, PACKAGE_MANAGER_FIELD, RELEASE_FIELD, SOURCE_LAYER_HASH_FIELD, VERSION_FIELD));
private static final long serialVersionUID = 1L;
private final String arch;
private final Integer epoch;
private final String filePath;
private final String name;
private final String packageManager;
private final String release;
private final String sourceLayerHash;
private final String version;
private VulnerablePackage(BuilderImpl builder) {
this.arch = builder.arch;
this.epoch = builder.epoch;
this.filePath = builder.filePath;
this.name = builder.name;
this.packageManager = builder.packageManager;
this.release = builder.release;
this.sourceLayerHash = builder.sourceLayerHash;
this.version = builder.version;
}
/**
*
* The architecture of the vulnerable package.
*
*
* @return The architecture of the vulnerable package.
*/
public final String arch() {
return arch;
}
/**
*
* The epoch of the vulnerable package.
*
*
* @return The epoch of the vulnerable package.
*/
public final Integer epoch() {
return epoch;
}
/**
*
* The file path of the vulnerable package.
*
*
* @return The file path of the vulnerable package.
*/
public final String filePath() {
return filePath;
}
/**
*
* The name of the vulnerable package.
*
*
* @return The name of the vulnerable package.
*/
public final String name() {
return name;
}
/**
*
* The package manager of the vulnerable package.
*
*
* @return The package manager of the vulnerable package.
*/
public final String packageManager() {
return packageManager;
}
/**
*
* The release of the vulnerable package.
*
*
* @return The release of the vulnerable package.
*/
public final String release() {
return release;
}
/**
*
* The source layer hash of the vulnerable package.
*
*
* @return The source layer hash of the vulnerable package.
*/
public final String sourceLayerHash() {
return sourceLayerHash;
}
/**
*
* The version of the vulnerable package.
*
*
* @return The version of the vulnerable package.
*/
public final String version() {
return version;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(arch());
hashCode = 31 * hashCode + Objects.hashCode(epoch());
hashCode = 31 * hashCode + Objects.hashCode(filePath());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(packageManager());
hashCode = 31 * hashCode + Objects.hashCode(release());
hashCode = 31 * hashCode + Objects.hashCode(sourceLayerHash());
hashCode = 31 * hashCode + Objects.hashCode(version());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof VulnerablePackage)) {
return false;
}
VulnerablePackage other = (VulnerablePackage) obj;
return Objects.equals(arch(), other.arch()) && Objects.equals(epoch(), other.epoch())
&& Objects.equals(filePath(), other.filePath()) && Objects.equals(name(), other.name())
&& Objects.equals(packageManager(), other.packageManager()) && Objects.equals(release(), other.release())
&& Objects.equals(sourceLayerHash(), other.sourceLayerHash()) && Objects.equals(version(), other.version());
}
/**
* 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.
*/
@Override
public final String toString() {
return ToString.builder("VulnerablePackage").add("Arch", arch()).add("Epoch", epoch()).add("FilePath", filePath())
.add("Name", name()).add("PackageManager", packageManager()).add("Release", release())
.add("SourceLayerHash", sourceLayerHash()).add("Version", version()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "arch":
return Optional.ofNullable(clazz.cast(arch()));
case "epoch":
return Optional.ofNullable(clazz.cast(epoch()));
case "filePath":
return Optional.ofNullable(clazz.cast(filePath()));
case "name":
return Optional.ofNullable(clazz.cast(name()));
case "packageManager":
return Optional.ofNullable(clazz.cast(packageManager()));
case "release":
return Optional.ofNullable(clazz.cast(release()));
case "sourceLayerHash":
return Optional.ofNullable(clazz.cast(sourceLayerHash()));
case "version":
return Optional.ofNullable(clazz.cast(version()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy