software.amazon.awssdk.services.kinesis.model.DescribeLimitsResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kinesis Show documentation
Show all versions of kinesis Show documentation
The AWS Java SDK for Amazon Kinesis module holds the client classes that are used for communicating
with Amazon Kinesis Service
The newest version!
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.kinesis.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class DescribeLimitsResponse extends KinesisResponse implements
ToCopyableBuilder {
private static final SdkField SHARD_LIMIT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("ShardLimit").getter(getter(DescribeLimitsResponse::shardLimit)).setter(setter(Builder::shardLimit))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ShardLimit").build()).build();
private static final SdkField OPEN_SHARD_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("OpenShardCount").getter(getter(DescribeLimitsResponse::openShardCount))
.setter(setter(Builder::openShardCount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OpenShardCount").build()).build();
private static final SdkField ON_DEMAND_STREAM_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("OnDemandStreamCount").getter(getter(DescribeLimitsResponse::onDemandStreamCount))
.setter(setter(Builder::onDemandStreamCount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OnDemandStreamCount").build())
.build();
private static final SdkField ON_DEMAND_STREAM_COUNT_LIMIT_FIELD = SdkField
. builder(MarshallingType.INTEGER).memberName("OnDemandStreamCountLimit")
.getter(getter(DescribeLimitsResponse::onDemandStreamCountLimit)).setter(setter(Builder::onDemandStreamCountLimit))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OnDemandStreamCountLimit").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SHARD_LIMIT_FIELD,
OPEN_SHARD_COUNT_FIELD, ON_DEMAND_STREAM_COUNT_FIELD, ON_DEMAND_STREAM_COUNT_LIMIT_FIELD));
private final Integer shardLimit;
private final Integer openShardCount;
private final Integer onDemandStreamCount;
private final Integer onDemandStreamCountLimit;
private DescribeLimitsResponse(BuilderImpl builder) {
super(builder);
this.shardLimit = builder.shardLimit;
this.openShardCount = builder.openShardCount;
this.onDemandStreamCount = builder.onDemandStreamCount;
this.onDemandStreamCountLimit = builder.onDemandStreamCountLimit;
}
/**
*
* The maximum number of shards.
*
*
* @return The maximum number of shards.
*/
public final Integer shardLimit() {
return shardLimit;
}
/**
*
* The number of open shards.
*
*
* @return The number of open shards.
*/
public final Integer openShardCount() {
return openShardCount;
}
/**
*
* Indicates the number of data streams with the on-demand capacity mode.
*
*
* @return Indicates the number of data streams with the on-demand capacity mode.
*/
public final Integer onDemandStreamCount() {
return onDemandStreamCount;
}
/**
*
* The maximum number of data streams with the on-demand capacity mode.
*
*
* @return The maximum number of data streams with the on-demand capacity mode.
*/
public final Integer onDemandStreamCountLimit() {
return onDemandStreamCountLimit;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(shardLimit());
hashCode = 31 * hashCode + Objects.hashCode(openShardCount());
hashCode = 31 * hashCode + Objects.hashCode(onDemandStreamCount());
hashCode = 31 * hashCode + Objects.hashCode(onDemandStreamCountLimit());
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 DescribeLimitsResponse)) {
return false;
}
DescribeLimitsResponse other = (DescribeLimitsResponse) obj;
return Objects.equals(shardLimit(), other.shardLimit()) && Objects.equals(openShardCount(), other.openShardCount())
&& Objects.equals(onDemandStreamCount(), other.onDemandStreamCount())
&& Objects.equals(onDemandStreamCountLimit(), other.onDemandStreamCountLimit());
}
/**
* 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("DescribeLimitsResponse").add("ShardLimit", shardLimit()).add("OpenShardCount", openShardCount())
.add("OnDemandStreamCount", onDemandStreamCount()).add("OnDemandStreamCountLimit", onDemandStreamCountLimit())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ShardLimit":
return Optional.ofNullable(clazz.cast(shardLimit()));
case "OpenShardCount":
return Optional.ofNullable(clazz.cast(openShardCount()));
case "OnDemandStreamCount":
return Optional.ofNullable(clazz.cast(onDemandStreamCount()));
case "OnDemandStreamCountLimit":
return Optional.ofNullable(clazz.cast(onDemandStreamCountLimit()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function