Class PersistentEntityVersion


  • public class PersistentEntityVersion
    extends com.intellij.openapi.util.Pair<java.lang.Long,​java.lang.Long>
    Version of SPersistentEntity. Can be used to check if the entity was edited in memory. Contains 2 components, see documentation for getPersistId() and getEditId() for details.
    Since:
    10.0.3
    • Field Summary

      • Fields inherited from class com.intellij.openapi.util.Pair

        first, second
    • Constructor Summary

      Constructors 
      Constructor Description
      PersistentEntityVersion​(long persistId, long editId)  
      PersistentEntityVersion​(long persistId, long editId, long persistTime, long editTime, java.util.List<java.lang.String> editStackTrace)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getEditId()
      Returns id of the last edit operation.
      java.util.List<java.lang.String> getEditStackTrace()
      Returns stackTrace of the last edit operation
      long getEditTime()
      Returns timestamp of the last entity edit or -1 if this information is not available
      long getPersistId()
      Returns id of the last persist call.
      long getPersistTime()
      Returns timestamp of the last persist or -1 if this information is not available
      • Methods inherited from class com.intellij.openapi.util.Pair

        create, equals, getFirst, getSecond, hashCode, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PersistentEntityVersion

        public PersistentEntityVersion​(long persistId,
                                       long editId)
      • PersistentEntityVersion

        public PersistentEntityVersion​(long persistId,
                                       long editId,
                                       long persistTime,
                                       long editTime,
                                       @Nullable
                                       java.util.List<java.lang.String> editStackTrace)
    • Method Detail

      • getPersistId

        public long getPersistId()
        Returns id of the last persist call. Id is updated on each call persisting the entity. Changed id means that the entity was persisted since the time previous id was taken. Id can overflow, so the result can be negative. Also if there was 2 * Long.MAX_VALUE + 2 calls to persist between 2 id measurements, then persist cannot be detected.
        Returns:
        see above
      • getEditId

        public long getEditId()
        Returns id of the last edit operation. The id is updated on each edit of this entity in memory and reset to 0 on each call to persist(). A non-zero id means that entity was edited, but not yet persisted. Id can overflow, so the result can be negative. Also if there was 2 * Long.MAX_VALUE + 2 edits since last persist, then id will be 0 and edits cannot be detected.
        Returns:
        see above
      • getEditTime

        public long getEditTime()
        Returns timestamp of the last entity edit or -1 if this information is not available
        Returns:
        see above
      • getPersistTime

        public long getPersistTime()
        Returns timestamp of the last persist or -1 if this information is not available
        Returns:
        see above
      • getEditStackTrace

        @NotNull
        public java.util.List<java.lang.String> getEditStackTrace()
        Returns stackTrace of the last edit operation
        Returns:
        see above