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

software.amazon.awssdk.services.ecr.model.Image 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.29.39
Show newest version
/*
 * Copyright 2012-2017 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.util.Optional;
import javax.annotation.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.core.protocol.ProtocolMarshaller;
import software.amazon.awssdk.core.protocol.StructuredPojo;
import software.amazon.awssdk.services.ecr.transform.ImageMarshaller;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* An object representing an Amazon ECR image. *

*/ @Generated("software.amazon.awssdk:codegen") public class Image implements StructuredPojo, ToCopyableBuilder { private final String registryId; private final String repositoryName; private final ImageIdentifier imageId; private final String imageManifest; private Image(BuilderImpl builder) { this.registryId = builder.registryId; this.repositoryName = builder.repositoryName; this.imageId = builder.imageId; this.imageManifest = builder.imageManifest; } /** *

* The AWS account ID associated with the registry containing the image. *

* * @return The AWS account ID associated with the registry containing the image. */ public String registryId() { return registryId; } /** *

* The name of the repository associated with the image. *

* * @return The name of the repository associated with the image. */ public String repositoryName() { return repositoryName; } /** *

* An object containing the image tag and image digest associated with an image. *

* * @return An object containing the image tag and image digest associated with an image. */ public ImageIdentifier imageId() { return imageId; } /** *

* The image manifest associated with the image. *

* * @return The image manifest associated with the image. */ public String imageManifest() { return imageManifest; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + ((registryId() == null) ? 0 : registryId().hashCode()); hashCode = 31 * hashCode + ((repositoryName() == null) ? 0 : repositoryName().hashCode()); hashCode = 31 * hashCode + ((imageId() == null) ? 0 : imageId().hashCode()); hashCode = 31 * hashCode + ((imageManifest() == null) ? 0 : imageManifest().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Image)) { return false; } Image other = (Image) obj; if (other.registryId() == null ^ this.registryId() == null) { return false; } if (other.registryId() != null && !other.registryId().equals(this.registryId())) { return false; } if (other.repositoryName() == null ^ this.repositoryName() == null) { return false; } if (other.repositoryName() != null && !other.repositoryName().equals(this.repositoryName())) { return false; } if (other.imageId() == null ^ this.imageId() == null) { return false; } if (other.imageId() != null && !other.imageId().equals(this.imageId())) { return false; } if (other.imageManifest() == null ^ this.imageManifest() == null) { return false; } if (other.imageManifest() != null && !other.imageManifest().equals(this.imageManifest())) { return false; } return true; } @Override public String toString() { StringBuilder sb = new StringBuilder("{"); if (registryId() != null) { sb.append("RegistryId: ").append(registryId()).append(","); } if (repositoryName() != null) { sb.append("RepositoryName: ").append(repositoryName()).append(","); } if (imageId() != null) { sb.append("ImageId: ").append(imageId()).append(","); } if (imageManifest() != null) { sb.append("ImageManifest: ").append(imageManifest()).append(","); } if (sb.length() > 1) { sb.setLength(sb.length() - 1); } sb.append("}"); return sb.toString(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "registryId": return Optional.of(clazz.cast(registryId())); case "repositoryName": return Optional.of(clazz.cast(repositoryName())); case "imageId": return Optional.of(clazz.cast(imageId())); case "imageManifest": return Optional.of(clazz.cast(imageManifest())); default: return Optional.empty(); } } @SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { ImageMarshaller.getInstance().marshall(this, protocolMarshaller); } public interface Builder extends CopyableBuilder { /** *

* The AWS account ID associated with the registry containing the image. *

* * @param registryId * The AWS account ID associated with the registry containing the image. * @return Returns a reference to this object so that method calls can be chained together. */ Builder registryId(String registryId); /** *

* The name of the repository associated with the image. *

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

* An object containing the image tag and image digest associated with an image. *

* * @param imageId * An object containing the image tag and image digest associated with an image. * @return Returns a reference to this object so that method calls can be chained together. */ Builder imageId(ImageIdentifier imageId); /** *

* The image manifest associated with the image. *

* * @param imageManifest * The image manifest associated with the image. * @return Returns a reference to this object so that method calls can be chained together. */ Builder imageManifest(String imageManifest); } static final class BuilderImpl implements Builder { private String registryId; private String repositoryName; private ImageIdentifier imageId; private String imageManifest; private BuilderImpl() { } private BuilderImpl(Image model) { registryId(model.registryId); repositoryName(model.repositoryName); imageId(model.imageId); imageManifest(model.imageManifest); } public final String getRegistryId() { return registryId; } @Override public final Builder registryId(String registryId) { this.registryId = registryId; return this; } public final void setRegistryId(String registryId) { this.registryId = registryId; } public final String getRepositoryName() { return repositoryName; } @Override public final Builder repositoryName(String repositoryName) { this.repositoryName = repositoryName; return this; } public final void setRepositoryName(String repositoryName) { this.repositoryName = repositoryName; } public final ImageIdentifier.Builder getImageId() { return imageId != null ? imageId.toBuilder() : null; } @Override public final Builder imageId(ImageIdentifier imageId) { this.imageId = imageId; return this; } public final void setImageId(ImageIdentifier.BuilderImpl imageId) { this.imageId = imageId != null ? imageId.build() : null; } public final String getImageManifest() { return imageManifest; } @Override public final Builder imageManifest(String imageManifest) { this.imageManifest = imageManifest; return this; } public final void setImageManifest(String imageManifest) { this.imageManifest = imageManifest; } @Override public Image build() { return new Image(this); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy