Package jenkins.scm.api.mixin
Interface SCMHeadMixin
-
- All Superinterfaces:
Comparable<SCMHead>
,Serializable
- All Known Subinterfaces:
ChangeRequestSCMHead
,ChangeRequestSCMHead2
- All Known Implementing Classes:
SCMHead
public interface SCMHeadMixin extends Comparable<SCMHead>, Serializable
Interface to allow declaring mixin interfaces forSCMHead
subclasses. Do not implement this interface directly, rather extend fromSCMHead
and implement the appropriate mixins such asChangeRequestSCMHead
andTagSCMHead
Two
SCMHeadMixin
implementations are equal if and only if:- They both are the same class
- They both have the same
getName()
- For each implemented
SCMHeadMixin
sub-interface, they both return the same values from all Java Bean property getters declared on the sub-interface. Thus, for exampleChangeRequestSCMHead
implementations are only considered equal ifChangeRequestSCMHead.getId()
andChangeRequestSCMHead.getTarget()
are also equal
Object.hashCode()
for aSCMHeadMixin
implementation must be equal to theString.hashCode()
ofgetName()
- Since:
- 2.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
SCMHeadMixin.Equality
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getName()
Returns the name.SCMHeadOrigin
getOrigin()
Returns the origin of the head.-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Method Detail
-
getName
@Exported @NonNull String getName()
Returns the name.- Returns:
- the name.
-
getOrigin
@Exported @NonNull SCMHeadOrigin getOrigin()
Returns the origin of the head.-
For centralized version control systems such as Subversion, CVS, etc the return value will always be
SCMHeadOrigin.DEFAULT
. - For distributed version control systems such as Git, Mercurial etc the return value may have other values.
-
For centralized distributed version control systems such as GitHub, Bitbucket, etc the return values may
be restricted to
SCMHeadOrigin.DEFAULT
or instances ofSCMHeadOrigin.Fork
.
- Returns:
- the origin of the head or
SCMHeadOrigin.DEFAULT
if there can only ever be one origin. - Since:
- 2.2.0
-
For centralized version control systems such as Subversion, CVS, etc the return value will always be
-
-