Class NumberDocument

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

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

    • NumberDocument

      public NumberDocument(SdkNumber number)
      Created a {NumberDocument} with the specified {SdkNumber}. {SdkNumber} is provided as an input to NumberDocument to maintain arbitrary precision of any given number.
      Parameters:
      number -
  • Method Details

    • unwrap

      public Object unwrap()
      Unwraps the Document Number to string value of the {SdkNumber}.
      Specified by:
      unwrap in interface Document
      Returns:
      {SdkNumber} value.
    • 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.
    • isNumber

      public boolean isNumber()
      Specified by:
      isNumber in interface Document
      Returns:
      Returns true if this document is a number value.
    • asNumber

      public SdkNumber asNumber()
      Returned as {SdkNumber}. The number value can be extracted from the Document by using below methods
      Specified by:
      asNumber in interface Document
      Returns:
      {SdkNumber} value.
      See Also:
    • 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:
      Returns the Document map.
    • asList

      public List<Document> asList()
      Specified by:
      asList in interface Document
      Returns:
      Returns the lists of Document.
    • 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 visitNumber of visitor.
    • accept

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