Class StringDocument

    • Constructor Detail

      • StringDocument

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

      • 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.
      • 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.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object