com.amazonaws.services.dynamodbv2.model.TransactWriteItemsResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-dynamodb Show documentation
/*
* Copyright 2015-2020 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 com.amazonaws.services.dynamodbv2.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class TransactWriteItemsResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* The capacity units consumed by the entire TransactWriteItems
operation. The values of the list are
* ordered according to the ordering of the TransactItems
request parameter.
*
*/
private java.util.List consumedCapacity;
/**
*
* A list of tables that were processed by TransactWriteItems
and, for each table, information about
* any item collections that were affected by individual UpdateItem
, PutItem
, or
* DeleteItem
operations.
*
*/
private java.util.Map> itemCollectionMetrics;
/**
*
* The capacity units consumed by the entire TransactWriteItems
operation. The values of the list are
* ordered according to the ordering of the TransactItems
request parameter.
*
*
* @return The capacity units consumed by the entire TransactWriteItems
operation. The values of the
* list are ordered according to the ordering of the TransactItems
request parameter.
*/
public java.util.List getConsumedCapacity() {
return consumedCapacity;
}
/**
*
* The capacity units consumed by the entire TransactWriteItems
operation. The values of the list are
* ordered according to the ordering of the TransactItems
request parameter.
*
*
* @param consumedCapacity
* The capacity units consumed by the entire TransactWriteItems
operation. The values of the
* list are ordered according to the ordering of the TransactItems
request parameter.
*/
public void setConsumedCapacity(java.util.Collection consumedCapacity) {
if (consumedCapacity == null) {
this.consumedCapacity = null;
return;
}
this.consumedCapacity = new java.util.ArrayList(consumedCapacity);
}
/**
*
* The capacity units consumed by the entire TransactWriteItems
operation. The values of the list are
* ordered according to the ordering of the TransactItems
request parameter.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setConsumedCapacity(java.util.Collection)} or {@link #withConsumedCapacity(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param consumedCapacity
* The capacity units consumed by the entire TransactWriteItems
operation. The values of the
* list are ordered according to the ordering of the TransactItems
request parameter.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TransactWriteItemsResult withConsumedCapacity(ConsumedCapacity... consumedCapacity) {
if (this.consumedCapacity == null) {
setConsumedCapacity(new java.util.ArrayList(consumedCapacity.length));
}
for (ConsumedCapacity ele : consumedCapacity) {
this.consumedCapacity.add(ele);
}
return this;
}
/**
*
* The capacity units consumed by the entire TransactWriteItems
operation. The values of the list are
* ordered according to the ordering of the TransactItems
request parameter.
*
*
* @param consumedCapacity
* The capacity units consumed by the entire TransactWriteItems
operation. The values of the
* list are ordered according to the ordering of the TransactItems
request parameter.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TransactWriteItemsResult withConsumedCapacity(java.util.Collection consumedCapacity) {
setConsumedCapacity(consumedCapacity);
return this;
}
/**
*
* A list of tables that were processed by TransactWriteItems
and, for each table, information about
* any item collections that were affected by individual UpdateItem
, PutItem
, or
* DeleteItem
operations.
*
*
* @return A list of tables that were processed by TransactWriteItems
and, for each table, information
* about any item collections that were affected by individual UpdateItem
, PutItem
* , or DeleteItem
operations.
*/
public java.util.Map> getItemCollectionMetrics() {
return itemCollectionMetrics;
}
/**
*
* A list of tables that were processed by TransactWriteItems
and, for each table, information about
* any item collections that were affected by individual UpdateItem
, PutItem
, or
* DeleteItem
operations.
*
*
* @param itemCollectionMetrics
* A list of tables that were processed by TransactWriteItems
and, for each table, information
* about any item collections that were affected by individual UpdateItem
, PutItem
,
* or DeleteItem
operations.
*/
public void setItemCollectionMetrics(java.util.Map> itemCollectionMetrics) {
this.itemCollectionMetrics = itemCollectionMetrics;
}
/**
*
* A list of tables that were processed by TransactWriteItems
and, for each table, information about
* any item collections that were affected by individual UpdateItem
, PutItem
, or
* DeleteItem
operations.
*
*
* @param itemCollectionMetrics
* A list of tables that were processed by TransactWriteItems
and, for each table, information
* about any item collections that were affected by individual UpdateItem
, PutItem
,
* or DeleteItem
operations.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TransactWriteItemsResult withItemCollectionMetrics(java.util.Map> itemCollectionMetrics) {
setItemCollectionMetrics(itemCollectionMetrics);
return this;
}
/**
* Add a single ItemCollectionMetrics entry
*
* @see TransactWriteItemsResult#withItemCollectionMetrics
* @returns a reference to this object so that method calls can be chained together.
*/
public TransactWriteItemsResult addItemCollectionMetricsEntry(String key, java.util.List value) {
if (null == this.itemCollectionMetrics) {
this.itemCollectionMetrics = new java.util.HashMap>();
}
if (this.itemCollectionMetrics.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.itemCollectionMetrics.put(key, value);
return this;
}
/**
* Removes all the entries added into ItemCollectionMetrics.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TransactWriteItemsResult clearItemCollectionMetricsEntries() {
this.itemCollectionMetrics = null;
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getConsumedCapacity() != null)
sb.append("ConsumedCapacity: ").append(getConsumedCapacity()).append(",");
if (getItemCollectionMetrics() != null)
sb.append("ItemCollectionMetrics: ").append(getItemCollectionMetrics());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof TransactWriteItemsResult == false)
return false;
TransactWriteItemsResult other = (TransactWriteItemsResult) obj;
if (other.getConsumedCapacity() == null ^ this.getConsumedCapacity() == null)
return false;
if (other.getConsumedCapacity() != null && other.getConsumedCapacity().equals(this.getConsumedCapacity()) == false)
return false;
if (other.getItemCollectionMetrics() == null ^ this.getItemCollectionMetrics() == null)
return false;
if (other.getItemCollectionMetrics() != null && other.getItemCollectionMetrics().equals(this.getItemCollectionMetrics()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getConsumedCapacity() == null) ? 0 : getConsumedCapacity().hashCode());
hashCode = prime * hashCode + ((getItemCollectionMetrics() == null) ? 0 : getItemCollectionMetrics().hashCode());
return hashCode;
}
@Override
public TransactWriteItemsResult clone() {
try {
return (TransactWriteItemsResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}