Class DocumentMetadata


  • public class DocumentMetadata
    extends java.lang.Object
    Use this class to pass additional information for a document when uploading it to the Gini API.

    Besides the predefined metadata fields you may also add custom fields.

    • Constructor Summary

      Constructors 
      Constructor Description
      DocumentMetadata()
      Create a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(java.lang.String name, java.lang.String value)
      Add a custom metadata field.
      void setBranchId​(java.lang.String branchId)
      Set a branch identifier to associate the document with a particular branch.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DocumentMetadata

        public DocumentMetadata()
        Create a new instance.
    • Method Detail

      • setBranchId

        public void setBranchId​(@NonNull
                                java.lang.String branchId)
                         throws java.lang.IllegalArgumentException
        Set a branch identifier to associate the document with a particular branch.
        Parameters:
        branchId - an identifier as an ASCII compatible string
        Throws:
        java.lang.IllegalArgumentException - if the branchId string cannot be encoded as ASCII
      • add

        public void add​(@NonNull
                        java.lang.String name,
                        @NonNull
                        java.lang.String value)
                 throws java.lang.IllegalArgumentException
        Add a custom metadata field. If there is already a field with the same name, the previous value will be overwritten with this one.
        Parameters:
        name - field name as an ASCII compatible string
        value - field value as an ASCII compatible string
        Throws:
        java.lang.IllegalArgumentException - if the name or the value cannot be encoded as ASCII