software.amazon.awssdk.services.cloudfrontkeyvaluestore.model.PutKeyResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudfrontkeyvaluestore Show documentation
Show all versions of cloudfrontkeyvaluestore Show documentation
The AWS Java SDK for Cloud Front Key Value Store module holds the client classes that are used for
communicating with Cloud Front Key Value Store.
/*
* 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.cloudfrontkeyvaluestore.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Metadata information about a Key Value Store.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class PutKeyResponse extends CloudFrontKeyValueStoreResponse implements
ToCopyableBuilder {
private static final SdkField ITEM_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("ItemCount").getter(getter(PutKeyResponse::itemCount)).setter(setter(Builder::itemCount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ItemCount").build()).build();
private static final SdkField TOTAL_SIZE_IN_BYTES_FIELD = SdkField. builder(MarshallingType.LONG)
.memberName("TotalSizeInBytes").getter(getter(PutKeyResponse::totalSizeInBytes))
.setter(setter(Builder::totalSizeInBytes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TotalSizeInBytes").build()).build();
private static final SdkField E_TAG_FIELD = SdkField. builder(MarshallingType.STRING).memberName("ETag")
.getter(getter(PutKeyResponse::eTag)).setter(setter(Builder::eTag))
.traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("ETag").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ITEM_COUNT_FIELD,
TOTAL_SIZE_IN_BYTES_FIELD, E_TAG_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("ItemCount", ITEM_COUNT_FIELD);
put("TotalSizeInBytes", TOTAL_SIZE_IN_BYTES_FIELD);
put("ETag", E_TAG_FIELD);
}
});
private final Integer itemCount;
private final Long totalSizeInBytes;
private final String eTag;
private PutKeyResponse(BuilderImpl builder) {
super(builder);
this.itemCount = builder.itemCount;
this.totalSizeInBytes = builder.totalSizeInBytes;
this.eTag = builder.eTag;
}
/**
*
* Number of key value pairs in the Key Value Store after the successful put.
*
*
* @return Number of key value pairs in the Key Value Store after the successful put.
*/
public final Integer itemCount() {
return itemCount;
}
/**
*
* Total size of the Key Value Store after the successful put, in bytes.
*
*
* @return Total size of the Key Value Store after the successful put, in bytes.
*/
public final Long totalSizeInBytes() {
return totalSizeInBytes;
}
/**
*
* The current version identifier of the Key Value Store after the successful put.
*
*
* @return The current version identifier of the Key Value Store after the successful put.
*/
public final String eTag() {
return eTag;
}
@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(itemCount());
hashCode = 31 * hashCode + Objects.hashCode(totalSizeInBytes());
hashCode = 31 * hashCode + Objects.hashCode(eTag());
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 PutKeyResponse)) {
return false;
}
PutKeyResponse other = (PutKeyResponse) obj;
return Objects.equals(itemCount(), other.itemCount()) && Objects.equals(totalSizeInBytes(), other.totalSizeInBytes())
&& Objects.equals(eTag(), other.eTag());
}
/**
* 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("PutKeyResponse").add("ItemCount", itemCount()).add("TotalSizeInBytes", totalSizeInBytes())
.add("ETag", eTag()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ItemCount":
return Optional.ofNullable(clazz.cast(itemCount()));
case "TotalSizeInBytes":
return Optional.ofNullable(clazz.cast(totalSizeInBytes()));
case "ETag":
return Optional.ofNullable(clazz.cast(eTag()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy