Interface GitAnnotatedTagCallback

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface GitAnnotatedTagCallback
Callback for streaming annotated tags
Since:
5.0
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Called after the final tag has been streamed.
    default boolean
    onMissing(String objectHash)
    Called when one of the provided hashes was not found in the repository
    default boolean
    onOtherType(String objectHash, GitObjectType objectType)
    Called when one of the provided hashes identifies an object that is not a tag object.
    default void
    Called before the first tag is streamed.
    boolean
    Receives a fully-populated tag for processing.
  • Method Details

    • onEnd

      default void onEnd(@Nonnull GitAnnotatedTagSummary summary) throws IOException
      Called after the final tag has been streamed.

      Note: If there were no tags, this method may be called immediately after onStart(GitAnnotatedTagContext) without any calls to onTag(GitAnnotatedTag).

      Parameters:
      summary - summarizes the request and the streamed tags
      Throws:
      IOException - for implementations which perform I/O
    • onMissing

      default boolean onMissing(@Nonnull String objectHash) throws IOException
      Called when one of the provided hashes was not found in the repository
      Parameters:
      objectHash - the object hash
      Returns:
      true if more tags should be provided; otherwise false to end streaming, potentially leaving some number of tags unread
      Throws:
      IOException - for implementations which perform I/O
    • onOtherType

      default boolean onOtherType(@Nonnull String objectHash, @Nonnull GitObjectType objectType) throws IOException
      Called when one of the provided hashes identifies an object that is not a tag object.
      Parameters:
      objectHash - the object hash
      objectType - the actual type of the object. Possible values are GitObjectType.BLOB, GitObjectType.TREE or GitObjectType.COMMIT
      Returns:
      true if more tags should be provided; otherwise false to end streaming, potentially leaving some number of tags unread
      Throws:
      IOException - for implementations which perform I/O
    • onStart

      default void onStart(@Nonnull GitAnnotatedTagContext context) throws IOException
      Called before the first tag is streamed.
      Parameters:
      context - provides details about the request for which tags are being streamed
      Throws:
      IOException - for implementations which perform I/O
    • onTag

      boolean onTag(@Nonnull GitAnnotatedTag tag) throws IOException
      Receives a fully-populated tag for processing.

      This method will never be invoked before onStart(GitAnnotatedTagContext) , and if it is invoked onEnd(GitAnnotatedTagSummary) is guaranteed to be invoked, whether the end happens because this method returns false or because the upstream sender runs out of tags.

      Parameters:
      tag - the tag
      Returns:
      true if more tags should be provided; otherwise false to end streaming, potentially leaving some number of tags unread
      Throws:
      IOException - for implementations which perform I/O