Class AbstractScm
- All Implemented Interfaces:
Scm
Scm
that returns null
for all of the optional contract members.
Required members have no default implementation.
Derived classes should provide their supported features
to the constructor. The nullary
constructor assumes the SCM doesn't support any of the optional features.
SCM implementors are strongly encouraged to use this base class for their Scm
implementation.
As new features are added SCMs built on this base class will better retain cross-version support because it
will provide null
implementations of new optional members.
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
AbstractScm
(Set<com.atlassian.bitbucket.scm.ScmFeature> features) -
Method Summary
Modifier and TypeMethodDescriptionRetrieves aPluginCommandBuilderFactory
, used to createcommand builders
for custom SCM commands.Retrieves aPluginCompareCommandFactory
, used to createcommands
tailored for comparing refs.Set<com.atlassian.bitbucket.scm.ScmFeature>
Retrieves thefeatures
that are supported by this SCM.Retrieves aPluginPullRequestCommandFactory
, used to createcommands
tailored for use supporting pull requests.Retrieves aPluginRefCommandFactory
, used to createcommands
tailored for creatingbranches
andtags
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.bitbucket.scm.Scm
getBulkContentCommandFactory, getCommandFactory, getDefaultBranch, getExtendedCommandFactory, getId, getIntegrityCheckCommandFactory, getMergeStrategies, getMirrorCommandFactory, getName, getStatus, isEmpty
-
Constructor Details
-
AbstractScm
protected AbstractScm() -
AbstractScm
-
-
Method Details
-
getCommandBuilderFactory
Description copied from interface:Scm
Retrieves aPluginCommandBuilderFactory
, used to createcommand builders
for custom SCM commands.Implementation Note: This method is optional. SCMs which do not support a
ScmCommandBuilder
may returnnull
.- Specified by:
getCommandBuilderFactory
in interfaceScm
- Returns:
- a command builder factory, or
null
if the SCM does not support command builders - See Also:
-
PluginCommandBuilderFactory
ScmFeature.COMMAND_BUILDERS
-
getCompareCommandFactory
Description copied from interface:Scm
Retrieves aPluginCompareCommandFactory
, used to createcommands
tailored for comparing refs.Implementation Note: This method is optional. SCMs which do not support comparing refs may return
null
.- Specified by:
getCompareCommandFactory
in interfaceScm
- Returns:
- a compare command factory, or
null
if the SCM does not support it - See Also:
-
PluginCompareCommandFactory
ScmFeature.COMPARE
-
getFeatures
Description copied from interface:Scm
Retrieves thefeatures
that are supported by this SCM.Since the system relies on optional features to provide some functionality, like branch compare and pull requests, it relies on this set to disable functionality that requires features the SCM doesn't provide. Similarly, plugin developers can use the returned features to control which optional features they try to use, rather than checking for
null
or handlingUnsupportedOperationException
s.- Specified by:
getFeatures
in interfaceScm
- Returns:
- the set of optional features this SCM supports, which may be empty but never
null
-
getPullRequestCommandFactory
Description copied from interface:Scm
Retrieves aPluginPullRequestCommandFactory
, used to createcommands
tailored for use supporting pull requests.Repositories
using an SCM which implements this method will have the ability to create, view and merge pull requests.Implementation Note: This method is optional. SCMs which do not support pull requests may return
null
.Repositories
using such SCMs will not be able to create pull requests.- Specified by:
getPullRequestCommandFactory
in interfaceScm
- Returns:
- a pull request command factory, or
null
if the SCM does not support pull requests - See Also:
-
PluginPullRequestCommandFactory
ScmFeature.PULL_REQUESTS
-
getRefCommandFactory
Description copied from interface:Scm
Retrieves aPluginRefCommandFactory
, used to createcommands
tailored for creatingbranches
andtags
.Implementation Note: This method is optional. SCMs which do not support mutable refs may return
null
.Repositories
using such SCMs will not be able createbranches
andtags
.- Specified by:
getRefCommandFactory
in interfaceScm
- Returns:
- a plugin ref command factory
- See Also:
-
ScmFeature.REFS
-