public static class Item.Builder extends Object implements software.amazon.awssdk.utils.builder.SdkBuilder<Item.Builder,Item>
Modifier and Type | Method and Description |
---|---|
Item.Builder |
attribute(String key,
Boolean booleanValue)
Adds an
AttributeValue representing a Boolean to the item with the specified key. |
Item.Builder |
attribute(String key,
byte[] binaryValue)
Adds an
AttributeValue representing binary data to the item with the specified key. |
Item.Builder |
attribute(String key,
ByteBuffer binaryValue)
Adds an
AttributeValue representing binary data to the item with the specified key. |
Item.Builder |
attribute(String key,
List<?> values)
Adds an
AttributeValue representing a list of AttributeValues to the item with the specified key. |
Item.Builder |
attribute(String key,
Map<String,?> values)
Adds an
AttributeValue representing a map of string to AttributeValues to the item with the specified key. |
Item.Builder |
attribute(String key,
Number numericValue)
Adds an
AttributeValue representing a Number to the item with the specified key. |
Item.Builder |
attribute(String key,
String stringValue)
Adds an
AttributeValue representing a String to the item with the specified key. |
Item |
build()
Build a
Map representing a DyanmoDB item. |
Item.Builder |
byteArrays(String key,
byte[]... byteArrays)
Adds an
AttributeValue representing a list of binary data to the item with the specified key. |
Item.Builder |
byteArrays(String key,
Collection<byte[]> byteArrays)
Adds an
AttributeValue representing a list of binary data to the item with the specified key. |
Item.Builder |
byteBuffers(String key,
ByteBuffer... binaryValues)
Adds an
AttributeValue representing a list of binary data to the item with the specified key. |
Item.Builder |
byteBuffers(String key,
Collection<? extends ByteBuffer> binaryValues)
Adds an
AttributeValue representing a list of binary data to the item with the specified key. |
Item.Builder |
numbers(String key,
Collection<? extends Number> numberValues)
Adds an
AttributeValue representing a list of numbers to the item with the specified key. |
Item.Builder |
numbers(String key,
Number... numberValues)
Adds an
AttributeValue representing a list of numbers to the item with the specified key. |
Item.Builder |
strings(String key,
Collection<String> stringValues)
Adds an
AttributeValue representing a list of strings to the item with the specified key. |
Item.Builder |
strings(String key,
String... stringValues)
Adds an
AttributeValue representing a list of strings to the item with the specified key. |
public Item build()
Map
representing a DyanmoDB item.build
in interface software.amazon.awssdk.utils.builder.SdkBuilder<Item.Builder,Item>
Map
representing a DyanmoDB itempublic Item.Builder attribute(String key, String stringValue)
AttributeValue
representing a String to the item with the specified key.
Equivalent of:
itemMap.put(key, AttributeValue.builder().s(stringValue).build());
key
- the key of this attributestringValue
- the string value of the attributepublic Item.Builder attribute(String key, Boolean booleanValue)
AttributeValue
representing a Boolean to the item with the specified key.
Equivalent of:
itemMap.put(key, AttributeValue.builder().bool(booleanValue).build());
key
- the key of this attributebooleanValue
- the boolean value of the attributepublic Item.Builder attribute(String key, Number numericValue)
AttributeValue
representing a Number to the item with the specified key.
Equivalent of:
itemMap.put(key, AttributeValue.builder().n(String.valueOf(numericValue)).build());
key
- the key of this attributenumericValue
- the numeric value of the attributepublic Item.Builder attribute(String key, byte[] binaryValue)
AttributeValue
representing binary data to the item with the specified key.
Equivalent of:
itemMap.put(key, AttributeValue.builder().b(ByteBuffer.wrap(binaryValue)).build());
key
- the key of this attributebinaryValue
- the binary value of the attributepublic Item.Builder attribute(String key, ByteBuffer binaryValue)
AttributeValue
representing binary data to the item with the specified key.
Equivalent of:
itemMap.put(key, AttributeValue.builder().b(binaryValue).build());
key
- the key of this attributebinaryValue
- the binary value of the attributepublic Item.Builder attribute(String key, List<?> values)
AttributeValue
representing a list of AttributeValues to the item with the specified key.
This will attempt to infer the of of the AttributeValue
for each given Object
in the list
based on the type. Supported types are:
AttributeValue
which is unalteredString
becomes AttributeValue.s()
Number
(and anything that can be automatically boxed to Number
including
int, long, float etc.) becomes AttributeValue.n()
Boolean
(and bool) becomes AttributeValue.bool()
AttributeValue.b()
ByteBuffer
becomes AttributeValue.b()
List
<Object> (where the containing objects are one of the types in
this list) becomes AttributeValue.l()
Map
<String, Object> (where the containing object values are one of the types
in this list) becomes AttributeValue.m()
key
- the key of this attributevalues
- the object valuespublic Item.Builder attribute(String key, Map<String,?> values)
AttributeValue
representing a map of string to AttributeValues to the item with the specified key.
This will attempt to infer the most appropriate AttributeValue
for each given Object
value in the map
based on the type. Supported types are:
AttributeValue
which is unalteredString
becomes AttributeValue.s()
Number
(and anything that can be automatically boxed to Number
including
int, long, float etc.) becomes AttributeValue.n()
Boolean
(and bool) becomes AttributeValue.bool()
AttributeValue.b()
ByteBuffer
becomes AttributeValue.b()
List
<Object> (where the containing objects are one of the types in
this list) becomes AttributeValue.l()
Map
<String, Object> (where the containing object values are one of the types
in this list) becomes AttributeValue.m()
key
- the key of this attributevalues
- the map of key to objectpublic Item.Builder strings(String key, String... stringValues)
AttributeValue
representing a list of strings to the item with the specified key.
Equivalent of:
itemMap.put(key, AttributeValue.builder().ss(stringValue1, stringValue2, ...).build());
key
- the key of this attributestringValues
- the string values of the attributepublic Item.Builder strings(String key, Collection<String> stringValues)
AttributeValue
representing a list of strings to the item with the specified key.
Equivalent of:
itemMap.put(key, AttributeValue.builder().ss(stringValues).build());
key
- the key of this attributestringValues
- the string values of the attributepublic Item.Builder numbers(String key, Number... numberValues)
AttributeValue
representing a list of numbers to the item with the specified key.
Equivalent of:
itemMap.put(key, AttributeValue.builder().ns(numberValues1, numberValues2, ...).build());
key
- the key of this attributenumberValues
- the number values of the attributepublic Item.Builder numbers(String key, Collection<? extends Number> numberValues)
AttributeValue
representing a list of numbers to the item with the specified key.
Equivalent of:
itemMap.put(key, AttributeValue.builder().ns(numberValues).build());
key
- the key of this attributenumberValues
- the number values of the attributepublic Item.Builder byteArrays(String key, byte[]... byteArrays)
AttributeValue
representing a list of binary data to the item with the specified key.
Equivalent of:
itemMap.put(key, AttributeValue.builder().bs(Arrays.stream(byteArrays)
.map(ByteBuffer::wrap)
.collect(Collectors.toList())).build());
key
- the key of this attributebyteArrays
- the binary values of the attributepublic Item.Builder byteArrays(String key, Collection<byte[]> byteArrays)
AttributeValue
representing a list of binary data to the item with the specified key.
Equivalent of:
itemMap.put(key, AttributeValue.builder().bs(byteArrays.stream()
.map(ByteBuffer::wrap)
.collect(Collectors.toList())).build());
key
- the key of this attributebyteArrays
- the binary values of the attributepublic Item.Builder byteBuffers(String key, ByteBuffer... binaryValues)
AttributeValue
representing a list of binary data to the item with the specified key.
Equivalent of:
itemMap.put(key, AttributeValue.builder().bs(binaryValues1, binaryValues2, ...)).build());
key
- the key of this attributebyteArrays
- the binary values of the attributepublic Item.Builder byteBuffers(String key, Collection<? extends ByteBuffer> binaryValues)
AttributeValue
representing a list of binary data to the item with the specified key.
Equivalent of:
itemMap.put(key, AttributeValue.builder().bs(binaryValues).build());
key
- the key of this attributebyteArrays
- the binary values of the attributeCopyright © 2017. All rights reserved.