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

software.amazon.awssdk.services.s3.model.GetObjectResponse Maven / Gradle / Ivy

/*
 * Copyright 2014-2019 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.s3.model;

import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
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.core.traits.MapTrait;
import software.amazon.awssdk.core.traits.TimestampFormatTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class GetObjectResponse extends S3Response implements
        ToCopyableBuilder {
    private static final SdkField DELETE_MARKER_FIELD = SdkField
            . builder(MarshallingType.BOOLEAN)
            .getter(getter(GetObjectResponse::deleteMarker))
            .setter(setter(Builder::deleteMarker))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-delete-marker")
                    .unmarshallLocationName("x-amz-delete-marker").build()).build();

    private static final SdkField ACCEPT_RANGES_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::acceptRanges))
            .setter(setter(Builder::acceptRanges))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("accept-ranges")
                    .unmarshallLocationName("accept-ranges").build()).build();

    private static final SdkField EXPIRATION_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::expiration))
            .setter(setter(Builder::expiration))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-expiration")
                    .unmarshallLocationName("x-amz-expiration").build()).build();

    private static final SdkField RESTORE_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::restore))
            .setter(setter(Builder::restore))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-restore")
                    .unmarshallLocationName("x-amz-restore").build()).build();

    private static final SdkField LAST_MODIFIED_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .getter(getter(GetObjectResponse::lastModified))
            .setter(setter(Builder::lastModified))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Last-Modified")
                    .unmarshallLocationName("Last-Modified").build()).build();

    private static final SdkField CONTENT_LENGTH_FIELD = SdkField
            . builder(MarshallingType.LONG)
            .getter(getter(GetObjectResponse::contentLength))
            .setter(setter(Builder::contentLength))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Length")
                    .unmarshallLocationName("Content-Length").build()).build();

    private static final SdkField E_TAG_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::eTag))
            .setter(setter(Builder::eTag))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("ETag").unmarshallLocationName("ETag")
                    .build()).build();

    private static final SdkField MISSING_META_FIELD = SdkField
            . builder(MarshallingType.INTEGER)
            .getter(getter(GetObjectResponse::missingMeta))
            .setter(setter(Builder::missingMeta))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-missing-meta")
                    .unmarshallLocationName("x-amz-missing-meta").build()).build();

    private static final SdkField VERSION_ID_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::versionId))
            .setter(setter(Builder::versionId))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-version-id")
                    .unmarshallLocationName("x-amz-version-id").build()).build();

    private static final SdkField CACHE_CONTROL_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::cacheControl))
            .setter(setter(Builder::cacheControl))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Cache-Control")
                    .unmarshallLocationName("Cache-Control").build()).build();

    private static final SdkField CONTENT_DISPOSITION_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::contentDisposition))
            .setter(setter(Builder::contentDisposition))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Disposition")
                    .unmarshallLocationName("Content-Disposition").build()).build();

    private static final SdkField CONTENT_ENCODING_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::contentEncoding))
            .setter(setter(Builder::contentEncoding))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Encoding")
                    .unmarshallLocationName("Content-Encoding").build()).build();

    private static final SdkField CONTENT_LANGUAGE_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::contentLanguage))
            .setter(setter(Builder::contentLanguage))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Language")
                    .unmarshallLocationName("Content-Language").build()).build();

    private static final SdkField CONTENT_RANGE_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::contentRange))
            .setter(setter(Builder::contentRange))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Range")
                    .unmarshallLocationName("Content-Range").build()).build();

    private static final SdkField CONTENT_TYPE_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::contentType))
            .setter(setter(Builder::contentType))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Type")
                    .unmarshallLocationName("Content-Type").build()).build();

    private static final SdkField EXPIRES_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .getter(getter(GetObjectResponse::expires))
            .setter(setter(Builder::expires))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Expires")
                    .unmarshallLocationName("Expires").build()).build();

    private static final SdkField WEBSITE_REDIRECT_LOCATION_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::websiteRedirectLocation))
            .setter(setter(Builder::websiteRedirectLocation))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-website-redirect-location")
                    .unmarshallLocationName("x-amz-website-redirect-location").build()).build();

    private static final SdkField SERVER_SIDE_ENCRYPTION_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::serverSideEncryptionAsString))
            .setter(setter(Builder::serverSideEncryption))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-server-side-encryption")
                    .unmarshallLocationName("x-amz-server-side-encryption").build()).build();

    private static final SdkField> METADATA_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .getter(getter(GetObjectResponse::metadata))
            .setter(setter(Builder::metadata))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-meta-")
                    .unmarshallLocationName("x-amz-meta-").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").unmarshallLocationName("value").build()).build())
                            .build()).build();

    private static final SdkField SSE_CUSTOMER_ALGORITHM_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::sseCustomerAlgorithm))
            .setter(setter(Builder::sseCustomerAlgorithm))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
                    .locationName("x-amz-server-side-encryption-customer-algorithm")
                    .unmarshallLocationName("x-amz-server-side-encryption-customer-algorithm").build()).build();

    private static final SdkField SSE_CUSTOMER_KEY_MD5_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::sseCustomerKeyMD5))
            .setter(setter(Builder::sseCustomerKeyMD5))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
                    .locationName("x-amz-server-side-encryption-customer-key-MD5")
                    .unmarshallLocationName("x-amz-server-side-encryption-customer-key-MD5").build()).build();

    private static final SdkField SSEKMS_KEY_ID_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::ssekmsKeyId))
            .setter(setter(Builder::ssekmsKeyId))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER)
                    .locationName("x-amz-server-side-encryption-aws-kms-key-id")
                    .unmarshallLocationName("x-amz-server-side-encryption-aws-kms-key-id").build()).build();

    private static final SdkField STORAGE_CLASS_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::storageClassAsString))
            .setter(setter(Builder::storageClass))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-storage-class")
                    .unmarshallLocationName("x-amz-storage-class").build()).build();

    private static final SdkField REQUEST_CHARGED_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::requestChargedAsString))
            .setter(setter(Builder::requestCharged))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-request-charged")
                    .unmarshallLocationName("x-amz-request-charged").build()).build();

    private static final SdkField REPLICATION_STATUS_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::replicationStatusAsString))
            .setter(setter(Builder::replicationStatus))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-replication-status")
                    .unmarshallLocationName("x-amz-replication-status").build()).build();

    private static final SdkField PARTS_COUNT_FIELD = SdkField
            . builder(MarshallingType.INTEGER)
            .getter(getter(GetObjectResponse::partsCount))
            .setter(setter(Builder::partsCount))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-mp-parts-count")
                    .unmarshallLocationName("x-amz-mp-parts-count").build()).build();

    private static final SdkField TAG_COUNT_FIELD = SdkField
            . builder(MarshallingType.INTEGER)
            .getter(getter(GetObjectResponse::tagCount))
            .setter(setter(Builder::tagCount))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-tagging-count")
                    .unmarshallLocationName("x-amz-tagging-count").build()).build();

    private static final SdkField OBJECT_LOCK_MODE_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::objectLockModeAsString))
            .setter(setter(Builder::objectLockMode))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-object-lock-mode")
                    .unmarshallLocationName("x-amz-object-lock-mode").build()).build();

    private static final SdkField OBJECT_LOCK_RETAIN_UNTIL_DATE_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .getter(getter(GetObjectResponse::objectLockRetainUntilDate))
            .setter(setter(Builder::objectLockRetainUntilDate))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-object-lock-retain-until-date")
                    .unmarshallLocationName("x-amz-object-lock-retain-until-date").build(),
                    TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();

    private static final SdkField OBJECT_LOCK_LEGAL_HOLD_STATUS_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(GetObjectResponse::objectLockLegalHoldStatusAsString))
            .setter(setter(Builder::objectLockLegalHoldStatus))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-object-lock-legal-hold")
                    .unmarshallLocationName("x-amz-object-lock-legal-hold").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DELETE_MARKER_FIELD,
            ACCEPT_RANGES_FIELD, EXPIRATION_FIELD, RESTORE_FIELD, LAST_MODIFIED_FIELD, CONTENT_LENGTH_FIELD, E_TAG_FIELD,
            MISSING_META_FIELD, VERSION_ID_FIELD, CACHE_CONTROL_FIELD, CONTENT_DISPOSITION_FIELD, CONTENT_ENCODING_FIELD,
            CONTENT_LANGUAGE_FIELD, CONTENT_RANGE_FIELD, CONTENT_TYPE_FIELD, EXPIRES_FIELD, WEBSITE_REDIRECT_LOCATION_FIELD,
            SERVER_SIDE_ENCRYPTION_FIELD, METADATA_FIELD, SSE_CUSTOMER_ALGORITHM_FIELD, SSE_CUSTOMER_KEY_MD5_FIELD,
            SSEKMS_KEY_ID_FIELD, STORAGE_CLASS_FIELD, REQUEST_CHARGED_FIELD, REPLICATION_STATUS_FIELD, PARTS_COUNT_FIELD,
            TAG_COUNT_FIELD, OBJECT_LOCK_MODE_FIELD, OBJECT_LOCK_RETAIN_UNTIL_DATE_FIELD, OBJECT_LOCK_LEGAL_HOLD_STATUS_FIELD));

    private final Boolean deleteMarker;

    private final String acceptRanges;

    private final String expiration;

    private final String restore;

    private final Instant lastModified;

    private final Long contentLength;

    private final String eTag;

    private final Integer missingMeta;

    private final String versionId;

    private final String cacheControl;

    private final String contentDisposition;

    private final String contentEncoding;

    private final String contentLanguage;

    private final String contentRange;

    private final String contentType;

    private final Instant expires;

    private final String websiteRedirectLocation;

    private final String serverSideEncryption;

    private final Map metadata;

    private final String sseCustomerAlgorithm;

    private final String sseCustomerKeyMD5;

    private final String ssekmsKeyId;

    private final String storageClass;

    private final String requestCharged;

    private final String replicationStatus;

    private final Integer partsCount;

    private final Integer tagCount;

    private final String objectLockMode;

    private final Instant objectLockRetainUntilDate;

    private final String objectLockLegalHoldStatus;

    private GetObjectResponse(BuilderImpl builder) {
        super(builder);
        this.deleteMarker = builder.deleteMarker;
        this.acceptRanges = builder.acceptRanges;
        this.expiration = builder.expiration;
        this.restore = builder.restore;
        this.lastModified = builder.lastModified;
        this.contentLength = builder.contentLength;
        this.eTag = builder.eTag;
        this.missingMeta = builder.missingMeta;
        this.versionId = builder.versionId;
        this.cacheControl = builder.cacheControl;
        this.contentDisposition = builder.contentDisposition;
        this.contentEncoding = builder.contentEncoding;
        this.contentLanguage = builder.contentLanguage;
        this.contentRange = builder.contentRange;
        this.contentType = builder.contentType;
        this.expires = builder.expires;
        this.websiteRedirectLocation = builder.websiteRedirectLocation;
        this.serverSideEncryption = builder.serverSideEncryption;
        this.metadata = builder.metadata;
        this.sseCustomerAlgorithm = builder.sseCustomerAlgorithm;
        this.sseCustomerKeyMD5 = builder.sseCustomerKeyMD5;
        this.ssekmsKeyId = builder.ssekmsKeyId;
        this.storageClass = builder.storageClass;
        this.requestCharged = builder.requestCharged;
        this.replicationStatus = builder.replicationStatus;
        this.partsCount = builder.partsCount;
        this.tagCount = builder.tagCount;
        this.objectLockMode = builder.objectLockMode;
        this.objectLockRetainUntilDate = builder.objectLockRetainUntilDate;
        this.objectLockLegalHoldStatus = builder.objectLockLegalHoldStatus;
    }

    /**
     * 

* Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this response * header does not appear in the response. *

* * @return Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this * response header does not appear in the response. */ public Boolean deleteMarker() { return deleteMarker; } /** *

* * @return */ public String acceptRanges() { return acceptRanges; } /** *

* If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. It includes * the expiry-date and rule-id key value pairs providing object expiration information. The value of the rule-id is * URL encoded. *

* * @return If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. It * includes the expiry-date and rule-id key value pairs providing object expiration information. The value * of the rule-id is URL encoded. */ public String expiration() { return expiration; } /** *

* Provides information about object restoration operation and expiration time of the restored object copy. *

* * @return Provides information about object restoration operation and expiration time of the restored object copy. */ public String restore() { return restore; } /** *

* Last modified date of the object *

* * @return Last modified date of the object */ public Instant lastModified() { return lastModified; } /** *

* Size of the body in bytes. *

* * @return Size of the body in bytes. */ public Long contentLength() { return contentLength; } /** *

* An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL *

* * @return An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a * URL */ public String eTag() { return eTag; } /** *

* This is set to the number of metadata entries not returned in x-amz-meta headers. This can happen if you create * metadata using an API like SOAP that supports more flexible metadata than the REST API. For example, using SOAP, * you can create metadata whose values are not legal HTTP headers. *

* * @return This is set to the number of metadata entries not returned in x-amz-meta headers. This can happen if you * create metadata using an API like SOAP that supports more flexible metadata than the REST API. For * example, using SOAP, you can create metadata whose values are not legal HTTP headers. */ public Integer missingMeta() { return missingMeta; } /** *

* Version of the object. *

* * @return Version of the object. */ public String versionId() { return versionId; } /** *

* Specifies caching behavior along the request/reply chain. *

* * @return Specifies caching behavior along the request/reply chain. */ public String cacheControl() { return cacheControl; } /** *

* Specifies presentational information for the object. *

* * @return Specifies presentational information for the object. */ public String contentDisposition() { return contentDisposition; } /** *

* Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be * applied to obtain the media-type referenced by the Content-Type header field. *

* * @return Specifies what content encodings have been applied to the object and thus what decoding mechanisms must * be applied to obtain the media-type referenced by the Content-Type header field. */ public String contentEncoding() { return contentEncoding; } /** *

* The language the content is in. *

* * @return The language the content is in. */ public String contentLanguage() { return contentLanguage; } /** *

* The portion of the object returned in the response. *

* * @return The portion of the object returned in the response. */ public String contentRange() { return contentRange; } /** *

* A standard MIME type describing the format of the object data. *

* * @return A standard MIME type describing the format of the object data. */ public String contentType() { return contentType; } /** *

* The date and time at which the object is no longer cacheable. *

* * @return The date and time at which the object is no longer cacheable. */ public Instant expires() { return expires; } /** *

* If the bucket is configured as a website, redirects requests for this object to another object in the same bucket * or to an external URL. Amazon S3 stores the value of this header in the object metadata. *

* * @return If the bucket is configured as a website, redirects requests for this object to another object in the * same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata. */ public String websiteRedirectLocation() { return websiteRedirectLocation; } /** *

* The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #serverSideEncryption} will return {@link ServerSideEncryption#UNKNOWN_TO_SDK_VERSION}. The raw value * returned by the service is available from {@link #serverSideEncryptionAsString}. *

* * @return The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). * @see ServerSideEncryption */ public ServerSideEncryption serverSideEncryption() { return ServerSideEncryption.fromValue(serverSideEncryption); } /** *

* The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #serverSideEncryption} will return {@link ServerSideEncryption#UNKNOWN_TO_SDK_VERSION}. The raw value * returned by the service is available from {@link #serverSideEncryptionAsString}. *

* * @return The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). * @see ServerSideEncryption */ public String serverSideEncryptionAsString() { return serverSideEncryption; } /** *

* A map of metadata to store with the object in S3. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

* * @return A map of metadata to store with the object in S3. */ public Map metadata() { return metadata; } /** *

* If server-side encryption with a customer-provided encryption key was requested, the response will include this * header confirming the encryption algorithm used. *

* * @return If server-side encryption with a customer-provided encryption key was requested, the response will * include this header confirming the encryption algorithm used. */ public String sseCustomerAlgorithm() { return sseCustomerAlgorithm; } /** *

* If server-side encryption with a customer-provided encryption key was requested, the response will include this * header to provide round trip message integrity verification of the customer-provided encryption key. *

* * @return If server-side encryption with a customer-provided encryption key was requested, the response will * include this header to provide round trip message integrity verification of the customer-provided * encryption key. */ public String sseCustomerKeyMD5() { return sseCustomerKeyMD5; } /** *

* If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the * object. *

* * @return If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used * for the object. */ public String ssekmsKeyId() { return ssekmsKeyId; } /** *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #storageClass} will * return {@link StorageClass#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #storageClassAsString}. *

* * @return * @see StorageClass */ public StorageClass storageClass() { return StorageClass.fromValue(storageClass); } /** *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #storageClass} will * return {@link StorageClass#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #storageClassAsString}. *

* * @return * @see StorageClass */ public String storageClassAsString() { return storageClass; } /** * Returns the value of the RequestCharged property for this object. *

* If the service returns an enum value that is not available in the current SDK version, {@link #requestCharged} * will return {@link RequestCharged#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #requestChargedAsString}. *

* * @return The value of the RequestCharged property for this object. * @see RequestCharged */ public RequestCharged requestCharged() { return RequestCharged.fromValue(requestCharged); } /** * Returns the value of the RequestCharged property for this object. *

* If the service returns an enum value that is not available in the current SDK version, {@link #requestCharged} * will return {@link RequestCharged#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #requestChargedAsString}. *

* * @return The value of the RequestCharged property for this object. * @see RequestCharged */ public String requestChargedAsString() { return requestCharged; } /** *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #replicationStatus} * will return {@link ReplicationStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #replicationStatusAsString}. *

* * @return * @see ReplicationStatus */ public ReplicationStatus replicationStatus() { return ReplicationStatus.fromValue(replicationStatus); } /** *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #replicationStatus} * will return {@link ReplicationStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #replicationStatusAsString}. *

* * @return * @see ReplicationStatus */ public String replicationStatusAsString() { return replicationStatus; } /** *

* The count of parts this object has. *

* * @return The count of parts this object has. */ public Integer partsCount() { return partsCount; } /** *

* The number of tags, if any, on the object. *

* * @return The number of tags, if any, on the object. */ public Integer tagCount() { return tagCount; } /** *

* The Object Lock mode currently in place for this object. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #objectLockMode} * will return {@link ObjectLockMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #objectLockModeAsString}. *

* * @return The Object Lock mode currently in place for this object. * @see ObjectLockMode */ public ObjectLockMode objectLockMode() { return ObjectLockMode.fromValue(objectLockMode); } /** *

* The Object Lock mode currently in place for this object. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #objectLockMode} * will return {@link ObjectLockMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #objectLockModeAsString}. *

* * @return The Object Lock mode currently in place for this object. * @see ObjectLockMode */ public String objectLockModeAsString() { return objectLockMode; } /** *

* The date and time when this object's Object Lock will expire. *

* * @return The date and time when this object's Object Lock will expire. */ public Instant objectLockRetainUntilDate() { return objectLockRetainUntilDate; } /** *

* Indicates whether this object has an active legal hold. This field is only returned if you have permission to * view an object's legal hold status. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #objectLockLegalHoldStatus} will return {@link ObjectLockLegalHoldStatus#UNKNOWN_TO_SDK_VERSION}. The raw * value returned by the service is available from {@link #objectLockLegalHoldStatusAsString}. *

* * @return Indicates whether this object has an active legal hold. This field is only returned if you have * permission to view an object's legal hold status. * @see ObjectLockLegalHoldStatus */ public ObjectLockLegalHoldStatus objectLockLegalHoldStatus() { return ObjectLockLegalHoldStatus.fromValue(objectLockLegalHoldStatus); } /** *

* Indicates whether this object has an active legal hold. This field is only returned if you have permission to * view an object's legal hold status. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #objectLockLegalHoldStatus} will return {@link ObjectLockLegalHoldStatus#UNKNOWN_TO_SDK_VERSION}. The raw * value returned by the service is available from {@link #objectLockLegalHoldStatusAsString}. *

* * @return Indicates whether this object has an active legal hold. This field is only returned if you have * permission to view an object's legal hold status. * @see ObjectLockLegalHoldStatus */ public String objectLockLegalHoldStatusAsString() { return objectLockLegalHoldStatus; } @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 + Objects.hashCode(deleteMarker()); hashCode = 31 * hashCode + Objects.hashCode(acceptRanges()); hashCode = 31 * hashCode + Objects.hashCode(expiration()); hashCode = 31 * hashCode + Objects.hashCode(restore()); hashCode = 31 * hashCode + Objects.hashCode(lastModified()); hashCode = 31 * hashCode + Objects.hashCode(contentLength()); hashCode = 31 * hashCode + Objects.hashCode(eTag()); hashCode = 31 * hashCode + Objects.hashCode(missingMeta()); hashCode = 31 * hashCode + Objects.hashCode(versionId()); hashCode = 31 * hashCode + Objects.hashCode(cacheControl()); hashCode = 31 * hashCode + Objects.hashCode(contentDisposition()); hashCode = 31 * hashCode + Objects.hashCode(contentEncoding()); hashCode = 31 * hashCode + Objects.hashCode(contentLanguage()); hashCode = 31 * hashCode + Objects.hashCode(contentRange()); hashCode = 31 * hashCode + Objects.hashCode(contentType()); hashCode = 31 * hashCode + Objects.hashCode(expires()); hashCode = 31 * hashCode + Objects.hashCode(websiteRedirectLocation()); hashCode = 31 * hashCode + Objects.hashCode(serverSideEncryptionAsString()); hashCode = 31 * hashCode + Objects.hashCode(metadata()); hashCode = 31 * hashCode + Objects.hashCode(sseCustomerAlgorithm()); hashCode = 31 * hashCode + Objects.hashCode(sseCustomerKeyMD5()); hashCode = 31 * hashCode + Objects.hashCode(ssekmsKeyId()); hashCode = 31 * hashCode + Objects.hashCode(storageClassAsString()); hashCode = 31 * hashCode + Objects.hashCode(requestChargedAsString()); hashCode = 31 * hashCode + Objects.hashCode(replicationStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(partsCount()); hashCode = 31 * hashCode + Objects.hashCode(tagCount()); hashCode = 31 * hashCode + Objects.hashCode(objectLockModeAsString()); hashCode = 31 * hashCode + Objects.hashCode(objectLockRetainUntilDate()); hashCode = 31 * hashCode + Objects.hashCode(objectLockLegalHoldStatusAsString()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof GetObjectResponse)) { return false; } GetObjectResponse other = (GetObjectResponse) obj; return Objects.equals(deleteMarker(), other.deleteMarker()) && Objects.equals(acceptRanges(), other.acceptRanges()) && Objects.equals(expiration(), other.expiration()) && Objects.equals(restore(), other.restore()) && Objects.equals(lastModified(), other.lastModified()) && Objects.equals(contentLength(), other.contentLength()) && Objects.equals(eTag(), other.eTag()) && Objects.equals(missingMeta(), other.missingMeta()) && Objects.equals(versionId(), other.versionId()) && Objects.equals(cacheControl(), other.cacheControl()) && Objects.equals(contentDisposition(), other.contentDisposition()) && Objects.equals(contentEncoding(), other.contentEncoding()) && Objects.equals(contentLanguage(), other.contentLanguage()) && Objects.equals(contentRange(), other.contentRange()) && Objects.equals(contentType(), other.contentType()) && Objects.equals(expires(), other.expires()) && Objects.equals(websiteRedirectLocation(), other.websiteRedirectLocation()) && Objects.equals(serverSideEncryptionAsString(), other.serverSideEncryptionAsString()) && Objects.equals(metadata(), other.metadata()) && Objects.equals(sseCustomerAlgorithm(), other.sseCustomerAlgorithm()) && Objects.equals(sseCustomerKeyMD5(), other.sseCustomerKeyMD5()) && Objects.equals(ssekmsKeyId(), other.ssekmsKeyId()) && Objects.equals(storageClassAsString(), other.storageClassAsString()) && Objects.equals(requestChargedAsString(), other.requestChargedAsString()) && Objects.equals(replicationStatusAsString(), other.replicationStatusAsString()) && Objects.equals(partsCount(), other.partsCount()) && Objects.equals(tagCount(), other.tagCount()) && Objects.equals(objectLockModeAsString(), other.objectLockModeAsString()) && Objects.equals(objectLockRetainUntilDate(), other.objectLockRetainUntilDate()) && Objects.equals(objectLockLegalHoldStatusAsString(), other.objectLockLegalHoldStatusAsString()); } /** * 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 String toString() { return ToString.builder("GetObjectResponse").add("DeleteMarker", deleteMarker()).add("AcceptRanges", acceptRanges()) .add("Expiration", expiration()).add("Restore", restore()).add("LastModified", lastModified()) .add("ContentLength", contentLength()).add("ETag", eTag()).add("MissingMeta", missingMeta()) .add("VersionId", versionId()).add("CacheControl", cacheControl()) .add("ContentDisposition", contentDisposition()).add("ContentEncoding", contentEncoding()) .add("ContentLanguage", contentLanguage()).add("ContentRange", contentRange()).add("ContentType", contentType()) .add("Expires", expires()).add("WebsiteRedirectLocation", websiteRedirectLocation()) .add("ServerSideEncryption", serverSideEncryptionAsString()).add("Metadata", metadata()) .add("SSECustomerAlgorithm", sseCustomerAlgorithm()).add("SSECustomerKeyMD5", sseCustomerKeyMD5()) .add("SSEKMSKeyId", ssekmsKeyId() == null ? null : "*** Sensitive Data Redacted ***") .add("StorageClass", storageClassAsString()).add("RequestCharged", requestChargedAsString()) .add("ReplicationStatus", replicationStatusAsString()).add("PartsCount", partsCount()) .add("TagCount", tagCount()).add("ObjectLockMode", objectLockModeAsString()) .add("ObjectLockRetainUntilDate", objectLockRetainUntilDate()) .add("ObjectLockLegalHoldStatus", objectLockLegalHoldStatusAsString()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "DeleteMarker": return Optional.ofNullable(clazz.cast(deleteMarker())); case "AcceptRanges": return Optional.ofNullable(clazz.cast(acceptRanges())); case "Expiration": return Optional.ofNullable(clazz.cast(expiration())); case "Restore": return Optional.ofNullable(clazz.cast(restore())); case "LastModified": return Optional.ofNullable(clazz.cast(lastModified())); case "ContentLength": return Optional.ofNullable(clazz.cast(contentLength())); case "ETag": return Optional.ofNullable(clazz.cast(eTag())); case "MissingMeta": return Optional.ofNullable(clazz.cast(missingMeta())); case "VersionId": return Optional.ofNullable(clazz.cast(versionId())); case "CacheControl": return Optional.ofNullable(clazz.cast(cacheControl())); case "ContentDisposition": return Optional.ofNullable(clazz.cast(contentDisposition())); case "ContentEncoding": return Optional.ofNullable(clazz.cast(contentEncoding())); case "ContentLanguage": return Optional.ofNullable(clazz.cast(contentLanguage())); case "ContentRange": return Optional.ofNullable(clazz.cast(contentRange())); case "ContentType": return Optional.ofNullable(clazz.cast(contentType())); case "Expires": return Optional.ofNullable(clazz.cast(expires())); case "WebsiteRedirectLocation": return Optional.ofNullable(clazz.cast(websiteRedirectLocation())); case "ServerSideEncryption": return Optional.ofNullable(clazz.cast(serverSideEncryptionAsString())); case "Metadata": return Optional.ofNullable(clazz.cast(metadata())); case "SSECustomerAlgorithm": return Optional.ofNullable(clazz.cast(sseCustomerAlgorithm())); case "SSECustomerKeyMD5": return Optional.ofNullable(clazz.cast(sseCustomerKeyMD5())); case "SSEKMSKeyId": return Optional.ofNullable(clazz.cast(ssekmsKeyId())); case "StorageClass": return Optional.ofNullable(clazz.cast(storageClassAsString())); case "RequestCharged": return Optional.ofNullable(clazz.cast(requestChargedAsString())); case "ReplicationStatus": return Optional.ofNullable(clazz.cast(replicationStatusAsString())); case "PartsCount": return Optional.ofNullable(clazz.cast(partsCount())); case "TagCount": return Optional.ofNullable(clazz.cast(tagCount())); case "ObjectLockMode": return Optional.ofNullable(clazz.cast(objectLockModeAsString())); case "ObjectLockRetainUntilDate": return Optional.ofNullable(clazz.cast(objectLockRetainUntilDate())); case "ObjectLockLegalHoldStatus": return Optional.ofNullable(clazz.cast(objectLockLegalHoldStatusAsString())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((GetObjectResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends S3Response.Builder, SdkPojo, CopyableBuilder { /** *

* Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this response * header does not appear in the response. *

* * @param deleteMarker * Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this * response header does not appear in the response. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deleteMarker(Boolean deleteMarker); /** *

* * @param acceptRanges * @return Returns a reference to this object so that method calls can be chained together. */ Builder acceptRanges(String acceptRanges); /** *

* If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. It * includes the expiry-date and rule-id key value pairs providing object expiration information. The value of * the rule-id is URL encoded. *

* * @param expiration * If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. * It includes the expiry-date and rule-id key value pairs providing object expiration information. The * value of the rule-id is URL encoded. * @return Returns a reference to this object so that method calls can be chained together. */ Builder expiration(String expiration); /** *

* Provides information about object restoration operation and expiration time of the restored object copy. *

* * @param restore * Provides information about object restoration operation and expiration time of the restored object * copy. * @return Returns a reference to this object so that method calls can be chained together. */ Builder restore(String restore); /** *

* Last modified date of the object *

* * @param lastModified * Last modified date of the object * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModified(Instant lastModified); /** *

* Size of the body in bytes. *

* * @param contentLength * Size of the body in bytes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder contentLength(Long contentLength); /** *

* An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL *

* * @param eTag * An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at * a URL * @return Returns a reference to this object so that method calls can be chained together. */ Builder eTag(String eTag); /** *

* This is set to the number of metadata entries not returned in x-amz-meta headers. This can happen if you * create metadata using an API like SOAP that supports more flexible metadata than the REST API. For example, * using SOAP, you can create metadata whose values are not legal HTTP headers. *

* * @param missingMeta * This is set to the number of metadata entries not returned in x-amz-meta headers. This can happen if * you create metadata using an API like SOAP that supports more flexible metadata than the REST API. For * example, using SOAP, you can create metadata whose values are not legal HTTP headers. * @return Returns a reference to this object so that method calls can be chained together. */ Builder missingMeta(Integer missingMeta); /** *

* Version of the object. *

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

* Specifies caching behavior along the request/reply chain. *

* * @param cacheControl * Specifies caching behavior along the request/reply chain. * @return Returns a reference to this object so that method calls can be chained together. */ Builder cacheControl(String cacheControl); /** *

* Specifies presentational information for the object. *

* * @param contentDisposition * Specifies presentational information for the object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder contentDisposition(String contentDisposition); /** *

* Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be * applied to obtain the media-type referenced by the Content-Type header field. *

* * @param contentEncoding * Specifies what content encodings have been applied to the object and thus what decoding mechanisms * must be applied to obtain the media-type referenced by the Content-Type header field. * @return Returns a reference to this object so that method calls can be chained together. */ Builder contentEncoding(String contentEncoding); /** *

* The language the content is in. *

* * @param contentLanguage * The language the content is in. * @return Returns a reference to this object so that method calls can be chained together. */ Builder contentLanguage(String contentLanguage); /** *

* The portion of the object returned in the response. *

* * @param contentRange * The portion of the object returned in the response. * @return Returns a reference to this object so that method calls can be chained together. */ Builder contentRange(String contentRange); /** *

* A standard MIME type describing the format of the object data. *

* * @param contentType * A standard MIME type describing the format of the object data. * @return Returns a reference to this object so that method calls can be chained together. */ Builder contentType(String contentType); /** *

* The date and time at which the object is no longer cacheable. *

* * @param expires * The date and time at which the object is no longer cacheable. * @return Returns a reference to this object so that method calls can be chained together. */ Builder expires(Instant expires); /** *

* If the bucket is configured as a website, redirects requests for this object to another object in the same * bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata. *

* * @param websiteRedirectLocation * If the bucket is configured as a website, redirects requests for this object to another object in the * same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata. * @return Returns a reference to this object so that method calls can be chained together. */ Builder websiteRedirectLocation(String websiteRedirectLocation); /** *

* The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). *

* * @param serverSideEncryption * The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). * @see ServerSideEncryption * @return Returns a reference to this object so that method calls can be chained together. * @see ServerSideEncryption */ Builder serverSideEncryption(String serverSideEncryption); /** *

* The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). *

* * @param serverSideEncryption * The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). * @see ServerSideEncryption * @return Returns a reference to this object so that method calls can be chained together. * @see ServerSideEncryption */ Builder serverSideEncryption(ServerSideEncryption serverSideEncryption); /** *

* A map of metadata to store with the object in S3. *

* * @param metadata * A map of metadata to store with the object in S3. * @return Returns a reference to this object so that method calls can be chained together. */ Builder metadata(Map metadata); /** *

* If server-side encryption with a customer-provided encryption key was requested, the response will include * this header confirming the encryption algorithm used. *

* * @param sseCustomerAlgorithm * If server-side encryption with a customer-provided encryption key was requested, the response will * include this header confirming the encryption algorithm used. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sseCustomerAlgorithm(String sseCustomerAlgorithm); /** *

* If server-side encryption with a customer-provided encryption key was requested, the response will include * this header to provide round trip message integrity verification of the customer-provided encryption key. *

* * @param sseCustomerKeyMD5 * If server-side encryption with a customer-provided encryption key was requested, the response will * include this header to provide round trip message integrity verification of the customer-provided * encryption key. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sseCustomerKeyMD5(String sseCustomerKeyMD5); /** *

* If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for * the object. *

* * @param ssekmsKeyId * If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was * used for the object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ssekmsKeyId(String ssekmsKeyId); /** *

* * @param storageClass * @see StorageClass * @return Returns a reference to this object so that method calls can be chained together. * @see StorageClass */ Builder storageClass(String storageClass); /** *

* * @param storageClass * @see StorageClass * @return Returns a reference to this object so that method calls can be chained together. * @see StorageClass */ Builder storageClass(StorageClass storageClass); /** * Sets the value of the RequestCharged property for this object. * * @param requestCharged * The new value for the RequestCharged property for this object. * @see RequestCharged * @return Returns a reference to this object so that method calls can be chained together. * @see RequestCharged */ Builder requestCharged(String requestCharged); /** * Sets the value of the RequestCharged property for this object. * * @param requestCharged * The new value for the RequestCharged property for this object. * @see RequestCharged * @return Returns a reference to this object so that method calls can be chained together. * @see RequestCharged */ Builder requestCharged(RequestCharged requestCharged); /** *

* * @param replicationStatus * @see ReplicationStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ReplicationStatus */ Builder replicationStatus(String replicationStatus); /** *

* * @param replicationStatus * @see ReplicationStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ReplicationStatus */ Builder replicationStatus(ReplicationStatus replicationStatus); /** *

* The count of parts this object has. *

* * @param partsCount * The count of parts this object has. * @return Returns a reference to this object so that method calls can be chained together. */ Builder partsCount(Integer partsCount); /** *

* The number of tags, if any, on the object. *

* * @param tagCount * The number of tags, if any, on the object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tagCount(Integer tagCount); /** *

* The Object Lock mode currently in place for this object. *

* * @param objectLockMode * The Object Lock mode currently in place for this object. * @see ObjectLockMode * @return Returns a reference to this object so that method calls can be chained together. * @see ObjectLockMode */ Builder objectLockMode(String objectLockMode); /** *

* The Object Lock mode currently in place for this object. *

* * @param objectLockMode * The Object Lock mode currently in place for this object. * @see ObjectLockMode * @return Returns a reference to this object so that method calls can be chained together. * @see ObjectLockMode */ Builder objectLockMode(ObjectLockMode objectLockMode); /** *

* The date and time when this object's Object Lock will expire. *

* * @param objectLockRetainUntilDate * The date and time when this object's Object Lock will expire. * @return Returns a reference to this object so that method calls can be chained together. */ Builder objectLockRetainUntilDate(Instant objectLockRetainUntilDate); /** *

* Indicates whether this object has an active legal hold. This field is only returned if you have permission to * view an object's legal hold status. *

* * @param objectLockLegalHoldStatus * Indicates whether this object has an active legal hold. This field is only returned if you have * permission to view an object's legal hold status. * @see ObjectLockLegalHoldStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ObjectLockLegalHoldStatus */ Builder objectLockLegalHoldStatus(String objectLockLegalHoldStatus); /** *

* Indicates whether this object has an active legal hold. This field is only returned if you have permission to * view an object's legal hold status. *

* * @param objectLockLegalHoldStatus * Indicates whether this object has an active legal hold. This field is only returned if you have * permission to view an object's legal hold status. * @see ObjectLockLegalHoldStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ObjectLockLegalHoldStatus */ Builder objectLockLegalHoldStatus(ObjectLockLegalHoldStatus objectLockLegalHoldStatus); } static final class BuilderImpl extends S3Response.BuilderImpl implements Builder { private Boolean deleteMarker; private String acceptRanges; private String expiration; private String restore; private Instant lastModified; private Long contentLength; private String eTag; private Integer missingMeta; private String versionId; private String cacheControl; private String contentDisposition; private String contentEncoding; private String contentLanguage; private String contentRange; private String contentType; private Instant expires; private String websiteRedirectLocation; private String serverSideEncryption; private Map metadata = DefaultSdkAutoConstructMap.getInstance(); private String sseCustomerAlgorithm; private String sseCustomerKeyMD5; private String ssekmsKeyId; private String storageClass; private String requestCharged; private String replicationStatus; private Integer partsCount; private Integer tagCount; private String objectLockMode; private Instant objectLockRetainUntilDate; private String objectLockLegalHoldStatus; private BuilderImpl() { } private BuilderImpl(GetObjectResponse model) { super(model); deleteMarker(model.deleteMarker); acceptRanges(model.acceptRanges); expiration(model.expiration); restore(model.restore); lastModified(model.lastModified); contentLength(model.contentLength); eTag(model.eTag); missingMeta(model.missingMeta); versionId(model.versionId); cacheControl(model.cacheControl); contentDisposition(model.contentDisposition); contentEncoding(model.contentEncoding); contentLanguage(model.contentLanguage); contentRange(model.contentRange); contentType(model.contentType); expires(model.expires); websiteRedirectLocation(model.websiteRedirectLocation); serverSideEncryption(model.serverSideEncryption); metadata(model.metadata); sseCustomerAlgorithm(model.sseCustomerAlgorithm); sseCustomerKeyMD5(model.sseCustomerKeyMD5); ssekmsKeyId(model.ssekmsKeyId); storageClass(model.storageClass); requestCharged(model.requestCharged); replicationStatus(model.replicationStatus); partsCount(model.partsCount); tagCount(model.tagCount); objectLockMode(model.objectLockMode); objectLockRetainUntilDate(model.objectLockRetainUntilDate); objectLockLegalHoldStatus(model.objectLockLegalHoldStatus); } public final Boolean getDeleteMarker() { return deleteMarker; } @Override public final Builder deleteMarker(Boolean deleteMarker) { this.deleteMarker = deleteMarker; return this; } public final void setDeleteMarker(Boolean deleteMarker) { this.deleteMarker = deleteMarker; } public final String getAcceptRanges() { return acceptRanges; } @Override public final Builder acceptRanges(String acceptRanges) { this.acceptRanges = acceptRanges; return this; } public final void setAcceptRanges(String acceptRanges) { this.acceptRanges = acceptRanges; } public final String getExpiration() { return expiration; } @Override public final Builder expiration(String expiration) { this.expiration = expiration; return this; } public final void setExpiration(String expiration) { this.expiration = expiration; } public final String getRestore() { return restore; } @Override public final Builder restore(String restore) { this.restore = restore; return this; } public final void setRestore(String restore) { this.restore = restore; } public final Instant getLastModified() { return lastModified; } @Override public final Builder lastModified(Instant lastModified) { this.lastModified = lastModified; return this; } public final void setLastModified(Instant lastModified) { this.lastModified = lastModified; } public final Long getContentLength() { return contentLength; } @Override public final Builder contentLength(Long contentLength) { this.contentLength = contentLength; return this; } public final void setContentLength(Long contentLength) { this.contentLength = contentLength; } public final String getETag() { return eTag; } @Override public final Builder eTag(String eTag) { this.eTag = eTag; return this; } public final void setETag(String eTag) { this.eTag = eTag; } public final Integer getMissingMeta() { return missingMeta; } @Override public final Builder missingMeta(Integer missingMeta) { this.missingMeta = missingMeta; return this; } public final void setMissingMeta(Integer missingMeta) { this.missingMeta = missingMeta; } public final String getVersionId() { return versionId; } @Override public final Builder versionId(String versionId) { this.versionId = versionId; return this; } public final void setVersionId(String versionId) { this.versionId = versionId; } public final String getCacheControl() { return cacheControl; } @Override public final Builder cacheControl(String cacheControl) { this.cacheControl = cacheControl; return this; } public final void setCacheControl(String cacheControl) { this.cacheControl = cacheControl; } public final String getContentDisposition() { return contentDisposition; } @Override public final Builder contentDisposition(String contentDisposition) { this.contentDisposition = contentDisposition; return this; } public final void setContentDisposition(String contentDisposition) { this.contentDisposition = contentDisposition; } public final String getContentEncoding() { return contentEncoding; } @Override public final Builder contentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } public final void setContentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; } public final String getContentLanguage() { return contentLanguage; } @Override public final Builder contentLanguage(String contentLanguage) { this.contentLanguage = contentLanguage; return this; } public final void setContentLanguage(String contentLanguage) { this.contentLanguage = contentLanguage; } public final String getContentRange() { return contentRange; } @Override public final Builder contentRange(String contentRange) { this.contentRange = contentRange; return this; } public final void setContentRange(String contentRange) { this.contentRange = contentRange; } public final String getContentType() { return contentType; } @Override public final Builder contentType(String contentType) { this.contentType = contentType; return this; } public final void setContentType(String contentType) { this.contentType = contentType; } public final Instant getExpires() { return expires; } @Override public final Builder expires(Instant expires) { this.expires = expires; return this; } public final void setExpires(Instant expires) { this.expires = expires; } public final String getWebsiteRedirectLocation() { return websiteRedirectLocation; } @Override public final Builder websiteRedirectLocation(String websiteRedirectLocation) { this.websiteRedirectLocation = websiteRedirectLocation; return this; } public final void setWebsiteRedirectLocation(String websiteRedirectLocation) { this.websiteRedirectLocation = websiteRedirectLocation; } public final String getServerSideEncryptionAsString() { return serverSideEncryption; } @Override public final Builder serverSideEncryption(String serverSideEncryption) { this.serverSideEncryption = serverSideEncryption; return this; } @Override public final Builder serverSideEncryption(ServerSideEncryption serverSideEncryption) { this.serverSideEncryption(serverSideEncryption.toString()); return this; } public final void setServerSideEncryption(String serverSideEncryption) { this.serverSideEncryption = serverSideEncryption; } public final Map getMetadata() { return metadata; } @Override public final Builder metadata(Map metadata) { this.metadata = MetadataCopier.copy(metadata); return this; } public final void setMetadata(Map metadata) { this.metadata = MetadataCopier.copy(metadata); } public final String getSseCustomerAlgorithm() { return sseCustomerAlgorithm; } @Override public final Builder sseCustomerAlgorithm(String sseCustomerAlgorithm) { this.sseCustomerAlgorithm = sseCustomerAlgorithm; return this; } public final void setSseCustomerAlgorithm(String sseCustomerAlgorithm) { this.sseCustomerAlgorithm = sseCustomerAlgorithm; } public final String getSseCustomerKeyMD5() { return sseCustomerKeyMD5; } @Override public final Builder sseCustomerKeyMD5(String sseCustomerKeyMD5) { this.sseCustomerKeyMD5 = sseCustomerKeyMD5; return this; } public final void setSseCustomerKeyMD5(String sseCustomerKeyMD5) { this.sseCustomerKeyMD5 = sseCustomerKeyMD5; } public final String getSsekmsKeyId() { return ssekmsKeyId; } @Override public final Builder ssekmsKeyId(String ssekmsKeyId) { this.ssekmsKeyId = ssekmsKeyId; return this; } public final void setSsekmsKeyId(String ssekmsKeyId) { this.ssekmsKeyId = ssekmsKeyId; } public final String getStorageClassAsString() { return storageClass; } @Override public final Builder storageClass(String storageClass) { this.storageClass = storageClass; return this; } @Override public final Builder storageClass(StorageClass storageClass) { this.storageClass(storageClass.toString()); return this; } public final void setStorageClass(String storageClass) { this.storageClass = storageClass; } public final String getRequestChargedAsString() { return requestCharged; } @Override public final Builder requestCharged(String requestCharged) { this.requestCharged = requestCharged; return this; } @Override public final Builder requestCharged(RequestCharged requestCharged) { this.requestCharged(requestCharged.toString()); return this; } public final void setRequestCharged(String requestCharged) { this.requestCharged = requestCharged; } public final String getReplicationStatusAsString() { return replicationStatus; } @Override public final Builder replicationStatus(String replicationStatus) { this.replicationStatus = replicationStatus; return this; } @Override public final Builder replicationStatus(ReplicationStatus replicationStatus) { this.replicationStatus(replicationStatus.toString()); return this; } public final void setReplicationStatus(String replicationStatus) { this.replicationStatus = replicationStatus; } public final Integer getPartsCount() { return partsCount; } @Override public final Builder partsCount(Integer partsCount) { this.partsCount = partsCount; return this; } public final void setPartsCount(Integer partsCount) { this.partsCount = partsCount; } public final Integer getTagCount() { return tagCount; } @Override public final Builder tagCount(Integer tagCount) { this.tagCount = tagCount; return this; } public final void setTagCount(Integer tagCount) { this.tagCount = tagCount; } public final String getObjectLockModeAsString() { return objectLockMode; } @Override public final Builder objectLockMode(String objectLockMode) { this.objectLockMode = objectLockMode; return this; } @Override public final Builder objectLockMode(ObjectLockMode objectLockMode) { this.objectLockMode(objectLockMode.toString()); return this; } public final void setObjectLockMode(String objectLockMode) { this.objectLockMode = objectLockMode; } public final Instant getObjectLockRetainUntilDate() { return objectLockRetainUntilDate; } @Override public final Builder objectLockRetainUntilDate(Instant objectLockRetainUntilDate) { this.objectLockRetainUntilDate = objectLockRetainUntilDate; return this; } public final void setObjectLockRetainUntilDate(Instant objectLockRetainUntilDate) { this.objectLockRetainUntilDate = objectLockRetainUntilDate; } public final String getObjectLockLegalHoldStatusAsString() { return objectLockLegalHoldStatus; } @Override public final Builder objectLockLegalHoldStatus(String objectLockLegalHoldStatus) { this.objectLockLegalHoldStatus = objectLockLegalHoldStatus; return this; } @Override public final Builder objectLockLegalHoldStatus(ObjectLockLegalHoldStatus objectLockLegalHoldStatus) { this.objectLockLegalHoldStatus(objectLockLegalHoldStatus.toString()); return this; } public final void setObjectLockLegalHoldStatus(String objectLockLegalHoldStatus) { this.objectLockLegalHoldStatus = objectLockLegalHoldStatus; } @Override public GetObjectResponse build() { return new GetObjectResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy