Interface TryGit

All Superinterfaces:
Supplier<@Nullable org.eclipse.jgit.api.Git>
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 TryGit extends Supplier<@Nullable org.eclipse.jgit.api.Git>
Use this to wrap Git commands using Try to handle exceptions.
  • Method Summary

    Modifier and Type
    Method
    Description
    default <R> io.vavr.control.Try<R>
    tryCommand(io.vavr.CheckedFunction1<org.eclipse.jgit.api.Git,org.eclipse.jgit.api.GitCommand<@Nullable R>> command)
    Wraps a GitCommand in a Try to handle exceptions.
    default <R> io.vavr.control.Try<R>
    tryGit(io.vavr.CheckedFunction1<org.eclipse.jgit.api.Git,@Nullable R> command)
    Wraps a Git command in a Try to handle exceptions.

    Methods inherited from interface java.util.function.Supplier

    get
  • Method Details

    • tryCommand

      default <R> io.vavr.control.Try<R> tryCommand(io.vavr.CheckedFunction1<org.eclipse.jgit.api.Git,org.eclipse.jgit.api.GitCommand<@Nullable R>> command)
      Wraps a GitCommand in a Try to handle exceptions.
      Type Parameters:
      R - return type
      Parameters:
      command - command to run
      Returns:
      the result of the function
    • tryGit

      default <R> io.vavr.control.Try<R> tryGit(io.vavr.CheckedFunction1<org.eclipse.jgit.api.Git,@Nullable R> command)
      Wraps a Git command in a Try to handle exceptions.
      Type Parameters:
      R - result of the function
      Parameters:
      command - to run
      Returns:
      result of the function with filtered nulls