Class GitCommand<T>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.concurrent.atomic.AtomicBoolean callable
      a state which tells whether it is allowed to call call() on this instance.
      protected Repository repo
      The repository this command is working with
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected GitCommand​(Repository repo)
      Creates a new command which interacts with a single repository
    • Field Detail

      • repo

        protected final Repository repo
        The repository this command is working with
      • callable

        private java.util.concurrent.atomic.AtomicBoolean callable
        a state which tells whether it is allowed to call call() on this instance.
    • Constructor Detail

      • GitCommand

        protected GitCommand​(Repository repo)
        Creates a new command which interacts with a single repository
        Parameters:
        repo - the Repository this command should interact with
    • Method Detail

      • getRepository

        public Repository getRepository()
        Get repository this command is working on
        Returns:
        the Repository this command is interacting with
      • setCallable

        protected void setCallable​(boolean callable)
        Set's the state which tells whether it is allowed to call call() on this instance. checkCallable() will throw an exception when called and this property is set to false
        Parameters:
        callable - if true it is allowed to call call() on this instance.
      • checkCallable

        protected void checkCallable()
        Checks that the property callable is true. If not then an IllegalStateException is thrown
        Throws:
        java.lang.IllegalStateException - when this method is called and the property callable is false
      • call

        public abstract T call()
                        throws GitAPIException

        Execute the command

        Specified by:
        call in interface java.util.concurrent.Callable<T>
        Throws:
        GitAPIException