All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.ecr.model.VulnerablePackage Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.30.1
Show newest version
/*
 * 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 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 getter(Function g) { return obj -> g.apply((VulnerablePackage) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The architecture of the vulnerable package. *

* * @param arch * The architecture of the vulnerable package. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arch(String arch); /** *

* The epoch of the vulnerable package. *

* * @param epoch * The epoch of the vulnerable package. * @return Returns a reference to this object so that method calls can be chained together. */ Builder epoch(Integer epoch); /** *

* The file path of the vulnerable package. *

* * @param filePath * The file path of the vulnerable package. * @return Returns a reference to this object so that method calls can be chained together. */ Builder filePath(String filePath); /** *

* The name of the vulnerable package. *

* * @param name * The name of the vulnerable package. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* The package manager of the vulnerable package. *

* * @param packageManager * The package manager of the vulnerable package. * @return Returns a reference to this object so that method calls can be chained together. */ Builder packageManager(String packageManager); /** *

* The release of the vulnerable package. *

* * @param release * The release of the vulnerable package. * @return Returns a reference to this object so that method calls can be chained together. */ Builder release(String release); /** *

* The source layer hash of the vulnerable package. *

* * @param sourceLayerHash * The source layer hash of the vulnerable package. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceLayerHash(String sourceLayerHash); /** *

* The version of the vulnerable package. *

* * @param version * The version of the vulnerable package. * @return Returns a reference to this object so that method calls can be chained together. */ Builder version(String version); } static final class BuilderImpl implements Builder { private String arch; private Integer epoch; private String filePath; private String name; private String packageManager; private String release; private String sourceLayerHash; private String version; private BuilderImpl() { } private BuilderImpl(VulnerablePackage model) { arch(model.arch); epoch(model.epoch); filePath(model.filePath); name(model.name); packageManager(model.packageManager); release(model.release); sourceLayerHash(model.sourceLayerHash); version(model.version); } public final String getArch() { return arch; } public final void setArch(String arch) { this.arch = arch; } @Override public final Builder arch(String arch) { this.arch = arch; return this; } public final Integer getEpoch() { return epoch; } public final void setEpoch(Integer epoch) { this.epoch = epoch; } @Override public final Builder epoch(Integer epoch) { this.epoch = epoch; return this; } public final String getFilePath() { return filePath; } public final void setFilePath(String filePath) { this.filePath = filePath; } @Override public final Builder filePath(String filePath) { this.filePath = filePath; return this; } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getPackageManager() { return packageManager; } public final void setPackageManager(String packageManager) { this.packageManager = packageManager; } @Override public final Builder packageManager(String packageManager) { this.packageManager = packageManager; return this; } public final String getRelease() { return release; } public final void setRelease(String release) { this.release = release; } @Override public final Builder release(String release) { this.release = release; return this; } public final String getSourceLayerHash() { return sourceLayerHash; } public final void setSourceLayerHash(String sourceLayerHash) { this.sourceLayerHash = sourceLayerHash; } @Override public final Builder sourceLayerHash(String sourceLayerHash) { this.sourceLayerHash = sourceLayerHash; return this; } public final String getVersion() { return version; } public final void setVersion(String version) { this.version = version; } @Override public final Builder version(String version) { this.version = version; return this; } @Override public VulnerablePackage build() { return new VulnerablePackage(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy