
software.amazon.awssdk.services.dynamodb.model.ListStreamsRequest Maven / Gradle / Ivy
/*
* Copyright 2013-2018 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.dynamodb.model;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Represents the input of a ListStreams
operation.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ListStreamsRequest extends DynamoDbStreamsRequest implements
ToCopyableBuilder {
private final String tableName;
private final Integer limit;
private final String exclusiveStartStreamArn;
private ListStreamsRequest(BuilderImpl builder) {
super(builder);
this.tableName = builder.tableName;
this.limit = builder.limit;
this.exclusiveStartStreamArn = builder.exclusiveStartStreamArn;
}
/**
*
* If this parameter is provided, then only the streams associated with this table name are returned.
*
*
* @return If this parameter is provided, then only the streams associated with this table name are returned.
*/
public String tableName() {
return tableName;
}
/**
*
* The maximum number of streams to return. The upper limit is 100.
*
*
* @return The maximum number of streams to return. The upper limit is 100.
*/
public Integer limit() {
return limit;
}
/**
*
* The ARN (Amazon Resource Name) of the first item that this operation will evaluate. Use the value that was
* returned for LastEvaluatedStreamArn
in the previous operation.
*
*
* @return The ARN (Amazon Resource Name) of the first item that this operation will evaluate. Use the value that
* was returned for LastEvaluatedStreamArn
in the previous operation.
*/
public String exclusiveStartStreamArn() {
return exclusiveStartStreamArn;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(tableName());
hashCode = 31 * hashCode + Objects.hashCode(limit());
hashCode = 31 * hashCode + Objects.hashCode(exclusiveStartStreamArn());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ListStreamsRequest)) {
return false;
}
ListStreamsRequest other = (ListStreamsRequest) obj;
return Objects.equals(tableName(), other.tableName()) && Objects.equals(limit(), other.limit())
&& Objects.equals(exclusiveStartStreamArn(), other.exclusiveStartStreamArn());
}
@Override
public String toString() {
return ToString.builder("ListStreamsRequest").add("TableName", tableName()).add("Limit", limit())
.add("ExclusiveStartStreamArn", exclusiveStartStreamArn()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "TableName":
return Optional.ofNullable(clazz.cast(tableName()));
case "Limit":
return Optional.ofNullable(clazz.cast(limit()));
case "ExclusiveStartStreamArn":
return Optional.ofNullable(clazz.cast(exclusiveStartStreamArn()));
default:
return Optional.empty();
}
}
public interface Builder extends DynamoDbStreamsRequest.Builder, CopyableBuilder {
/**
*
* If this parameter is provided, then only the streams associated with this table name are returned.
*
*
* @param tableName
* If this parameter is provided, then only the streams associated with this table name are returned.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tableName(String tableName);
/**
*
* The maximum number of streams to return. The upper limit is 100.
*
*
* @param limit
* The maximum number of streams to return. The upper limit is 100.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder limit(Integer limit);
/**
*
* The ARN (Amazon Resource Name) of the first item that this operation will evaluate. Use the value that was
* returned for LastEvaluatedStreamArn
in the previous operation.
*
*
* @param exclusiveStartStreamArn
* The ARN (Amazon Resource Name) of the first item that this operation will evaluate. Use the value that
* was returned for LastEvaluatedStreamArn
in the previous operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder exclusiveStartStreamArn(String exclusiveStartStreamArn);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends DynamoDbStreamsRequest.BuilderImpl implements Builder {
private String tableName;
private Integer limit;
private String exclusiveStartStreamArn;
private BuilderImpl() {
}
private BuilderImpl(ListStreamsRequest model) {
super(model);
tableName(model.tableName);
limit(model.limit);
exclusiveStartStreamArn(model.exclusiveStartStreamArn);
}
public final String getTableName() {
return tableName;
}
@Override
public final Builder tableName(String tableName) {
this.tableName = tableName;
return this;
}
public final void setTableName(String tableName) {
this.tableName = tableName;
}
public final Integer getLimit() {
return limit;
}
@Override
public final Builder limit(Integer limit) {
this.limit = limit;
return this;
}
public final void setLimit(Integer limit) {
this.limit = limit;
}
public final String getExclusiveStartStreamArn() {
return exclusiveStartStreamArn;
}
@Override
public final Builder exclusiveStartStreamArn(String exclusiveStartStreamArn) {
this.exclusiveStartStreamArn = exclusiveStartStreamArn;
return this;
}
public final void setExclusiveStartStreamArn(String exclusiveStartStreamArn) {
this.exclusiveStartStreamArn = exclusiveStartStreamArn;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public ListStreamsRequest build() {
return new ListStreamsRequest(this);
}
}
}