br.com.objectos.git.GitCommand Maven / Gradle / Ivy
Show all versions of objectos-git Show documentation
/*
* Copyright (C) 2020-2022 Objectos Software LTDA.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package br.com.objectos.git;
import br.com.objectos.concurrent.Computation;
import br.com.objectos.concurrent.CpuWorker;
/**
* Represents a result producing high-level (porcelain) Git command. More
* precisely, it acts as a factory of asynchronous git computations.
*
*
* Instances of this interface are intended to be executed by a
* {@link GitService} instance.
*
*
* Programmers are encouraged to use one of the abstract classes provided by
* this package instead of implementing this interface directly.
*
* @param
* the type of the result of this command
*
* @since 3
*/
public interface GitCommand {
/**
* Returns a possibly new and possibly asynchronous git computation
* representing the pending result of this command.
*
*
* Please
*
* @param executor
* the executor providing low-level git tasks
* @param cpuWorker
* the cpu worker to execute the command
*
* @return a computation object representing the pending result of this
* command
*/
Computation submitAsync(GitCommandExecutor executor, CpuWorker cpuWorker);
}