Class RefNames


  • public class RefNames
    extends Object
    Constants and utilities for Gerrit-specific ref names.
    • Method Detail

      • shortName

        public static final String shortName​(String ref)
      • isGerritRef

        public static boolean isGerritRef​(String ref)
        Whether the ref is managed by Gerrit. Covers all Gerrit-internal refs like refs/cache-automerge and refs/meta as well as refs/changes. Does not cover user-created refs like branches or custom ref namespaces like refs/my-company.
      • robotCommentsRef

        public static String robotCommentsRef​(Change.Id id)
      • isNoteDbMetaRef

        public static boolean isNoteDbMetaRef​(String ref)
      • refsDraftCommentsPrefix

        public static String refsDraftCommentsPrefix​(Change.Id changeId)
      • refsStarredChangesPrefix

        public static String refsStarredChangesPrefix​(Change.Id changeId)
      • refsCacheAutomerge

        public static String refsCacheAutomerge​(String hash)
      • shard

        public static String shard​(int id)
      • refsEdit

        public static String refsEdit​(Account.Id accountId,
                                      Change.Id changeId,
                                      PatchSet.Id psId)
        Returns reference for this change edit with sharded user and change number: refs/users/UU/UUUU/edit-CCCC/P.
        Parameters:
        accountId - account id
        changeId - change number
        psId - patch set number
        Returns:
        reference for this change edit
      • refsEditPrefix

        public static String refsEditPrefix​(Account.Id accountId,
                                            Change.Id changeId)
        Returns reference prefix for this change edit with sharded user and change number: refs/users/UU/UUUU/edit-CCCC/.
        Parameters:
        accountId - account id
        changeId - change number
        Returns:
        reference prefix for this change edit
      • refsEditPrefix

        public static String refsEditPrefix​(Account.Id accountId)
      • isRefsEdit

        public static boolean isRefsEdit​(String ref)
      • isRefsUsers

        public static boolean isRefsUsers​(String ref)