Class VitamDocument<E>

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String[] ES_FILTER_OUT
      Filter ES out
      static java.lang.String ID
      ID of each line: different for each sub type
      static java.lang.String IMPLEMENTATIONVERSION
      Current Vitam Version
      static java.lang.String SCORE
      Score
      static java.lang.String SEDAVERSION
      Current Seda Version
      static java.lang.String TENANT_ID
      TenantId
      static java.lang.String VERSION
      Version of the document: Incremented for each main updates (excluding computed fields)
      • Fields inherited from interface org.bson.conversions.Bson

        DEFAULT_CODEC_REGISTRY
    • Constructor Summary

      Constructors 
      Constructor Description
      VitamDocument()
      Empty constructor
      VitamDocument​(com.fasterxml.jackson.databind.JsonNode content)
      Constructor from Json
      VitamDocument​(java.lang.String content)
      Constructor from Json
      VitamDocument​(org.bson.Document content)
      Constructor from Document
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected VitamDocument<E> checkId()
      check if Id is valid
      static java.util.List<java.lang.String> getConcernedDiffLines​(java.util.List<java.lang.String> diff)
      Retrieve only + and - lines on diff (for logbook lifecycle) regexp = line started by + or - with at least one space after and any character
      java.lang.String getId()  
      static java.util.List<java.lang.String> getOriginalDiffLines​(java.lang.String diff)  
      java.lang.Integer getTenantId()  
      static java.util.List<java.lang.String> getUnifiedDiff​(java.lang.String original, java.lang.String revised)
      Get unified diff
      java.lang.Integer getVersion()  
      abstract VitamDocument<E> newInstance​(com.fasterxml.jackson.databind.JsonNode content)
      Make a new instance of the document with the given json
      java.lang.String toString()  
      java.lang.String toStringDirect()  
      • Methods inherited from class org.bson.Document

        append, clear, containsKey, containsValue, entrySet, equals, get, get, get, getBoolean, getBoolean, getDate, getDouble, getEmbedded, getEmbedded, getInteger, getInteger, getList, getList, getLong, getObjectId, getString, hashCode, isEmpty, keySet, parse, parse, put, putAll, remove, size, toBsonDocument, toJson, toJson, toJson, toJson, values
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.bson.conversions.Bson

        toBsonDocument
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Field Detail

      • ID

        public static final java.lang.String ID
        ID of each line: different for each sub type
        See Also:
        Constant Field Values
      • VERSION

        public static final java.lang.String VERSION
        Version of the document: Incremented for each main updates (excluding computed fields)
        See Also:
        Constant Field Values
      • SEDAVERSION

        public static final java.lang.String SEDAVERSION
        Current Seda Version
        See Also:
        Constant Field Values
      • IMPLEMENTATIONVERSION

        public static final java.lang.String IMPLEMENTATIONVERSION
        Current Vitam Version
        See Also:
        Constant Field Values
      • ES_FILTER_OUT

        public static final java.lang.String[] ES_FILTER_OUT
        Filter ES out
    • Constructor Detail

      • VitamDocument

        public VitamDocument()
        Empty constructor
      • VitamDocument

        public VitamDocument​(java.lang.String content)
        Constructor from Json
        Parameters:
        content - String
        Throws:
        java.lang.IllegalArgumentException - if Id is not a GUID
      • VitamDocument

        public VitamDocument​(com.fasterxml.jackson.databind.JsonNode content)
        Constructor from Json
        Parameters:
        content - as JsonNode
        Throws:
        java.lang.IllegalArgumentException - if Id is not a GUID
      • VitamDocument

        public VitamDocument​(org.bson.Document content)
        Constructor from Document
        Parameters:
        content - Document
        Throws:
        java.lang.IllegalArgumentException - if Id is not a GUID
    • Method Detail

      • newInstance

        public abstract VitamDocument<E> newInstance​(com.fasterxml.jackson.databind.JsonNode content)
        Make a new instance of the document with the given json
        Parameters:
        content - document structure as json
        Returns:
        new document with the json as content
      • checkId

        protected VitamDocument<E> checkId()
        check if Id is valid
        Returns:
        this
        Throws:
        java.lang.IllegalArgumentException - if Id is not a GUID
      • getId

        public java.lang.String getId()
        Returns:
        the ID
      • getTenantId

        public final java.lang.Integer getTenantId()
        Returns:
        the TenantId
      • getVersion

        public final java.lang.Integer getVersion()
        Returns:
        the version
      • toStringDirect

        public java.lang.String toStringDirect()
        Returns:
        the bypass toString
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class org.bson.Document
      • getUnifiedDiff

        public static java.util.List<java.lang.String> getUnifiedDiff​(java.lang.String original,
                                                                      java.lang.String revised)
        Get unified diff
        Parameters:
        original - the original value
        revised - the revisited value
        Returns:
        unified diff (each list entry is a diff line)
      • getConcernedDiffLines

        public static java.util.List<java.lang.String> getConcernedDiffLines​(java.util.List<java.lang.String> diff)
        Retrieve only + and - lines on diff (for logbook lifecycle) regexp = line started by + or - with at least one space after and any character
        Parameters:
        diff - the unified diff
        Returns:
        + and - lines for logbook lifecycle
      • getOriginalDiffLines

        public static java.util.List<java.lang.String> getOriginalDiffLines​(java.lang.String diff)