Class DocumentBlock

    • Method Detail

      • formatAsString

        public final String formatAsString()

        The format of a document, or its extension.

        If the service returns an enum value that is not available in the current SDK version, format will return DocumentFormat.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from formatAsString().

        Returns:
        The format of a document, or its extension.
        See Also:
        DocumentFormat
      • name

        public final String name()

        A name for the document. The name can only contain the following characters:

        • Alphanumeric characters

        • Whitespace characters (no more than one in a row)

        • Hyphens

        • Parentheses

        • Square brackets

        This field is vulnerable to prompt injections, because the model might inadvertently interpret it as instructions. Therefore, we recommend that you specify a neutral name.

        Returns:
        A name for the document. The name can only contain the following characters:

        • Alphanumeric characters

        • Whitespace characters (no more than one in a row)

        • Hyphens

        • Parentheses

        • Square brackets

        This field is vulnerable to prompt injections, because the model might inadvertently interpret it as instructions. Therefore, we recommend that you specify a neutral name.

      • source

        public final DocumentSource source()

        Contains the content of the document.

        Returns:
        Contains the content of the document.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • toString

        public final String toString()
        Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
        Overrides:
        toString in class Object
      • getValueForField

        public final <T> Optional<T> getValueForField​(String fieldName,
                                                      Class<T> clazz)