Class MapDocument
- java.lang.Object
-
- software.amazon.awssdk.core.document.internal.MapDocument
-
- All Implemented Interfaces:
Serializable
,Document
@Immutable public final class MapDocument extends Object implements Document
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MapDocument.MapBuilderInternal
-
Nested classes/interfaces inherited from interface software.amazon.awssdk.core.document.Document
Document.ListBuilder, Document.MapBuilder
-
-
Constructor Summary
Constructors Constructor Description MapDocument(Map<String,Document> documentMap)
Create a NewMapDocument
with Map of Document value as passed in constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> R
accept(DocumentVisitor<? extends R> visitor)
Accepts a visitor with the Document.void
accept(VoidDocumentVisitor visitor)
Accepts a visitor with the Document.boolean
asBoolean()
Gets the document as aboolean
if it is a boolean.List<Document>
asList()
Gets the document as aList
if it is a document type array.Map<String,Document>
asMap()
Gets the document as aMap
.SdkNumber
asNumber()
String
asString()
Gets the document as aString
.boolean
equals(Object o)
int
hashCode()
boolean
isMap()
static Document.MapBuilder
mapBuilder()
Create aMapDocument.MapBuilderInternal
for generating aDocument
by directly allowing user to put String Keys and Document Values in the builder methods.String
toString()
Object
unwrap()
Gets the value of the document as a Java type that represents the Loops through the individual Map Entries and unwarap each of the Document Value.
-
-
-
Constructor Detail
-
MapDocument
public MapDocument(Map<String,Document> documentMap)
Create a NewMapDocument
with Map of Document value as passed in constructor- Parameters:
documentMap
- ListDocument documentList.
-
-
Method Detail
-
mapBuilder
public static Document.MapBuilder mapBuilder()
Create aMapDocument.MapBuilderInternal
for generating aDocument
by directly allowing user to put String Keys and Document Values in the builder methods.- Returns:
- Builder to Construct Document with Map of Documents.
-
unwrap
public Object unwrap()
Gets the value of the document as a Java type that represents the Loops through the individual Map Entries and unwarap each of the Document Value.
-
asBoolean
public boolean asBoolean()
Description copied from interface:Document
Gets the document as aboolean
if it is a boolean.
-
asString
public String asString()
Description copied from interface:Document
Gets the document as aString
.
-
isMap
public boolean isMap()
-
asMap
public Map<String,Document> asMap()
Description copied from interface:Document
Gets the document as aMap
.Each value contained in the
Map
is the same as how the value would be represented byDocument
.- Specified by:
asMap
in interfaceDocument
- Returns:
- unmodifiableMap of the Map of Documents in the {
MapDocument
}.
-
asList
public List<Document> asList()
Description copied from interface:Document
Gets the document as aList
if it is a document type array.Each value contained in the
List
is the same as how the value would be represented byDocument
.
-
accept
public <R> R accept(DocumentVisitor<? extends R> visitor)
Accepts a visitor with the Document.
-
accept
public void accept(VoidDocumentVisitor visitor)
Accepts a visitor with the Document. Calls visitMap of visitor.
-
-