Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2014 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;
 

Represents the capacity units consumed by an operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. ConsumedCapacity is only returned if it was asked for in the request. For more information, see Provisioned Throughput in the Amazon DynamoDB Developer Guide.

 
 public class ConsumedCapacity implements Serializable {

    
The name of the table that was affected by the operation.

Constraints:
Length: 3 - 255
Pattern: [a-zA-Z0-9_.-]+

 
     private String tableName;

    
The total number of capacity units consumed by the operation.
 
     private Double capacityUnits;

    
The amount of throughput consumed on the table affected by the operation.
 
     private Capacity table;

    
The amount of throughput consumed on each local index affected by the operation.
 
     private java.util.Map<String,CapacitylocalSecondaryIndexes;

    
The amount of throughput consumed on each global index affected by the operation.
 
     private java.util.Map<String,CapacityglobalSecondaryIndexes;

    
The name of the table that was affected by the operation.

Constraints:
Length: 3 - 255
Pattern: [a-zA-Z0-9_.-]+

Returns:
The name of the table that was affected by the operation.
 
     public String getTableName() {
         return ;
     }
    
    
The name of the table that was affected by the operation.

Constraints:
Length: 3 - 255
Pattern: [a-zA-Z0-9_.-]+

Parameters:
tableName The name of the table that was affected by the operation.
 
     public void setTableName(String tableName) {
         this. = tableName;
     }
    
    
The name of the table that was affected by the operation.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 3 - 255
Pattern: [a-zA-Z0-9_.-]+

Parameters:
tableName The name of the table that was affected by the operation.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ConsumedCapacity withTableName(String tableName) {
        this. = tableName;
        return this;
    }

    
The total number of capacity units consumed by the operation.

Returns:
The total number of capacity units consumed by the operation.
    public Double getCapacityUnits() {
        return ;
    }
    
    
The total number of capacity units consumed by the operation.

Parameters:
capacityUnits The total number of capacity units consumed by the operation.
    public void setCapacityUnits(Double capacityUnits) {
        this. = capacityUnits;
    }
    
    
The total number of capacity units consumed by the operation.

Returns a reference to this object so that method calls can be chained together.

Parameters:
capacityUnits The total number of capacity units consumed by the operation.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ConsumedCapacity withCapacityUnits(Double capacityUnits) {
        this. = capacityUnits;
        return this;
    }

    
The amount of throughput consumed on the table affected by the operation.

Returns:
The amount of throughput consumed on the table affected by the operation.
    public Capacity getTable() {
        return ;
    }
    
    
The amount of throughput consumed on the table affected by the operation.

Parameters:
table The amount of throughput consumed on the table affected by the operation.
    public void setTable(Capacity table) {
        this. = table;
    }
    
    
The amount of throughput consumed on the table affected by the operation.

Returns a reference to this object so that method calls can be chained together.

Parameters:
table The amount of throughput consumed on the table affected by the operation.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ConsumedCapacity withTable(Capacity table) {
        this. = table;
        return this;
    }

    
The amount of throughput consumed on each local index affected by the operation.

Returns:
The amount of throughput consumed on each local index affected by the operation.
        
        return ;
    }
    
    
The amount of throughput consumed on each local index affected by the operation.

Parameters:
localSecondaryIndexes The amount of throughput consumed on each local index affected by the operation.
    public void setLocalSecondaryIndexes(java.util.Map<String,CapacitylocalSecondaryIndexes) {
        this. = localSecondaryIndexes;
    }
    
    
The amount of throughput consumed on each local index affected by the operation.

Returns a reference to this object so that method calls can be chained together.

Parameters:
localSecondaryIndexes The amount of throughput consumed on each local index affected by the operation.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ConsumedCapacity withLocalSecondaryIndexes(java.util.Map<String,CapacitylocalSecondaryIndexes) {
        setLocalSecondaryIndexes(localSecondaryIndexes);
        return this;
    }

    
The amount of throughput consumed on each local index affected by the operation.

The method adds a new key-value pair into LocalSecondaryIndexes parameter, and returns a reference to this object so that method calls can be chained together.

Parameters:
key The key of the entry to be added into LocalSecondaryIndexes.
value The corresponding value of the entry to be added into LocalSecondaryIndexes.
        if (null == this.) {
            this. = new java.util.HashMap<String,Capacity>();
        }
        if (this..containsKey(key))
            throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
        this..put(keyvalue);
        return this;
    }

    
Removes all the entries added into LocalSecondaryIndexes.

Returns a reference to this object so that method calls can be chained together.

        this. = null;
        return this;
    }
    
    
The amount of throughput consumed on each global index affected by the operation.

Returns:
The amount of throughput consumed on each global index affected by the operation.
        
        return ;
    }
    
    
The amount of throughput consumed on each global index affected by the operation.

Parameters:
globalSecondaryIndexes The amount of throughput consumed on each global index affected by the operation.
    public void setGlobalSecondaryIndexes(java.util.Map<String,CapacityglobalSecondaryIndexes) {
        this. = globalSecondaryIndexes;
    }
    
    
The amount of throughput consumed on each global index affected by the operation.

Returns a reference to this object so that method calls can be chained together.

Parameters:
globalSecondaryIndexes The amount of throughput consumed on each global index affected by the operation.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ConsumedCapacity withGlobalSecondaryIndexes(java.util.Map<String,CapacityglobalSecondaryIndexes) {
        setGlobalSecondaryIndexes(globalSecondaryIndexes);
        return this;
    }

    
The amount of throughput consumed on each global index affected by the operation.

The method adds a new key-value pair into GlobalSecondaryIndexes parameter, and returns a reference to this object so that method calls can be chained together.

Parameters:
key The key of the entry to be added into GlobalSecondaryIndexes.
value The corresponding value of the entry to be added into GlobalSecondaryIndexes.
        if (null == this.) {
            this. = new java.util.HashMap<String,Capacity>();
        }
        if (this..containsKey(key))
            throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
        this..put(keyvalue);
        return this;
    }

    
Removes all the entries added into GlobalSecondaryIndexes.

Returns a reference to this object so that method calls can be chained together.

        this. = null;
        return this;
    }
    
    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getTableName() != nullsb.append("TableName: " + getTableName() + ",");
        if (getCapacityUnits() != nullsb.append("CapacityUnits: " + getCapacityUnits() + ",");
        if (getTable() != nullsb.append("Table: " + getTable() + ",");
        if (getLocalSecondaryIndexes() != nullsb.append("LocalSecondaryIndexes: " + getLocalSecondaryIndexes() + ",");
        if (getGlobalSecondaryIndexes() != nullsb.append("GlobalSecondaryIndexes: " + getGlobalSecondaryIndexes() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode()); 
        hashCode = prime * hashCode + ((getCapacityUnits() == null) ? 0 : getCapacityUnits().hashCode()); 
        hashCode = prime * hashCode + ((getTable() == null) ? 0 : getTable().hashCode()); 
        hashCode = prime * hashCode + ((getLocalSecondaryIndexes() == null) ? 0 : getLocalSecondaryIndexes().hashCode()); 
        hashCode = prime * hashCode + ((getGlobalSecondaryIndexes() == null) ? 0 : getGlobalSecondaryIndexes().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ConsumedCapacity == falsereturn false;
        ConsumedCapacity other = (ConsumedCapacity)obj;
        
        if (other.getTableName() == null ^ this.getTableName() == nullreturn false;
        if (other.getTableName() != null && other.getTableName().equals(this.getTableName()) == falsereturn false
        if (other.getCapacityUnits() == null ^ this.getCapacityUnits() == nullreturn false;
        if (other.getCapacityUnits() != null && other.getCapacityUnits().equals(this.getCapacityUnits()) == falsereturn false
        if (other.getTable() == null ^ this.getTable() == nullreturn false;
        if (other.getTable() != null && other.getTable().equals(this.getTable()) == falsereturn false
        if (other.getLocalSecondaryIndexes() == null ^ this.getLocalSecondaryIndexes() == nullreturn false;
        if (other.getLocalSecondaryIndexes() != null && other.getLocalSecondaryIndexes().equals(this.getLocalSecondaryIndexes()) == falsereturn false
        if (other.getGlobalSecondaryIndexes() == null ^ this.getGlobalSecondaryIndexes() == nullreturn false;
        if (other.getGlobalSecondaryIndexes() != null && other.getGlobalSecondaryIndexes().equals(this.getGlobalSecondaryIndexes()) == falsereturn false
        return true;
    }
    
}
    
New to GrepCode? Check out our FAQ X