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:
  • Constructor Details

    • MapDocument

      public MapDocument(Map<String,Document> documentMap)
      Create a New MapDocument with Map of Document value as passed in constructor
      Parameters:
      documentMap - ListDocument documentList.
  • Method Details

    • mapBuilder

      public static Document.MapBuilder mapBuilder()
      Create a MapDocument.MapBuilderInternal for generating a Document 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.
      Specified by:
      unwrap in interface Document
      Returns:
      Returns the Map with Keys as String and Values as Map<Object>.
    • asBoolean

      public boolean asBoolean()
      Description copied from interface: Document
      Gets the document as a boolean if it is a boolean.
      Specified by:
      asBoolean in interface Document
      Returns:
      UnsupportedOperationException
    • asString

      public String asString()
      Description copied from interface: Document
      Gets the document as a String.
      Specified by:
      asString in interface Document
      Returns:
      UnsupportedOperationException
    • asNumber

      public SdkNumber asNumber()
      Description copied from interface: Document
      Gets the document as a SdkNumber if it is a SdkNumber.
      Specified by:
      asNumber in interface Document
      Returns:
      UnsupportedOperationException
    • isMap

      public boolean isMap()
      Specified by:
      isMap in interface Document
      Returns:
      UnsupportedOperationException
    • asMap

      public Map<String,Document> asMap()
      Description copied from interface: Document
      Gets the document as a Map.

      Each value contained in the Map is the same as how the value would be represented by Document.

      Specified by:
      asMap in interface Document
      Returns:
      unmodifiableMap of the Map of Documents in the {MapDocument}.
    • asList

      public List<Document> asList()
      Description copied from interface: Document
      Gets the document as a List if it is a document type array.

      Each value contained in the List is the same as how the value would be represented by Document.

      Specified by:
      asList in interface Document
      Returns:
      UnsupportedOperationException
    • accept

      public <R> R accept(DocumentVisitor<? extends R> visitor)
      Accepts a visitor with the Document.
      Specified by:
      accept in interface Document
      Type Parameters:
      R - visitor return type.
      Parameters:
      visitor - Visitor to dispatch to.
      Returns:
      Returns the accepted result by calling visitMap of visitor.
    • accept

      public void accept(VoidDocumentVisitor visitor)
      Accepts a visitor with the Document. Calls visitMap of visitor.
      Specified by:
      accept in interface Document
      Parameters:
      visitor - Visitor to dispatch to.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object