Class ResolveRefRequest

java.lang.Object
com.atlassian.bitbucket.repository.ResolveRefRequest

public class ResolveRefRequest extends Object
Describes a ref to resolve.

If it is known whether a requested ref is a branch or a tag, the caller is encouraged to specify the type to allow the SCM to optimize resolving the ref. If the ref type is unknown, the type should be left null.

Since:
4.6
See Also:
  • Method Details

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • getRefId

      @Nonnull public Optional<String> getRefId()
      Retrieves the ID to resolve, which may be empty() to resolve the default branch. If the ID is empty(), any type specified is ignored.
      Returns:
      the ID to resolve, or empty() to resolve the repository's default branch
    • getRepository

      @Nonnull public Repository getRepository()
      Retrieves the repository to resolve the ref in.
      Returns:
      the repository to resolve the ref in
    • getType

      @Nonnull public Optional<RefType> getType()
      Retrieves the type of ref to resolve, if it's known in advance. Specifying the type explicitly can allow the implementation to search IDs more efficiently, and can also prevent ambiguities when refs of multiple types have the same ID.

      If getRefId() is empty(), this type hint is ignored and the default branch will be resolved.

      Returns:
      the type of ref to resolve, if known in advance, or empty() to allow resolving a Branch or a Tag
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object