Class ListDocument

java.lang.Object
software.amazon.awssdk.core.document.internal.ListDocument
All Implemented Interfaces:
Serializable, Document

@SdkInternalApi @Immutable public final class ListDocument extends Object implements Document
See Also:
  • Constructor Details

    • ListDocument

      public ListDocument(List<Document> documentList)
      Create a New ListDocument with List of Document documentList as passed in constructor
      Parameters:
      documentList - ListDocument documentList.
  • Method Details

    • listBuilder

      public static Document.ListBuilder listBuilder()
      Provides Builder methods of ListDocument.ListBuilderInternal to directly create Document with List of Documents
      Returns:
      Builder methods to Construct Document with List of Documents.
    • unwrap

      public Object unwrap()
      Gets the value of the document as a Java type that represents the Loops through the individual Document and unwraps each of the document.
      Specified by:
      unwrap in interface Document
      Returns:
      Returns the List<Object>.
    • asBoolean

      public boolean asBoolean()
      Specified by:
      asBoolean in interface Document
      Returns:
      Returns the boolean value.
    • asString

      public String asString()
      Specified by:
      asString in interface Document
      Returns:
      Returns the string value.
    • asNumber

      public SdkNumber asNumber()
      Specified by:
      asNumber in interface Document
      Returns:
      Returns the SdkNumber.
    • asMap

      public Map<String,Document> asMap()
      Specified by:
      asMap in interface Document
      Returns:
      Returns the Document map.
    • isList

      public boolean isList()
      Specified by:
      isList in interface Document
      Returns:
      true, since this is a Document List.
    • 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:
      unmodifiableList of the List of Documents in the {ListDocument}.
    • 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 visitList of visitor.
    • accept

      public void accept(VoidDocumentVisitor visitor)
      Accepts a visitor with the Document. Calls visitList 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