
software.amazon.awssdk.services.dynamodb.model.TableDescription 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.dynamodb.model;
import java.io.Serializable;
import java.time.Instant;
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;
/**
*
* Represents the properties of a table.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class TableDescription implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField> ATTRIBUTE_DEFINITIONS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(TableDescription::attributeDefinitions))
.setter(setter(Builder::attributeDefinitions))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AttributeDefinitions").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(AttributeDefinition::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField TABLE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(TableDescription::tableName)).setter(setter(Builder::tableName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TableName").build()).build();
private static final SdkField> KEY_SCHEMA_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(TableDescription::keySchema))
.setter(setter(Builder::keySchema))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KeySchema").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(KeySchemaElement::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField TABLE_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(TableDescription::tableStatusAsString)).setter(setter(Builder::tableStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TableStatus").build()).build();
private static final SdkField CREATION_DATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.getter(getter(TableDescription::creationDateTime)).setter(setter(Builder::creationDateTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationDateTime").build()).build();
private static final SdkField PROVISIONED_THROUGHPUT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(TableDescription::provisionedThroughput)).setter(setter(Builder::provisionedThroughput))
.constructor(ProvisionedThroughputDescription::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProvisionedThroughput").build())
.build();
private static final SdkField TABLE_SIZE_BYTES_FIELD = SdkField. builder(MarshallingType.LONG)
.getter(getter(TableDescription::tableSizeBytes)).setter(setter(Builder::tableSizeBytes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TableSizeBytes").build()).build();
private static final SdkField ITEM_COUNT_FIELD = SdkField. builder(MarshallingType.LONG)
.getter(getter(TableDescription::itemCount)).setter(setter(Builder::itemCount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ItemCount").build()).build();
private static final SdkField TABLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(TableDescription::tableArn)).setter(setter(Builder::tableArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TableArn").build()).build();
private static final SdkField TABLE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(TableDescription::tableId)).setter(setter(Builder::tableId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TableId").build()).build();
private static final SdkField BILLING_MODE_SUMMARY_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(TableDescription::billingModeSummary))
.setter(setter(Builder::billingModeSummary)).constructor(BillingModeSummary::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BillingModeSummary").build())
.build();
private static final SdkField> LOCAL_SECONDARY_INDEXES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(TableDescription::localSecondaryIndexes))
.setter(setter(Builder::localSecondaryIndexes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LocalSecondaryIndexes").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(LocalSecondaryIndexDescription::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> GLOBAL_SECONDARY_INDEXES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(TableDescription::globalSecondaryIndexes))
.setter(setter(Builder::globalSecondaryIndexes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GlobalSecondaryIndexes").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(GlobalSecondaryIndexDescription::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField STREAM_SPECIFICATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(TableDescription::streamSpecification))
.setter(setter(Builder::streamSpecification)).constructor(StreamSpecification::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StreamSpecification").build())
.build();
private static final SdkField LATEST_STREAM_LABEL_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(TableDescription::latestStreamLabel)).setter(setter(Builder::latestStreamLabel))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LatestStreamLabel").build()).build();
private static final SdkField LATEST_STREAM_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(TableDescription::latestStreamArn)).setter(setter(Builder::latestStreamArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LatestStreamArn").build()).build();
private static final SdkField GLOBAL_TABLE_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(TableDescription::globalTableVersion)).setter(setter(Builder::globalTableVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GlobalTableVersion").build())
.build();
private static final SdkField> REPLICAS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(TableDescription::replicas))
.setter(setter(Builder::replicas))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Replicas").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(ReplicaDescription::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField RESTORE_SUMMARY_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(TableDescription::restoreSummary))
.setter(setter(Builder::restoreSummary)).constructor(RestoreSummary::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RestoreSummary").build()).build();
private static final SdkField SSE_DESCRIPTION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(TableDescription::sseDescription))
.setter(setter(Builder::sseDescription)).constructor(SSEDescription::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SSEDescription").build()).build();
private static final SdkField ARCHIVAL_SUMMARY_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(TableDescription::archivalSummary))
.setter(setter(Builder::archivalSummary)).constructor(ArchivalSummary::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ArchivalSummary").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ATTRIBUTE_DEFINITIONS_FIELD,
TABLE_NAME_FIELD, KEY_SCHEMA_FIELD, TABLE_STATUS_FIELD, CREATION_DATE_TIME_FIELD, PROVISIONED_THROUGHPUT_FIELD,
TABLE_SIZE_BYTES_FIELD, ITEM_COUNT_FIELD, TABLE_ARN_FIELD, TABLE_ID_FIELD, BILLING_MODE_SUMMARY_FIELD,
LOCAL_SECONDARY_INDEXES_FIELD, GLOBAL_SECONDARY_INDEXES_FIELD, STREAM_SPECIFICATION_FIELD, LATEST_STREAM_LABEL_FIELD,
LATEST_STREAM_ARN_FIELD, GLOBAL_TABLE_VERSION_FIELD, REPLICAS_FIELD, RESTORE_SUMMARY_FIELD, SSE_DESCRIPTION_FIELD,
ARCHIVAL_SUMMARY_FIELD));
private static final long serialVersionUID = 1L;
private final List attributeDefinitions;
private final String tableName;
private final List keySchema;
private final String tableStatus;
private final Instant creationDateTime;
private final ProvisionedThroughputDescription provisionedThroughput;
private final Long tableSizeBytes;
private final Long itemCount;
private final String tableArn;
private final String tableId;
private final BillingModeSummary billingModeSummary;
private final List localSecondaryIndexes;
private final List globalSecondaryIndexes;
private final StreamSpecification streamSpecification;
private final String latestStreamLabel;
private final String latestStreamArn;
private final String globalTableVersion;
private final List replicas;
private final RestoreSummary restoreSummary;
private final SSEDescription sseDescription;
private final ArchivalSummary archivalSummary;
private TableDescription(BuilderImpl builder) {
this.attributeDefinitions = builder.attributeDefinitions;
this.tableName = builder.tableName;
this.keySchema = builder.keySchema;
this.tableStatus = builder.tableStatus;
this.creationDateTime = builder.creationDateTime;
this.provisionedThroughput = builder.provisionedThroughput;
this.tableSizeBytes = builder.tableSizeBytes;
this.itemCount = builder.itemCount;
this.tableArn = builder.tableArn;
this.tableId = builder.tableId;
this.billingModeSummary = builder.billingModeSummary;
this.localSecondaryIndexes = builder.localSecondaryIndexes;
this.globalSecondaryIndexes = builder.globalSecondaryIndexes;
this.streamSpecification = builder.streamSpecification;
this.latestStreamLabel = builder.latestStreamLabel;
this.latestStreamArn = builder.latestStreamArn;
this.globalTableVersion = builder.globalTableVersion;
this.replicas = builder.replicas;
this.restoreSummary = builder.restoreSummary;
this.sseDescription = builder.sseDescription;
this.archivalSummary = builder.archivalSummary;
}
/**
* Returns true if the AttributeDefinitions property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public boolean hasAttributeDefinitions() {
return attributeDefinitions != null && !(attributeDefinitions instanceof SdkAutoConstructList);
}
/**
*
* An array of AttributeDefinition
objects. Each of these objects describes one attribute in the table
* and index key schema.
*
*
* Each AttributeDefinition
object in this array is composed of:
*
*
* -
*
* AttributeName
- The name of the attribute.
*
*
* -
*
* AttributeType
- The data type for the attribute.
*
*
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasAttributeDefinitions()} to see if a value was sent in this field.
*
*
* @return An array of AttributeDefinition
objects. Each of these objects describes one attribute in
* the table and index key schema.
*
* Each AttributeDefinition
object in this array is composed of:
*
*
* -
*
* AttributeName
- The name of the attribute.
*
*
* -
*
* AttributeType
- The data type for the attribute.
*
*
*/
public List attributeDefinitions() {
return attributeDefinitions;
}
/**
*
* The name of the table.
*
*
* @return The name of the table.
*/
public String tableName() {
return tableName;
}
/**
* Returns true if the KeySchema property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public boolean hasKeySchema() {
return keySchema != null && !(keySchema instanceof SdkAutoConstructList);
}
/**
*
* The primary key structure for the table. Each KeySchemaElement
consists of:
*
*
* -
*
* AttributeName
- The name of the attribute.
*
*
* -
*
* KeyType
- The role of the attribute:
*
*
* -
*
* HASH
- partition key
*
*
* -
*
* RANGE
- sort key
*
*
*
*
*
* The partition key of an item is also known as its hash attribute. The term "hash attribute" derives from
* DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on their
* partition key values.
*
*
* The sort key of an item is also known as its range attribute. The term "range attribute" derives from the
* way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key
* value.
*
*
*
*
* For more information about primary keys, see Primary Key in the Amazon DynamoDB Developer Guide.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasKeySchema()} to see if a value was sent in this field.
*
*
* @return The primary key structure for the table. Each KeySchemaElement
consists of:
*
* -
*
* AttributeName
- The name of the attribute.
*
*
* -
*
* KeyType
- The role of the attribute:
*
*
* -
*
* HASH
- partition key
*
*
* -
*
* RANGE
- sort key
*
*
*
*
*
* The partition key of an item is also known as its hash attribute. The term "hash attribute"
* derives from DynamoDB's usage of an internal hash function to evenly distribute data items across
* partitions, based on their partition key values.
*
*
* The sort key of an item is also known as its range attribute. The term "range attribute" derives
* from the way DynamoDB stores items with the same partition key physically close together, in sorted order
* by the sort key value.
*
*
*
*
* For more information about primary keys, see Primary Key in the Amazon DynamoDB Developer Guide.
*/
public List keySchema() {
return keySchema;
}
/**
*
* The current state of the table:
*
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
* -
*
* INACCESSIBLE_ENCRYPTION_CREDENTIALS
- The AWS KMS key used to encrypt the table in inaccessible.
* Table operations may fail due to failure to use the AWS KMS key. DynamoDB will initiate the table archival
* process when a table's AWS KMS key remains inaccessible for more than seven days.
*
*
* -
*
* ARCHIVING
- The table is being archived. Operations are not allowed until archival is complete.
*
*
* -
*
* ARCHIVED
- The table has been archived. See the ArchivalReason for more information.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #tableStatus} will
* return {@link TableStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #tableStatusAsString}.
*
*
* @return The current state of the table:
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
* -
*
* INACCESSIBLE_ENCRYPTION_CREDENTIALS
- The AWS KMS key used to encrypt the table in
* inaccessible. Table operations may fail due to failure to use the AWS KMS key. DynamoDB will initiate the
* table archival process when a table's AWS KMS key remains inaccessible for more than seven days.
*
*
* -
*
* ARCHIVING
- The table is being archived. Operations are not allowed until archival is
* complete.
*
*
* -
*
* ARCHIVED
- The table has been archived. See the ArchivalReason for more information.
*
*
* @see TableStatus
*/
public TableStatus tableStatus() {
return TableStatus.fromValue(tableStatus);
}
/**
*
* The current state of the table:
*
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
* -
*
* INACCESSIBLE_ENCRYPTION_CREDENTIALS
- The AWS KMS key used to encrypt the table in inaccessible.
* Table operations may fail due to failure to use the AWS KMS key. DynamoDB will initiate the table archival
* process when a table's AWS KMS key remains inaccessible for more than seven days.
*
*
* -
*
* ARCHIVING
- The table is being archived. Operations are not allowed until archival is complete.
*
*
* -
*
* ARCHIVED
- The table has been archived. See the ArchivalReason for more information.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #tableStatus} will
* return {@link TableStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #tableStatusAsString}.
*
*
* @return The current state of the table:
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
* -
*
* INACCESSIBLE_ENCRYPTION_CREDENTIALS
- The AWS KMS key used to encrypt the table in
* inaccessible. Table operations may fail due to failure to use the AWS KMS key. DynamoDB will initiate the
* table archival process when a table's AWS KMS key remains inaccessible for more than seven days.
*
*
* -
*
* ARCHIVING
- The table is being archived. Operations are not allowed until archival is
* complete.
*
*
* -
*
* ARCHIVED
- The table has been archived. See the ArchivalReason for more information.
*
*
* @see TableStatus
*/
public String tableStatusAsString() {
return tableStatus;
}
/**
*
* The date and time when the table was created, in UNIX epoch time
* format.
*
*
* @return The date and time when the table was created, in UNIX epoch
* time format.
*/
public Instant creationDateTime() {
return creationDateTime;
}
/**
*
* The provisioned throughput settings for the table, consisting of read and write capacity units, along with data
* about increases and decreases.
*
*
* @return The provisioned throughput settings for the table, consisting of read and write capacity units, along
* with data about increases and decreases.
*/
public ProvisionedThroughputDescription provisionedThroughput() {
return provisionedThroughput;
}
/**
*
* The total size of the specified table, in bytes. DynamoDB updates this value approximately every six hours.
* Recent changes might not be reflected in this value.
*
*
* @return The total size of the specified table, in bytes. DynamoDB updates this value approximately every six
* hours. Recent changes might not be reflected in this value.
*/
public Long tableSizeBytes() {
return tableSizeBytes;
}
/**
*
* The number of items in the specified table. DynamoDB updates this value approximately every six hours. Recent
* changes might not be reflected in this value.
*
*
* @return The number of items in the specified table. DynamoDB updates this value approximately every six hours.
* Recent changes might not be reflected in this value.
*/
public Long itemCount() {
return itemCount;
}
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies the table.
*
*
* @return The Amazon Resource Name (ARN) that uniquely identifies the table.
*/
public String tableArn() {
return tableArn;
}
/**
*
* Unique identifier for the table for which the backup was created.
*
*
* @return Unique identifier for the table for which the backup was created.
*/
public String tableId() {
return tableId;
}
/**
*
* Contains the details for the read/write capacity mode.
*
*
* @return Contains the details for the read/write capacity mode.
*/
public BillingModeSummary billingModeSummary() {
return billingModeSummary;
}
/**
* Returns true if the LocalSecondaryIndexes property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public boolean hasLocalSecondaryIndexes() {
return localSecondaryIndexes != null && !(localSecondaryIndexes instanceof SdkAutoConstructList);
}
/**
*
* Represents one or more local secondary indexes on the table. Each index is scoped to a given partition key value.
* Tables with one or more local secondary indexes are subject to an item collection size limit, where the amount of
* data within a given item collection cannot exceed 10 GB. Each element is composed of:
*
*
* -
*
* IndexName
- The name of the local secondary index.
*
*
* -
*
* KeySchema
- Specifies the complete index key schema. The attribute names in the key schema must be
* between 1 and 255 characters (inclusive). The key schema must begin with the same partition key as the table.
*
*
* -
*
* Projection
- Specifies attributes that are copied (projected) from the table into the index. These
* are in addition to the primary key attributes and index key attributes, which are automatically projected. Each
* attribute specification is composed of:
*
*
* -
*
* ProjectionType
- One of the following:
*
*
* -
*
* KEYS_ONLY
- Only the index and primary keys are projected into the index.
*
*
* -
*
* INCLUDE
- Only the specified table attributes are projected into the index. The list of projected
* attributes is in NonKeyAttributes
.
*
*
* -
*
* ALL
- All of the table attributes are projected into the index.
*
*
*
*
* -
*
* NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the
* secondary index. The total count of attributes provided in NonKeyAttributes
, summed across all of
* the secondary indexes, must not exceed 20. If you project the same attribute into two different indexes, this
* counts as two distinct attributes when determining the total.
*
*
*
*
* -
*
* IndexSizeBytes
- Represents the total size of the index, in bytes. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* ItemCount
- Represents the number of items in the index. DynamoDB updates this value approximately
* every six hours. Recent changes might not be reflected in this value.
*
*
*
*
* If the table is in the DELETING
state, no information about indexes will be returned.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasLocalSecondaryIndexes()} to see if a value was sent in this field.
*
*
* @return Represents one or more local secondary indexes on the table. Each index is scoped to a given partition
* key value. Tables with one or more local secondary indexes are subject to an item collection size limit,
* where the amount of data within a given item collection cannot exceed 10 GB. Each element is composed
* of:
*
* -
*
* IndexName
- The name of the local secondary index.
*
*
* -
*
* KeySchema
- Specifies the complete index key schema. The attribute names in the key schema
* must be between 1 and 255 characters (inclusive). The key schema must begin with the same partition key
* as the table.
*
*
* -
*
* Projection
- Specifies attributes that are copied (projected) from the table into the index.
* These are in addition to the primary key attributes and index key attributes, which are automatically
* projected. Each attribute specification is composed of:
*
*
* -
*
* ProjectionType
- One of the following:
*
*
* -
*
* KEYS_ONLY
- Only the index and primary keys are projected into the index.
*
*
* -
*
* INCLUDE
- Only the specified table attributes are projected into the index. The list of
* projected attributes is in NonKeyAttributes
.
*
*
* -
*
* ALL
- All of the table attributes are projected into the index.
*
*
*
*
* -
*
* NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the
* secondary index. The total count of attributes provided in NonKeyAttributes
, summed across
* all of the secondary indexes, must not exceed 20. If you project the same attribute into two different
* indexes, this counts as two distinct attributes when determining the total.
*
*
*
*
* -
*
* IndexSizeBytes
- Represents the total size of the index, in bytes. DynamoDB updates this
* value approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* ItemCount
- Represents the number of items in the index. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
*
*
* If the table is in the DELETING
state, no information about indexes will be returned.
*/
public List localSecondaryIndexes() {
return localSecondaryIndexes;
}
/**
* Returns true if the GlobalSecondaryIndexes property was specified by the sender (it may be empty), or false if
* the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public boolean hasGlobalSecondaryIndexes() {
return globalSecondaryIndexes != null && !(globalSecondaryIndexes instanceof SdkAutoConstructList);
}
/**
*
* The global secondary indexes, if any, on the table. Each index is scoped to a given partition key value. Each
* element is composed of:
*
*
* -
*
* Backfilling
- If true, then the index is currently in the backfilling phase. Backfilling occurs only
* when a new global secondary index is added to the table. It is the process by which DynamoDB populates the new
* index with data from the table. (This attribute does not appear for indexes that were created during a
* CreateTable
operation.)
*
*
* You can delete an index that is being created during the Backfilling
phase when
* IndexStatus
is set to CREATING and Backfilling
is true. You can't delete the index that
* is being created when IndexStatus
is set to CREATING and Backfilling
is false. (This
* attribute does not appear for indexes that were created during a CreateTable
operation.)
*
*
* -
*
* IndexName
- The name of the global secondary index.
*
*
* -
*
* IndexSizeBytes
- The total size of the global secondary index, in bytes. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* IndexStatus
- The current status of the global secondary index:
*
*
* -
*
* CREATING
- The index is being created.
*
*
* -
*
* UPDATING
- The index is being updated.
*
*
* -
*
* DELETING
- The index is being deleted.
*
*
* -
*
* ACTIVE
- The index is ready for use.
*
*
*
*
* -
*
* ItemCount
- The number of items in the global secondary index. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* KeySchema
- Specifies the complete index key schema. The attribute names in the key schema must be
* between 1 and 255 characters (inclusive). The key schema must begin with the same partition key as the table.
*
*
* -
*
* Projection
- Specifies attributes that are copied (projected) from the table into the index. These
* are in addition to the primary key attributes and index key attributes, which are automatically projected. Each
* attribute specification is composed of:
*
*
* -
*
* ProjectionType
- One of the following:
*
*
* -
*
* KEYS_ONLY
- Only the index and primary keys are projected into the index.
*
*
* -
*
* INCLUDE
- Only the specified table attributes are projected into the index. The list of projected
* attributes is in NonKeyAttributes
.
*
*
* -
*
* ALL
- All of the table attributes are projected into the index.
*
*
*
*
* -
*
* NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the
* secondary index. The total count of attributes provided in NonKeyAttributes
, summed across all of
* the secondary indexes, must not exceed 20. If you project the same attribute into two different indexes, this
* counts as two distinct attributes when determining the total.
*
*
*
*
* -
*
* ProvisionedThroughput
- The provisioned throughput settings for the global secondary index,
* consisting of read and write capacity units, along with data about increases and decreases.
*
*
*
*
* If the table is in the DELETING
state, no information about indexes will be returned.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasGlobalSecondaryIndexes()} to see if a value was sent in this field.
*
*
* @return The global secondary indexes, if any, on the table. Each index is scoped to a given partition key value.
* Each element is composed of:
*
* -
*
* Backfilling
- If true, then the index is currently in the backfilling phase. Backfilling
* occurs only when a new global secondary index is added to the table. It is the process by which DynamoDB
* populates the new index with data from the table. (This attribute does not appear for indexes that were
* created during a CreateTable
operation.)
*
*
* You can delete an index that is being created during the Backfilling
phase when
* IndexStatus
is set to CREATING and Backfilling
is true. You can't delete the
* index that is being created when IndexStatus
is set to CREATING and Backfilling
* is false. (This attribute does not appear for indexes that were created during a CreateTable
* operation.)
*
*
* -
*
* IndexName
- The name of the global secondary index.
*
*
* -
*
* IndexSizeBytes
- The total size of the global secondary index, in bytes. DynamoDB updates
* this value approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* IndexStatus
- The current status of the global secondary index:
*
*
* -
*
* CREATING
- The index is being created.
*
*
* -
*
* UPDATING
- The index is being updated.
*
*
* -
*
* DELETING
- The index is being deleted.
*
*
* -
*
* ACTIVE
- The index is ready for use.
*
*
*
*
* -
*
* ItemCount
- The number of items in the global secondary index. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* KeySchema
- Specifies the complete index key schema. The attribute names in the key schema
* must be between 1 and 255 characters (inclusive). The key schema must begin with the same partition key
* as the table.
*
*
* -
*
* Projection
- Specifies attributes that are copied (projected) from the table into the index.
* These are in addition to the primary key attributes and index key attributes, which are automatically
* projected. Each attribute specification is composed of:
*
*
* -
*
* ProjectionType
- One of the following:
*
*
* -
*
* KEYS_ONLY
- Only the index and primary keys are projected into the index.
*
*
* -
*
* INCLUDE
- Only the specified table attributes are projected into the index. The list of
* projected attributes is in NonKeyAttributes
.
*
*
* -
*
* ALL
- All of the table attributes are projected into the index.
*
*
*
*
* -
*
* NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the
* secondary index. The total count of attributes provided in NonKeyAttributes
, summed across
* all of the secondary indexes, must not exceed 20. If you project the same attribute into two different
* indexes, this counts as two distinct attributes when determining the total.
*
*
*
*
* -
*
* ProvisionedThroughput
- The provisioned throughput settings for the global secondary index,
* consisting of read and write capacity units, along with data about increases and decreases.
*
*
*
*
* If the table is in the DELETING
state, no information about indexes will be returned.
*/
public List globalSecondaryIndexes() {
return globalSecondaryIndexes;
}
/**
*
* The current DynamoDB Streams configuration for the table.
*
*
* @return The current DynamoDB Streams configuration for the table.
*/
public StreamSpecification streamSpecification() {
return streamSpecification;
}
/**
*
* A timestamp, in ISO 8601 format, for this stream.
*
*
* Note that LatestStreamLabel
is not a unique identifier for the stream, because it is possible that a
* stream from another table might have the same timestamp. However, the combination of the following three elements
* is guaranteed to be unique:
*
*
* -
*
* AWS customer ID
*
*
* -
*
* Table name
*
*
* -
*
* StreamLabel
*
*
*
*
* @return A timestamp, in ISO 8601 format, for this stream.
*
* Note that LatestStreamLabel
is not a unique identifier for the stream, because it is
* possible that a stream from another table might have the same timestamp. However, the combination of the
* following three elements is guaranteed to be unique:
*
*
* -
*
* AWS customer ID
*
*
* -
*
* Table name
*
*
* -
*
* StreamLabel
*
*
*/
public String latestStreamLabel() {
return latestStreamLabel;
}
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies the latest stream for this table.
*
*
* @return The Amazon Resource Name (ARN) that uniquely identifies the latest stream for this table.
*/
public String latestStreamArn() {
return latestStreamArn;
}
/**
*
* Represents the version of global tables in
* use, if the table is replicated across AWS Regions.
*
*
* @return Represents the version of global
* tables in use, if the table is replicated across AWS Regions.
*/
public String globalTableVersion() {
return globalTableVersion;
}
/**
* Returns true if the Replicas property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public boolean hasReplicas() {
return replicas != null && !(replicas instanceof SdkAutoConstructList);
}
/**
*
* Represents replicas of the table.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasReplicas()} to see if a value was sent in this field.
*
*
* @return Represents replicas of the table.
*/
public List replicas() {
return replicas;
}
/**
*
* Contains details for the restore.
*
*
* @return Contains details for the restore.
*/
public RestoreSummary restoreSummary() {
return restoreSummary;
}
/**
*
* The description of the server-side encryption status on the specified table.
*
*
* @return The description of the server-side encryption status on the specified table.
*/
public SSEDescription sseDescription() {
return sseDescription;
}
/**
*
* Contains information about the table archive.
*
*
* @return Contains information about the table archive.
*/
public ArchivalSummary archivalSummary() {
return archivalSummary;
}
@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(attributeDefinitions());
hashCode = 31 * hashCode + Objects.hashCode(tableName());
hashCode = 31 * hashCode + Objects.hashCode(keySchema());
hashCode = 31 * hashCode + Objects.hashCode(tableStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(creationDateTime());
hashCode = 31 * hashCode + Objects.hashCode(provisionedThroughput());
hashCode = 31 * hashCode + Objects.hashCode(tableSizeBytes());
hashCode = 31 * hashCode + Objects.hashCode(itemCount());
hashCode = 31 * hashCode + Objects.hashCode(tableArn());
hashCode = 31 * hashCode + Objects.hashCode(tableId());
hashCode = 31 * hashCode + Objects.hashCode(billingModeSummary());
hashCode = 31 * hashCode + Objects.hashCode(localSecondaryIndexes());
hashCode = 31 * hashCode + Objects.hashCode(globalSecondaryIndexes());
hashCode = 31 * hashCode + Objects.hashCode(streamSpecification());
hashCode = 31 * hashCode + Objects.hashCode(latestStreamLabel());
hashCode = 31 * hashCode + Objects.hashCode(latestStreamArn());
hashCode = 31 * hashCode + Objects.hashCode(globalTableVersion());
hashCode = 31 * hashCode + Objects.hashCode(replicas());
hashCode = 31 * hashCode + Objects.hashCode(restoreSummary());
hashCode = 31 * hashCode + Objects.hashCode(sseDescription());
hashCode = 31 * hashCode + Objects.hashCode(archivalSummary());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof TableDescription)) {
return false;
}
TableDescription other = (TableDescription) obj;
return Objects.equals(attributeDefinitions(), other.attributeDefinitions())
&& Objects.equals(tableName(), other.tableName()) && Objects.equals(keySchema(), other.keySchema())
&& Objects.equals(tableStatusAsString(), other.tableStatusAsString())
&& Objects.equals(creationDateTime(), other.creationDateTime())
&& Objects.equals(provisionedThroughput(), other.provisionedThroughput())
&& Objects.equals(tableSizeBytes(), other.tableSizeBytes()) && Objects.equals(itemCount(), other.itemCount())
&& Objects.equals(tableArn(), other.tableArn()) && Objects.equals(tableId(), other.tableId())
&& Objects.equals(billingModeSummary(), other.billingModeSummary())
&& Objects.equals(localSecondaryIndexes(), other.localSecondaryIndexes())
&& Objects.equals(globalSecondaryIndexes(), other.globalSecondaryIndexes())
&& Objects.equals(streamSpecification(), other.streamSpecification())
&& Objects.equals(latestStreamLabel(), other.latestStreamLabel())
&& Objects.equals(latestStreamArn(), other.latestStreamArn())
&& Objects.equals(globalTableVersion(), other.globalTableVersion())
&& Objects.equals(replicas(), other.replicas()) && Objects.equals(restoreSummary(), other.restoreSummary())
&& Objects.equals(sseDescription(), other.sseDescription())
&& Objects.equals(archivalSummary(), other.archivalSummary());
}
/**
* 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 String toString() {
return ToString.builder("TableDescription").add("AttributeDefinitions", attributeDefinitions())
.add("TableName", tableName()).add("KeySchema", keySchema()).add("TableStatus", tableStatusAsString())
.add("CreationDateTime", creationDateTime()).add("ProvisionedThroughput", provisionedThroughput())
.add("TableSizeBytes", tableSizeBytes()).add("ItemCount", itemCount()).add("TableArn", tableArn())
.add("TableId", tableId()).add("BillingModeSummary", billingModeSummary())
.add("LocalSecondaryIndexes", localSecondaryIndexes()).add("GlobalSecondaryIndexes", globalSecondaryIndexes())
.add("StreamSpecification", streamSpecification()).add("LatestStreamLabel", latestStreamLabel())
.add("LatestStreamArn", latestStreamArn()).add("GlobalTableVersion", globalTableVersion())
.add("Replicas", replicas()).add("RestoreSummary", restoreSummary()).add("SSEDescription", sseDescription())
.add("ArchivalSummary", archivalSummary()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AttributeDefinitions":
return Optional.ofNullable(clazz.cast(attributeDefinitions()));
case "TableName":
return Optional.ofNullable(clazz.cast(tableName()));
case "KeySchema":
return Optional.ofNullable(clazz.cast(keySchema()));
case "TableStatus":
return Optional.ofNullable(clazz.cast(tableStatusAsString()));
case "CreationDateTime":
return Optional.ofNullable(clazz.cast(creationDateTime()));
case "ProvisionedThroughput":
return Optional.ofNullable(clazz.cast(provisionedThroughput()));
case "TableSizeBytes":
return Optional.ofNullable(clazz.cast(tableSizeBytes()));
case "ItemCount":
return Optional.ofNullable(clazz.cast(itemCount()));
case "TableArn":
return Optional.ofNullable(clazz.cast(tableArn()));
case "TableId":
return Optional.ofNullable(clazz.cast(tableId()));
case "BillingModeSummary":
return Optional.ofNullable(clazz.cast(billingModeSummary()));
case "LocalSecondaryIndexes":
return Optional.ofNullable(clazz.cast(localSecondaryIndexes()));
case "GlobalSecondaryIndexes":
return Optional.ofNullable(clazz.cast(globalSecondaryIndexes()));
case "StreamSpecification":
return Optional.ofNullable(clazz.cast(streamSpecification()));
case "LatestStreamLabel":
return Optional.ofNullable(clazz.cast(latestStreamLabel()));
case "LatestStreamArn":
return Optional.ofNullable(clazz.cast(latestStreamArn()));
case "GlobalTableVersion":
return Optional.ofNullable(clazz.cast(globalTableVersion()));
case "Replicas":
return Optional.ofNullable(clazz.cast(replicas()));
case "RestoreSummary":
return Optional.ofNullable(clazz.cast(restoreSummary()));
case "SSEDescription":
return Optional.ofNullable(clazz.cast(sseDescription()));
case "ArchivalSummary":
return Optional.ofNullable(clazz.cast(archivalSummary()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function