Class AbstractGitOperation

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.QuickInfoSupporter, adams.core.SizeOfHandler, Serializable
    Direct Known Subclasses:
    Clone, Log, Pull, Push

    public abstract class AbstractGitOperation
    extends adams.core.option.AbstractOptionHandler
    implements adams.core.QuickInfoSupporter
    Ancestor for git operations.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected GitOperation m_GitOperation
      the git operation to use.
      protected GitRepo m_GitRepo
      the GitRepo instance to use.
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canExecute​(adams.core.MessageCollection errors)
      Checks whether the git operation can be executed.
      protected void check​(adams.core.MessageCollection errors)
      Hook method for checking.
      protected abstract boolean doCanExecute​(adams.core.MessageCollection errors)
      Checks whether the git operation can be executed.
      protected abstract Object doExecute​(adams.core.MessageCollection errors)
      Executes the git operation.
      Object execute​(adams.core.MessageCollection errors)
      Executes the git operation.
      abstract Class[] generates()
      Returns the type of data of the output.
      GitRepo getGitRepo()
      Returns the GitRepo instancee in use.
      String getQuickInfo()
      Returns a quick info about the object, which can be displayed in the GUI.
      boolean requiresGitRepo()
      Whether a GitRepo instance is required.
      void setGitRepo​(GitRepo value)
      Sets the GitRepo instance to use.
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, toCommandLine, toString
      • Methods inherited from class adams.core.logging.CustomLoggingLevelObject

        setLoggingLevel
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Field Detail

      • m_GitRepo

        protected GitRepo m_GitRepo
        the GitRepo instance to use.
      • m_GitOperation

        protected GitOperation m_GitOperation
        the git operation to use.
    • Constructor Detail

      • AbstractGitOperation

        public AbstractGitOperation()
    • Method Detail

      • getQuickInfo

        public String getQuickInfo()
        Returns a quick info about the object, which can be displayed in the GUI.
        Default implementation returns null.
        Specified by:
        getQuickInfo in interface adams.core.QuickInfoSupporter
        Returns:
        null if no info available, otherwise short string
      • requiresGitRepo

        public boolean requiresGitRepo()
        Whether a GitRepo instance is required.
        Returns:
        true if required
      • setGitRepo

        public void setGitRepo​(GitRepo value)
        Sets the GitRepo instance to use.
        Parameters:
        value - the instance to use
      • getGitRepo

        public GitRepo getGitRepo()
        Returns the GitRepo instancee in use.
        Returns:
        the instance in use
      • generates

        public abstract Class[] generates()
        Returns the type of data of the output.
        Returns:
        the type of data
      • check

        protected void check​(adams.core.MessageCollection errors)
        Hook method for checking.
      • doCanExecute

        protected abstract boolean doCanExecute​(adams.core.MessageCollection errors)
        Checks whether the git operation can be executed.
        Parameters:
        errors - for storing errors, can be null
        Returns:
        whether operation can be executed
      • canExecute

        public boolean canExecute​(adams.core.MessageCollection errors)
        Checks whether the git operation can be executed.
        Parameters:
        errors - for storing errors, can be null
        Returns:
        whether operation can be executed
      • doExecute

        protected abstract Object doExecute​(adams.core.MessageCollection errors)
        Executes the git operation.
        Parameters:
        errors - for storing errors, can be null
        Returns:
        the operation output, null if failed
      • execute

        public Object execute​(adams.core.MessageCollection errors)
        Executes the git operation.
        Parameters:
        errors - for storing errors, can be null
        Returns:
        the operation output, null if failed