Package com.google.gerrit.server.project
Class BranchResource
- java.lang.Object
-
- com.google.gerrit.server.project.ProjectResource
-
- com.google.gerrit.server.project.RefResource
-
- com.google.gerrit.server.project.BranchResource
-
- All Implemented Interfaces:
RestResource
public class BranchResource extends RefResource
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.gerrit.extensions.restapi.RestResource
RestResource.HasETag, RestResource.HasLastModified
-
-
Field Summary
Fields Modifier and Type Field Description static com.google.inject.TypeLiteral<RestView<BranchResource>>
BRANCH_KIND
-
Fields inherited from class com.google.gerrit.server.project.ProjectResource
PROJECT_KIND
-
-
Constructor Summary
Constructors Constructor Description BranchResource(ProjectState projectState, CurrentUser user, org.eclipse.jgit.lib.Ref ref)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BranchNameKey
getBranchKey()
String
getRef()
Returns the ref's nameOptional<String>
getRevision()
Returns the ref's revision.-
Methods inherited from class com.google.gerrit.server.project.ProjectResource
getName, getNameKey, getProjectState, getUser
-
-
-
-
Field Detail
-
BRANCH_KIND
public static final com.google.inject.TypeLiteral<RestView<BranchResource>> BRANCH_KIND
-
-
Constructor Detail
-
BranchResource
public BranchResource(ProjectState projectState, CurrentUser user, org.eclipse.jgit.lib.Ref ref)
-
-
Method Detail
-
getBranchKey
public BranchNameKey getBranchKey()
-
getRef
public String getRef()
Description copied from class:RefResource
Returns the ref's name- Specified by:
getRef
in classRefResource
-
getRevision
public Optional<String> getRevision()
Description copied from class:RefResource
Returns the ref's revision.- Specified by:
getRevision
in classRefResource
- Returns:
- the ref's revision,
Optional.empty()
if the ref doesn't exist (yet)
-
-