Class CommitInfo


  • public final class CommitInfo
    extends java.lang.Object
    Commit info instances associate some meta data with a commit.
    • Constructor Summary

      Constructors 
      Constructor Description
      CommitInfo​(@NotNull java.lang.String sessionId, @Nullable java.lang.String userId)
      Creates a commit info for the given session and user.
      CommitInfo​(@NotNull java.lang.String sessionId, @Nullable java.lang.String userId, java.util.Map<java.lang.String,​java.lang.Object> info)
      Creates a commit info for the given session and user and info map.
      CommitInfo​(@NotNull java.lang.String sessionId, @Nullable java.lang.String userId, java.util.Map<java.lang.String,​java.lang.Object> info, boolean external)
      Creates a commit info for the given session and user and info map.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object object)  
      long getDate()  
      java.util.Map<java.lang.String,​java.lang.Object> getInfo()
      Return the info map
      java.lang.String getPath()
      /** Returns the base path of this commit.
      @NotNull java.lang.String getSessionId()  
      @NotNull java.lang.String getUserId()  
      int hashCode()  
      boolean isExternal()
      Return a flag indicating whether this is commit info is for an external change
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • EMPTY

        public static final CommitInfo EMPTY
        Empty commit information object. Used as a dummy object when no metadata is known (or needed) about a commit.
      • EMPTY_EXTERNAL

        public static final CommitInfo EMPTY_EXTERNAL
        Empty commit information object to be used for external changes. Used as a dummy object when no metadata is known (or needed) about a commit.
    • Constructor Detail

      • CommitInfo

        public CommitInfo​(@NotNull
                          @NotNull java.lang.String sessionId,
                          @Nullable
                          @Nullable java.lang.String userId)
        Creates a commit info for the given session and user.
        Parameters:
        sessionId - session identifier
        userId - The user id.
      • CommitInfo

        public CommitInfo​(@NotNull
                          @NotNull java.lang.String sessionId,
                          @Nullable
                          @Nullable java.lang.String userId,
                          java.util.Map<java.lang.String,​java.lang.Object> info)
        Creates a commit info for the given session and user and info map.
        Parameters:
        sessionId - session identifier
        userId - The user id.
        info - info map
      • CommitInfo

        public CommitInfo​(@NotNull
                          @NotNull java.lang.String sessionId,
                          @Nullable
                          @Nullable java.lang.String userId,
                          java.util.Map<java.lang.String,​java.lang.Object> info,
                          boolean external)
        Creates a commit info for the given session and user and info map.
        Parameters:
        sessionId - session identifier
        userId - The user id.
        info - info map
        external - indicates if the commit info is from external change
    • Method Detail

      • getSessionId

        @NotNull
        public @NotNull java.lang.String getSessionId()
        Returns:
        id of the committing session
      • getUserId

        @NotNull
        public @NotNull java.lang.String getUserId()
        Returns:
        user id of the committing user
      • getDate

        public long getDate()
        Returns:
        time stamp
      • isExternal

        public boolean isExternal()
        Return a flag indicating whether this is commit info is for an external change
        Returns:
        true if commit info is for an external change
      • getPath

        public java.lang.String getPath()
        /** Returns the base path of this commit. All changes within this commit are expected to be located within the returned path. By default this is the root path, but a particular commit can declare a more specific base path to indicate that only changes within that subtree should be considered. Note that this value is purely informational and its interpretation depends on the kinds of commit hooks and observers present on the system.
        Returns:
        base path of this commit
      • getInfo

        public java.util.Map<java.lang.String,​java.lang.Object> getInfo()
        Return the info map
        Returns:
        info map
      • equals

        public boolean equals​(java.lang.Object object)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object