Package jenkins.scm.api.mixin
Class ChangeRequestSCMRevision<H extends SCMHead & ChangeRequestSCMHead>
java.lang.Object
jenkins.scm.api.SCMRevision
jenkins.scm.api.mixin.ChangeRequestSCMRevision<H>
- All Implemented Interfaces:
Serializable
public abstract class ChangeRequestSCMRevision<H extends SCMHead & ChangeRequestSCMHead>
extends SCMRevision
Recommended base class for the
SCMRevision
of a ChangeRequestSCMHead
.- Since:
- 2.2.0
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
ChangeRequestSCMRevision
(H head, SCMRevision target) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract int
Compute thehashCode()
excludinggetTarget()
.final boolean
abstract boolean
equivalent
(ChangeRequestSCMRevision<?> revision) Performs an equality comparison as forequals(Object)
but excludes thegetTarget()
SCMRevision
from the comparison (though theChangeRequestSCMHead.getTarget()
will be included as part of theSCMRevision.getHead()
comparison.final SCMRevision
Returns the revision of theChangeRequestSCMHead.getTarget()
that thisChangeRequestSCMHead
is associated with.final int
hashCode()
final boolean
isMerge()
Is this aChangeRequestSCMRevision
that will be merged on top ofgetTarget()
?Methods inherited from class jenkins.scm.api.SCMRevision
getHead, isDeterministic, toString
-
Constructor Details
-
ChangeRequestSCMRevision
Constructor.- Parameters:
head
- theSCMHead
that theSCMRevision
belongs to.target
- theSCMRevision
of theChangeRequestSCMHead.getTarget()
.
-
-
Method Details
-
getTarget
Returns the revision of theChangeRequestSCMHead.getTarget()
that thisChangeRequestSCMHead
is associated with.- Returns:
- a "target" or "base" branch revision.
-
isMerge
@Exported public final boolean isMerge()Is this aChangeRequestSCMRevision
that will be merged on top ofgetTarget()
?- Returns:
true
if the effective revision is the result of merging onto thegetTarget()
revisionfalse
if the effective revision ignores thegetTarget()
.- See Also:
-
equivalent
Performs an equality comparison as forequals(Object)
but excludes thegetTarget()
SCMRevision
from the comparison (though theChangeRequestSCMHead.getTarget()
will be included as part of theSCMRevision.getHead()
comparison.- Parameters:
revision
- the revision to compare with.- Returns:
true
if equal to supplied revision (ignoring differences ingetTarget()
)
-
_hashCode
protected abstract int _hashCode()Compute thehashCode()
excludinggetTarget()
.- Returns:
- a hash code value for this object.
-
equals
- Specified by:
equals
in classSCMRevision
-
hashCode
public final int hashCode()- Specified by:
hashCode
in classSCMRevision
-