
software.amazon.awssdk.services.s3.model.ListObjectsResponse Maven / Gradle / Ivy
/*
* 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.s3.model;
import java.beans.Transient;
import java.util.Arrays;
import java.util.Collection;
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.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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 ListObjectsResponse extends S3Response implements
ToCopyableBuilder {
private static final SdkField IS_TRUNCATED_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("IsTruncated")
.getter(getter(ListObjectsResponse::isTruncated))
.setter(setter(Builder::isTruncated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IsTruncated")
.unmarshallLocationName("IsTruncated").build()).build();
private static final SdkField MARKER_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("Marker")
.getter(getter(ListObjectsResponse::marker))
.setter(setter(Builder::marker))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Marker")
.unmarshallLocationName("Marker").build()).build();
private static final SdkField NEXT_MARKER_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("NextMarker")
.getter(getter(ListObjectsResponse::nextMarker))
.setter(setter(Builder::nextMarker))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NextMarker")
.unmarshallLocationName("NextMarker").build()).build();
private static final SdkField> CONTENTS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Contents")
.getter(getter(ListObjectsResponse::contents))
.setter(setter(Builder::contents))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Contents")
.unmarshallLocationName("Contents").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(S3Object::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").unmarshallLocationName("member").build()).build())
.isFlattened(true).build()).build();
private static final SdkField NAME_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("Name")
.getter(getter(ListObjectsResponse::name))
.setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name")
.unmarshallLocationName("Name").build()).build();
private static final SdkField PREFIX_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("Prefix")
.getter(getter(ListObjectsResponse::prefix))
.setter(setter(Builder::prefix))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Prefix")
.unmarshallLocationName("Prefix").build()).build();
private static final SdkField DELIMITER_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("Delimiter")
.getter(getter(ListObjectsResponse::delimiter))
.setter(setter(Builder::delimiter))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Delimiter")
.unmarshallLocationName("Delimiter").build()).build();
private static final SdkField MAX_KEYS_FIELD = SdkField
. builder(MarshallingType.INTEGER)
.memberName("MaxKeys")
.getter(getter(ListObjectsResponse::maxKeys))
.setter(setter(Builder::maxKeys))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxKeys")
.unmarshallLocationName("MaxKeys").build()).build();
private static final SdkField> COMMON_PREFIXES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("CommonPrefixes")
.getter(getter(ListObjectsResponse::commonPrefixes))
.setter(setter(Builder::commonPrefixes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CommonPrefixes")
.unmarshallLocationName("CommonPrefixes").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(CommonPrefix::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").unmarshallLocationName("member").build()).build())
.isFlattened(true).build()).build();
private static final SdkField ENCODING_TYPE_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("EncodingType")
.getter(getter(ListObjectsResponse::encodingTypeAsString))
.setter(setter(Builder::encodingType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EncodingType")
.unmarshallLocationName("EncodingType").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(IS_TRUNCATED_FIELD,
MARKER_FIELD, NEXT_MARKER_FIELD, CONTENTS_FIELD, NAME_FIELD, PREFIX_FIELD, DELIMITER_FIELD, MAX_KEYS_FIELD,
COMMON_PREFIXES_FIELD, ENCODING_TYPE_FIELD));
private final Boolean isTruncated;
private final String marker;
private final String nextMarker;
private final List contents;
private final String name;
private final String prefix;
private final String delimiter;
private final Integer maxKeys;
private final List commonPrefixes;
private final String encodingType;
private ListObjectsResponse(BuilderImpl builder) {
super(builder);
this.isTruncated = builder.isTruncated;
this.marker = builder.marker;
this.nextMarker = builder.nextMarker;
this.contents = builder.contents;
this.name = builder.name;
this.prefix = builder.prefix;
this.delimiter = builder.delimiter;
this.maxKeys = builder.maxKeys;
this.commonPrefixes = builder.commonPrefixes;
this.encodingType = builder.encodingType;
}
/**
*
* A flag that indicates whether Amazon S3 returned all of the results that satisfied the search criteria.
*
*
* @return A flag that indicates whether Amazon S3 returned all of the results that satisfied the search criteria.
*/
public final Boolean isTruncated() {
return isTruncated;
}
/**
*
* Indicates where in the bucket listing begins. Marker is included in the response if it was sent with the request.
*
*
* @return Indicates where in the bucket listing begins. Marker is included in the response if it was sent with the
* request.
*/
public final String marker() {
return marker;
}
/**
*
* When response is truncated (the IsTruncated element value in the response is true), you can use the key name in
* this field as marker in the subsequent request to get next set of objects. Amazon S3 lists objects in
* alphabetical order Note: This element is returned only if you have delimiter request parameter specified. If
* response does not include the NextMarker and it is truncated, you can use the value of the last Key in the
* response as the marker in the subsequent request to get the next set of object keys.
*
*
* @return When response is truncated (the IsTruncated element value in the response is true), you can use the key
* name in this field as marker in the subsequent request to get next set of objects. Amazon S3 lists
* objects in alphabetical order Note: This element is returned only if you have delimiter request parameter
* specified. If response does not include the NextMarker and it is truncated, you can use the value of the
* last Key in the response as the marker in the subsequent request to get the next set of object keys.
*/
public final String nextMarker() {
return nextMarker;
}
/**
* For responses, this returns true if the service returned a value for the Contents property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasContents() {
return contents != null && !(contents instanceof SdkAutoConstructList);
}
/**
*
* Metadata about each object returned.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasContents} method.
*
*
* @return Metadata about each object returned.
*/
public final List contents() {
return contents;
}
/**
*
* The bucket name.
*
*
* @return The bucket name.
*/
public final String name() {
return name;
}
/**
*
* Keys that begin with the indicated prefix.
*
*
* @return Keys that begin with the indicated prefix.
*/
public final String prefix() {
return prefix;
}
/**
*
* Causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be
* rolled up into a single result element in the CommonPrefixes
collection. These rolled-up keys are
* not returned elsewhere in the response. Each rolled-up result counts as only one return against the
* MaxKeys
value.
*
*
* @return Causes keys that contain the same string between the prefix and the first occurrence of the delimiter to
* be rolled up into a single result element in the CommonPrefixes
collection. These rolled-up
* keys are not returned elsewhere in the response. Each rolled-up result counts as only one return against
* the MaxKeys
value.
*/
public final String delimiter() {
return delimiter;
}
/**
*
* The maximum number of keys returned in the response body.
*
*
* @return The maximum number of keys returned in the response body.
*/
public final Integer maxKeys() {
return maxKeys;
}
/**
* For responses, this returns true if the service returned a value for the CommonPrefixes property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasCommonPrefixes() {
return commonPrefixes != null && !(commonPrefixes instanceof SdkAutoConstructList);
}
/**
*
* All of the keys (up to 1,000) rolled up in a common prefix count as a single return when calculating the number
* of returns.
*
*
* A response can contain CommonPrefixes only if you specify a delimiter.
*
*
* CommonPrefixes contains all (if there are any) keys between Prefix and the next occurrence of the string
* specified by the delimiter.
*
*
* CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix.
*
*
* For example, if the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, the common prefix
* is notes/summer/. All of the keys that roll up into a common prefix count as a single return when calculating the
* number of returns.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasCommonPrefixes} method.
*
*
* @return All of the keys (up to 1,000) rolled up in a common prefix count as a single return when calculating the
* number of returns.
*
* A response can contain CommonPrefixes only if you specify a delimiter.
*
*
* CommonPrefixes contains all (if there are any) keys between Prefix and the next occurrence of the string
* specified by the delimiter.
*
*
* CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix.
*
*
* For example, if the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, the common
* prefix is notes/summer/. All of the keys that roll up into a common prefix count as a single return when
* calculating the number of returns.
*/
public final List commonPrefixes() {
return commonPrefixes;
}
/**
*
* Encoding type used by Amazon S3 to encode object keys in the response.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #encodingType} will
* return {@link EncodingType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #encodingTypeAsString}.
*
*
* @return Encoding type used by Amazon S3 to encode object keys in the response.
* @see EncodingType
*/
public final EncodingType encodingType() {
return EncodingType.fromValue(encodingType);
}
/**
*
* Encoding type used by Amazon S3 to encode object keys in the response.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #encodingType} will
* return {@link EncodingType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #encodingTypeAsString}.
*
*
* @return Encoding type used by Amazon S3 to encode object keys in the response.
* @see EncodingType
*/
public final String encodingTypeAsString() {
return encodingType;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(isTruncated());
hashCode = 31 * hashCode + Objects.hashCode(marker());
hashCode = 31 * hashCode + Objects.hashCode(nextMarker());
hashCode = 31 * hashCode + Objects.hashCode(hasContents() ? contents() : null);
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(prefix());
hashCode = 31 * hashCode + Objects.hashCode(delimiter());
hashCode = 31 * hashCode + Objects.hashCode(maxKeys());
hashCode = 31 * hashCode + Objects.hashCode(hasCommonPrefixes() ? commonPrefixes() : null);
hashCode = 31 * hashCode + Objects.hashCode(encodingTypeAsString());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ListObjectsResponse)) {
return false;
}
ListObjectsResponse other = (ListObjectsResponse) obj;
return Objects.equals(isTruncated(), other.isTruncated()) && Objects.equals(marker(), other.marker())
&& Objects.equals(nextMarker(), other.nextMarker()) && hasContents() == other.hasContents()
&& Objects.equals(contents(), other.contents()) && Objects.equals(name(), other.name())
&& Objects.equals(prefix(), other.prefix()) && Objects.equals(delimiter(), other.delimiter())
&& Objects.equals(maxKeys(), other.maxKeys()) && hasCommonPrefixes() == other.hasCommonPrefixes()
&& Objects.equals(commonPrefixes(), other.commonPrefixes())
&& Objects.equals(encodingTypeAsString(), other.encodingTypeAsString());
}
/**
* 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("ListObjectsResponse").add("IsTruncated", isTruncated()).add("Marker", marker())
.add("NextMarker", nextMarker()).add("Contents", hasContents() ? contents() : null).add("Name", name())
.add("Prefix", prefix()).add("Delimiter", delimiter()).add("MaxKeys", maxKeys())
.add("CommonPrefixes", hasCommonPrefixes() ? commonPrefixes() : null).add("EncodingType", encodingTypeAsString())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "IsTruncated":
return Optional.ofNullable(clazz.cast(isTruncated()));
case "Marker":
return Optional.ofNullable(clazz.cast(marker()));
case "NextMarker":
return Optional.ofNullable(clazz.cast(nextMarker()));
case "Contents":
return Optional.ofNullable(clazz.cast(contents()));
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "Prefix":
return Optional.ofNullable(clazz.cast(prefix()));
case "Delimiter":
return Optional.ofNullable(clazz.cast(delimiter()));
case "MaxKeys":
return Optional.ofNullable(clazz.cast(maxKeys()));
case "CommonPrefixes":
return Optional.ofNullable(clazz.cast(commonPrefixes()));
case "EncodingType":
return Optional.ofNullable(clazz.cast(encodingTypeAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
*
* A response can contain CommonPrefixes only if you specify a delimiter.
*
*
* CommonPrefixes contains all (if there are any) keys between Prefix and the next occurrence of the
* string specified by the delimiter.
*
*
* CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix.
*
*
* For example, if the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, the
* common prefix is notes/summer/. All of the keys that roll up into a common prefix count as a single
* return when calculating the number of returns.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder commonPrefixes(Collection commonPrefixes);
/**
*
* All of the keys (up to 1,000) rolled up in a common prefix count as a single return when calculating the
* number of returns.
*
*
* A response can contain CommonPrefixes only if you specify a delimiter.
*
*
* CommonPrefixes contains all (if there are any) keys between Prefix and the next occurrence of the string
* specified by the delimiter.
*
*
* CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix.
*
*
* For example, if the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, the common
* prefix is notes/summer/. All of the keys that roll up into a common prefix count as a single return when
* calculating the number of returns.
*
*
* @param commonPrefixes
* All of the keys (up to 1,000) rolled up in a common prefix count as a single return when calculating
* the number of returns.
*
* A response can contain CommonPrefixes only if you specify a delimiter.
*
*
* CommonPrefixes contains all (if there are any) keys between Prefix and the next occurrence of the
* string specified by the delimiter.
*
*
* CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix.
*
*
* For example, if the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, the
* common prefix is notes/summer/. All of the keys that roll up into a common prefix count as a single
* return when calculating the number of returns.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder commonPrefixes(CommonPrefix... commonPrefixes);
/**
*
* All of the keys (up to 1,000) rolled up in a common prefix count as a single return when calculating the
* number of returns.
*
*
* A response can contain CommonPrefixes only if you specify a delimiter.
*
*
* CommonPrefixes contains all (if there are any) keys between Prefix and the next occurrence of the string
* specified by the delimiter.
*
*
* CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix.
*
*
* For example, if the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, the common
* prefix is notes/summer/. All of the keys that roll up into a common prefix count as a single return when
* calculating the number of returns.
*
* This is a convenience that creates an instance of the {@link List.Builder} avoiding the need to
* create one manually via {@link List#builder()}.
*
* When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its
* result is passed to {@link #commonPrefixes(List)}.
*
* @param commonPrefixes
* a consumer that will call methods on {@link List.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #commonPrefixes(List)
*/
Builder commonPrefixes(Consumer... commonPrefixes);
/**
*
* Encoding type used by Amazon S3 to encode object keys in the response.
*
*
* @param encodingType
* Encoding type used by Amazon S3 to encode object keys in the response.
* @see EncodingType
* @return Returns a reference to this object so that method calls can be chained together.
* @see EncodingType
*/
Builder encodingType(String encodingType);
/**
*
* Encoding type used by Amazon S3 to encode object keys in the response.
*
*
* @param encodingType
* Encoding type used by Amazon S3 to encode object keys in the response.
* @see EncodingType
* @return Returns a reference to this object so that method calls can be chained together.
* @see EncodingType
*/
Builder encodingType(EncodingType encodingType);
}
static final class BuilderImpl extends S3Response.BuilderImpl implements Builder {
private Boolean isTruncated;
private String marker;
private String nextMarker;
private List contents = DefaultSdkAutoConstructList.getInstance();
private String name;
private String prefix;
private String delimiter;
private Integer maxKeys;
private List commonPrefixes = DefaultSdkAutoConstructList.getInstance();
private String encodingType;
private BuilderImpl() {
}
private BuilderImpl(ListObjectsResponse model) {
super(model);
isTruncated(model.isTruncated);
marker(model.marker);
nextMarker(model.nextMarker);
contents(model.contents);
name(model.name);
prefix(model.prefix);
delimiter(model.delimiter);
maxKeys(model.maxKeys);
commonPrefixes(model.commonPrefixes);
encodingType(model.encodingType);
}
public final Boolean getIsTruncated() {
return isTruncated;
}
public final void setIsTruncated(Boolean isTruncated) {
this.isTruncated = isTruncated;
}
@Override
@Transient
public final Builder isTruncated(Boolean isTruncated) {
this.isTruncated = isTruncated;
return this;
}
public final String getMarker() {
return marker;
}
public final void setMarker(String marker) {
this.marker = marker;
}
@Override
@Transient
public final Builder marker(String marker) {
this.marker = marker;
return this;
}
public final String getNextMarker() {
return nextMarker;
}
public final void setNextMarker(String nextMarker) {
this.nextMarker = nextMarker;
}
@Override
@Transient
public final Builder nextMarker(String nextMarker) {
this.nextMarker = nextMarker;
return this;
}
public final List getContents() {
List result = ObjectListCopier.copyToBuilder(this.contents);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setContents(Collection contents) {
this.contents = ObjectListCopier.copyFromBuilder(contents);
}
@Override
@Transient
public final Builder contents(Collection contents) {
this.contents = ObjectListCopier.copy(contents);
return this;
}
@Override
@Transient
@SafeVarargs
public final Builder contents(S3Object... contents) {
contents(Arrays.asList(contents));
return this;
}
@Override
@Transient
@SafeVarargs
public final Builder contents(Consumer... contents) {
contents(Stream.of(contents).map(c -> S3Object.builder().applyMutation(c).build()).collect(Collectors.toList()));
return this;
}
public final String getName() {
return name;
}
public final void setName(String name) {
this.name = name;
}
@Override
@Transient
public final Builder name(String name) {
this.name = name;
return this;
}
public final String getPrefix() {
return prefix;
}
public final void setPrefix(String prefix) {
this.prefix = prefix;
}
@Override
@Transient
public final Builder prefix(String prefix) {
this.prefix = prefix;
return this;
}
public final String getDelimiter() {
return delimiter;
}
public final void setDelimiter(String delimiter) {
this.delimiter = delimiter;
}
@Override
@Transient
public final Builder delimiter(String delimiter) {
this.delimiter = delimiter;
return this;
}
public final Integer getMaxKeys() {
return maxKeys;
}
public final void setMaxKeys(Integer maxKeys) {
this.maxKeys = maxKeys;
}
@Override
@Transient
public final Builder maxKeys(Integer maxKeys) {
this.maxKeys = maxKeys;
return this;
}
public final List getCommonPrefixes() {
List result = CommonPrefixListCopier.copyToBuilder(this.commonPrefixes);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setCommonPrefixes(Collection commonPrefixes) {
this.commonPrefixes = CommonPrefixListCopier.copyFromBuilder(commonPrefixes);
}
@Override
@Transient
public final Builder commonPrefixes(Collection commonPrefixes) {
this.commonPrefixes = CommonPrefixListCopier.copy(commonPrefixes);
return this;
}
@Override
@Transient
@SafeVarargs
public final Builder commonPrefixes(CommonPrefix... commonPrefixes) {
commonPrefixes(Arrays.asList(commonPrefixes));
return this;
}
@Override
@Transient
@SafeVarargs
public final Builder commonPrefixes(Consumer... commonPrefixes) {
commonPrefixes(Stream.of(commonPrefixes).map(c -> CommonPrefix.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final String getEncodingType() {
return encodingType;
}
public final void setEncodingType(String encodingType) {
this.encodingType = encodingType;
}
@Override
@Transient
public final Builder encodingType(String encodingType) {
this.encodingType = encodingType;
return this;
}
@Override
@Transient
public final Builder encodingType(EncodingType encodingType) {
this.encodingType(encodingType == null ? null : encodingType.toString());
return this;
}
@Override
public ListObjectsResponse build() {
return new ListObjectsResponse(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}