Class RepositoryStateData

  • All Implemented Interfaces:
    VcsDataObject, VcsRepositoryState

    public class RepositoryStateData
    extends Object
    implements VcsRepositoryState
    Represents repository state of changes collection. Value object //TODO: VCS - this object may contain NO VERSION, //TODO: VCS - while we have @NotNull for it
    Since:
    8.0
    Author:
    Eugene Petrenko (eugene.petrenko@jetbrains.com)
    • Method Detail

      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface VcsRepositoryState
        Returns:
        true if this RepositoryState doesn't contain any information, i.e. it is Null object
      • getDefaultBranchName

        @NotNull
        public String getDefaultBranchName()
        //TODO: Is it required for plugin?
        Specified by:
        getDefaultBranchName in interface VcsRepositoryState
        Returns:
        The branch which is considered default for the moment of changes collecting
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • createSingleVersionState

        @NotNull
        public static RepositoryStateData createSingleVersionState​(@Nullable
                                                                   String version)
        Parameters:
        version - version
        Returns:
        single version RevisionStateData
        Since:
        8.0
      • createVersionState

        @NotNull
        public static RepositoryStateData createVersionState​(@NotNull
                                                             String defaultBranchName,
                                                             @NotNull
                                                             Map<String,​String> state)
        Parameters:
        defaultBranchName - default branch name
        state - map of branch to version
        Returns:
        revision state data
        Since:
        8.0
      • createFromState

        @NotNull
        public static RepositoryStateData createFromState​(VcsRepositoryState state)
        Parameters:
        state - state of a VCS Repository
        Returns:
        revision state data
        Since:
        8.0
      • createVersionState

        @NotNull
        public static RepositoryStateData createVersionState​(@NotNull
                                                             String branch,
                                                             @NotNull
                                                             String revision)
        Creates singleton state from given branch and revision
        Parameters:
        branch - branch name
        revision - revision name
        Returns:
        repository state data object
        Since:
        8.1