org.eclipse.jgit.api
Class ResetCommand

java.lang.Object
  extended by org.eclipse.jgit.api.GitCommand<Ref>
      extended by org.eclipse.jgit.api.ResetCommand
All Implemented Interfaces:
Callable<Ref>

public class ResetCommand
extends GitCommand<Ref>

A class used to execute a Reset command. It has setters for all supported options and arguments of this command and a call() method to finally execute the command. Each instance of this class should only be used for one invocation of the command (means: one call to call())

See Also:
Git documentation about Reset

Nested Class Summary
static class ResetCommand.ResetType
          Kind of reset
 
Field Summary
 
Fields inherited from class org.eclipse.jgit.api.GitCommand
repo
 
Constructor Summary
ResetCommand(Repository repo)
           
 
Method Summary
 ResetCommand addPath(String file)
           
 Ref call()
          Executes the Reset command.
 ResetCommand setMode(ResetCommand.ResetType mode)
           
 ResetCommand setRef(String ref)
           
 
Methods inherited from class org.eclipse.jgit.api.GitCommand
checkCallable, getRepository, setCallable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResetCommand

public ResetCommand(Repository repo)
Parameters:
repo -
Method Detail

call

public Ref call()
         throws GitAPIException,
                CheckoutConflictException
Executes the Reset command. Each instance of this class should only be used for one invocation of the command. Don't call this method twice on an instance.

Specified by:
call in interface Callable<Ref>
Specified by:
call in class GitCommand<Ref>
Returns:
the Ref after reset
Throws:
GitAPIException
CheckoutConflictException

setRef

public ResetCommand setRef(String ref)
Parameters:
ref - the ref to reset to
Returns:
this instance

setMode

public ResetCommand setMode(ResetCommand.ResetType mode)
Parameters:
mode - the mode of the reset command
Returns:
this instance

addPath

public ResetCommand addPath(String file)
Parameters:
file - the file to add
Returns:
this instance


Copyright © 2013. All Rights Reserved.