Class StringDocument

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

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

    • StringDocument

      public StringDocument(String string)
      Create a New StringDocument with boolean value as passed in constructor
      Parameters:
      string - boolean value.
  • Method Details

    • unwrap

      public Object unwrap()
      Unwraps the Document Boolean to a String Object.
      Specified by:
      unwrap in interface Document
      Returns:
      string value.
    • asBoolean

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

      public boolean isString()
      Specified by:
      isString in interface Document
      Returns:
      true, since this is a Document String.
    • asString

      public String asString()
      Gets the String value of the Document.
      Specified by:
      asString in interface Document
      Returns:
      string value.
    • 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:
      true, since this is a Document String.
    • 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:
      true, since this is a Document String.
    • 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:
      true, since this is a Document String.
    • 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 visitString of visitor.
    • accept

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