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

software.amazon.awssdk.services.kinesis.model.DescribeLimitsResponse Maven / Gradle / Ivy

Go to download

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 getter(Function g) { return obj -> g.apply((DescribeLimitsResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends KinesisResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The maximum number of shards. *

* * @param shardLimit * The maximum number of shards. * @return Returns a reference to this object so that method calls can be chained together. */ Builder shardLimit(Integer shardLimit); /** *

* The number of open shards. *

* * @param openShardCount * The number of open shards. * @return Returns a reference to this object so that method calls can be chained together. */ Builder openShardCount(Integer openShardCount); /** *

* Indicates the number of data streams with the on-demand capacity mode. *

* * @param onDemandStreamCount * Indicates the number of data streams with the on-demand capacity mode. * @return Returns a reference to this object so that method calls can be chained together. */ Builder onDemandStreamCount(Integer onDemandStreamCount); /** *

* The maximum number of data streams with the on-demand capacity mode. *

* * @param onDemandStreamCountLimit * The maximum number of data streams with the on-demand capacity mode. * @return Returns a reference to this object so that method calls can be chained together. */ Builder onDemandStreamCountLimit(Integer onDemandStreamCountLimit); } static final class BuilderImpl extends KinesisResponse.BuilderImpl implements Builder { private Integer shardLimit; private Integer openShardCount; private Integer onDemandStreamCount; private Integer onDemandStreamCountLimit; private BuilderImpl() { } private BuilderImpl(DescribeLimitsResponse model) { super(model); shardLimit(model.shardLimit); openShardCount(model.openShardCount); onDemandStreamCount(model.onDemandStreamCount); onDemandStreamCountLimit(model.onDemandStreamCountLimit); } public final Integer getShardLimit() { return shardLimit; } public final void setShardLimit(Integer shardLimit) { this.shardLimit = shardLimit; } @Override public final Builder shardLimit(Integer shardLimit) { this.shardLimit = shardLimit; return this; } public final Integer getOpenShardCount() { return openShardCount; } public final void setOpenShardCount(Integer openShardCount) { this.openShardCount = openShardCount; } @Override public final Builder openShardCount(Integer openShardCount) { this.openShardCount = openShardCount; return this; } public final Integer getOnDemandStreamCount() { return onDemandStreamCount; } public final void setOnDemandStreamCount(Integer onDemandStreamCount) { this.onDemandStreamCount = onDemandStreamCount; } @Override public final Builder onDemandStreamCount(Integer onDemandStreamCount) { this.onDemandStreamCount = onDemandStreamCount; return this; } public final Integer getOnDemandStreamCountLimit() { return onDemandStreamCountLimit; } public final void setOnDemandStreamCountLimit(Integer onDemandStreamCountLimit) { this.onDemandStreamCountLimit = onDemandStreamCountLimit; } @Override public final Builder onDemandStreamCountLimit(Integer onDemandStreamCountLimit) { this.onDemandStreamCountLimit = onDemandStreamCountLimit; return this; } @Override public DescribeLimitsResponse build() { return new DescribeLimitsResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy