/* * Copyright 2010-2019 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; /** *
* Represents the data for an attribute. *
** Each attribute value is described as a name-value pair. The name is the data * type, and the value is the data itself. *
** For more information, see Data Types in the Amazon DynamoDB Developer Guide. *
*/ public class AttributeValue implements Serializable { /** ** An attribute of type String. For example: *
*
* "S": "Hello"
*
* An attribute of type Number. For example: *
*
* "N": "123.45"
*
* Numbers are sent across the network to DynamoDB as strings, to maximize * compatibility across languages and libraries. However, DynamoDB treats * them as number type attributes for mathematical operations. *
*/ private String n; /** ** An attribute of type Binary. For example: *
*
* "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
*
* An attribute of type String Set. For example: *
*
* "SS": ["Giraffe", "Hippo" ,"Zebra"]
*
* An attribute of type Number Set. For example: *
*
* "NS": ["42.2", "-19", "7.5", "3.14"]
*
* Numbers are sent across the network to DynamoDB as strings, to maximize * compatibility across languages and libraries. However, DynamoDB treats * them as number type attributes for mathematical operations. *
*/ private java.util.List* An attribute of type Binary Set. For example: *
*
* "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
*
* An attribute of type Map. For example: *
*
* "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
*
* An attribute of type List. For example: *
*
* "L": ["Cookies", "Coffee", 3.14159]
*
* An attribute of type Null. For example: *
*
* "NULL": true
*
* An attribute of type Boolean. For example: *
*
* "BOOL": true
*
* An attribute of type String. For example: *
*
* "S": "Hello"
*
* An attribute of type String Set. For example: *
*
* "SS": ["Giraffe", "Hippo" ,"Zebra"]
*
* An attribute of type String. For example: *
*
* "S": "Hello"
*
* An attribute of type String. For example: *
*
* "S": "Hello"
*
* An attribute of type String. For example: *
*
* "S": "Hello"
*
* An attribute of type String. For example: *
*
* "S": "Hello"
*
* An attribute of type String. For example: *
*
* "S": "Hello"
*
* Returns a reference to this object so that method calls can be chained * together. * * @param s
* An attribute of type String. For example: *
*
* "S": "Hello"
*
* An attribute of type Number. For example: *
*
* "N": "123.45"
*
* Numbers are sent across the network to DynamoDB as strings, to maximize * compatibility across languages and libraries. However, DynamoDB treats * them as number type attributes for mathematical operations. *
* * @return* An attribute of type Number. For example: *
*
* "N": "123.45"
*
* Numbers are sent across the network to DynamoDB as strings, to * maximize compatibility across languages and libraries. However, * DynamoDB treats them as number type attributes for mathematical * operations. *
*/ public String getN() { return n; } /** ** An attribute of type Number. For example: *
*
* "N": "123.45"
*
* Numbers are sent across the network to DynamoDB as strings, to maximize * compatibility across languages and libraries. However, DynamoDB treats * them as number type attributes for mathematical operations. *
* * @param n* An attribute of type Number. For example: *
*
* "N": "123.45"
*
* Numbers are sent across the network to DynamoDB as strings, to * maximize compatibility across languages and libraries. * However, DynamoDB treats them as number type attributes for * mathematical operations. *
*/ public void setN(String n) { this.n = n; } /** ** An attribute of type Number. For example: *
*
* "N": "123.45"
*
* Numbers are sent across the network to DynamoDB as strings, to maximize * compatibility across languages and libraries. However, DynamoDB treats * them as number type attributes for mathematical operations. *
** Returns a reference to this object so that method calls can be chained * together. * * @param n
* An attribute of type Number. For example: *
*
* "N": "123.45"
*
* Numbers are sent across the network to DynamoDB as strings, to * maximize compatibility across languages and libraries. * However, DynamoDB treats them as number type attributes for * mathematical operations. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AttributeValue withN(String n) { this.n = n; return this; } /** ** An attribute of type Binary. For example: *
*
* "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
*
* An attribute of type Binary. For example: *
*
* "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
*
* An attribute of type Binary. For example: *
*
* "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
*
* An attribute of type Binary. For example: *
*
* "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
*
* An attribute of type Binary. For example: *
*
* "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
*
* Returns a reference to this object so that method calls can be chained * together. * * @param b
* An attribute of type Binary. For example: *
*
* "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
*
* An attribute of type String Set. For example: *
*
* "SS": ["Giraffe", "Hippo" ,"Zebra"]
*
* An attribute of type String Set. For example: *
*
* "SS": ["Giraffe", "Hippo" ,"Zebra"]
*
* An attribute of type String Set. For example: *
*
* "SS": ["Giraffe", "Hippo" ,"Zebra"]
*
* An attribute of type String Set. For example: *
*
* "SS": ["Giraffe", "Hippo" ,"Zebra"]
*
* An attribute of type String Set. For example: *
*
* "SS": ["Giraffe", "Hippo" ,"Zebra"]
*
* Returns a reference to this object so that method calls can be chained * together. * * @param sS
* An attribute of type String Set. For example: *
*
* "SS": ["Giraffe", "Hippo" ,"Zebra"]
*
* An attribute of type String Set. For example: *
*
* "SS": ["Giraffe", "Hippo" ,"Zebra"]
*
* Returns a reference to this object so that method calls can be chained * together. * * @param sS
* An attribute of type String Set. For example: *
*
* "SS": ["Giraffe", "Hippo" ,"Zebra"]
*
* An attribute of type Number Set. For example: *
*
* "NS": ["42.2", "-19", "7.5", "3.14"]
*
* Numbers are sent across the network to DynamoDB as strings, to maximize * compatibility across languages and libraries. However, DynamoDB treats * them as number type attributes for mathematical operations. *
* * @return* An attribute of type Number Set. For example: *
*
* "NS": ["42.2", "-19", "7.5", "3.14"]
*
* Numbers are sent across the network to DynamoDB as strings, to * maximize compatibility across languages and libraries. However, * DynamoDB treats them as number type attributes for mathematical * operations. *
*/ public java.util.List* An attribute of type Number Set. For example: *
*
* "NS": ["42.2", "-19", "7.5", "3.14"]
*
* Numbers are sent across the network to DynamoDB as strings, to maximize * compatibility across languages and libraries. However, DynamoDB treats * them as number type attributes for mathematical operations. *
* * @param nS* An attribute of type Number Set. For example: *
*
* "NS": ["42.2", "-19", "7.5", "3.14"]
*
* Numbers are sent across the network to DynamoDB as strings, to * maximize compatibility across languages and libraries. * However, DynamoDB treats them as number type attributes for * mathematical operations. *
*/ public void setNS(java.util.Collection* An attribute of type Number Set. For example: *
*
* "NS": ["42.2", "-19", "7.5", "3.14"]
*
* Numbers are sent across the network to DynamoDB as strings, to maximize * compatibility across languages and libraries. However, DynamoDB treats * them as number type attributes for mathematical operations. *
** Returns a reference to this object so that method calls can be chained * together. * * @param nS
* An attribute of type Number Set. For example: *
*
* "NS": ["42.2", "-19", "7.5", "3.14"]
*
* Numbers are sent across the network to DynamoDB as strings, to * maximize compatibility across languages and libraries. * However, DynamoDB treats them as number type attributes for * mathematical operations. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AttributeValue withNS(String... nS) { if (getNS() == null) { this.nS = new java.util.ArrayList* An attribute of type Number Set. For example: *
*
* "NS": ["42.2", "-19", "7.5", "3.14"]
*
* Numbers are sent across the network to DynamoDB as strings, to maximize * compatibility across languages and libraries. However, DynamoDB treats * them as number type attributes for mathematical operations. *
** Returns a reference to this object so that method calls can be chained * together. * * @param nS
* An attribute of type Number Set. For example: *
*
* "NS": ["42.2", "-19", "7.5", "3.14"]
*
* Numbers are sent across the network to DynamoDB as strings, to * maximize compatibility across languages and libraries. * However, DynamoDB treats them as number type attributes for * mathematical operations. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AttributeValue withNS(java.util.Collection* An attribute of type Binary Set. For example: *
*
* "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
*
* An attribute of type Binary Set. For example: *
*
* "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
*
* An attribute of type Binary Set. For example: *
*
* "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
*
* An attribute of type Binary Set. For example: *
*
* "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
*
* An attribute of type Binary Set. For example: *
*
* "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
*
* Returns a reference to this object so that method calls can be chained * together. * * @param bS
* An attribute of type Binary Set. For example: *
*
* "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
*
* An attribute of type Binary Set. For example: *
*
* "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
*
* Returns a reference to this object so that method calls can be chained * together. * * @param bS
* An attribute of type Binary Set. For example: *
*
* "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
*
* An attribute of type Map. For example: *
*
* "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
*
* An attribute of type Map. For example: *
*
* "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
*
* An attribute of type Map. For example: *
*
* "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
*
* An attribute of type Map. For example: *
*
* "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
*
* An attribute of type Map. For example: *
*
* "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
*
* Returns a reference to this object so that method calls can be chained * together. * * @param m
* An attribute of type Map. For example: *
*
* "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
*
* An attribute of type Map. For example: *
*
* "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
*
* The method adds a new key-value pair into M parameter, and returns a
* reference to this object so that method calls can be chained together.
*
* @param key The key of the entry to be added into M.
* @param value The corresponding value of the entry to be added into M.
* @return A reference to this updated object so that method calls can be
* chained together.
*/
public AttributeValue addMEntry(String key, AttributeValue value) {
if (null == this.m) {
this.m = new java.util.HashMap
* Returns a reference to this object so that method calls can be chained
* together.
*/
public AttributeValue clearMEntries() {
this.m = null;
return this;
}
/**
*
* An attribute of type List. For example:
*
*
* An attribute of type List. For example:
*
*
* An attribute of type List. For example:
*
*
* An attribute of type List. For example:
*
*
* An attribute of type List. For example:
*
*
* Returns a reference to this object so that method calls can be chained
* together.
*
* @param l
* An attribute of type List. For example:
*
*
* An attribute of type List. For example:
*
*
* Returns a reference to this object so that method calls can be chained
* together.
*
* @param l
* An attribute of type List. For example:
*
*
* An attribute of type Null. For example:
*
*
* An attribute of type Null. For example:
*
*
* An attribute of type Null. For example:
*
*
* An attribute of type Null. For example:
*
*
* An attribute of type Null. For example:
*
*
* An attribute of type Null. For example:
*
*
* An attribute of type Null. For example:
*
*
* Returns a reference to this object so that method calls can be chained
* together.
*
* @param nULL
* An attribute of type Null. For example:
*
*
* An attribute of type Boolean. For example:
*
*
* An attribute of type Boolean. For example:
*
*
* An attribute of type Boolean. For example:
*
*
* An attribute of type Boolean. For example:
*
*
* An attribute of type Boolean. For example:
*
*
* An attribute of type Boolean. For example:
*
*
* An attribute of type Boolean. For example:
*
*
* Returns a reference to this object so that method calls can be chained
* together.
*
* @param bOOL
* An attribute of type Boolean. For example:
*
* "L": ["Cookies", "Coffee", 3.14159]
* "L": ["Cookies", "Coffee", 3.14159]
* "L": ["Cookies", "Coffee", 3.14159]
* "L": ["Cookies", "Coffee", 3.14159]
* "L": ["Cookies", "Coffee", 3.14159]
* "L": ["Cookies", "Coffee", 3.14159]
* "L": ["Cookies", "Coffee", 3.14159]
* "L": ["Cookies", "Coffee", 3.14159]
* "NULL": true
* "NULL": true
* "NULL": true
* "NULL": true
* "NULL": true
* "NULL": true
* "NULL": true
* "NULL": true
* "BOOL": true
* "BOOL": true
* "BOOL": true
* "BOOL": true
* "BOOL": true
* "BOOL": true
* "BOOL": true
* "BOOL": true
*