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
ConstructorsModifierConstructorDescriptionprotectedChangeRequestSCMRevision(H head, SCMRevision target) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract intCompute thehashCode()excludinggetTarget().final booleanabstract booleanequivalent(ChangeRequestSCMRevision<?> revision) Performs an equality comparison as forequals(Object)but excludes thegetTarget()SCMRevisionfrom the comparison (though theChangeRequestSCMHead.getTarget()will be included as part of theSCMRevision.getHead()comparison.final SCMRevisionReturns the revision of theChangeRequestSCMHead.getTarget()that thisChangeRequestSCMHeadis associated with.final inthashCode()final booleanisMerge()Is this aChangeRequestSCMRevisionthat will be merged on top ofgetTarget()?Methods inherited from class jenkins.scm.api.SCMRevision
getHead, isDeterministic, toString
-
Constructor Details
-
ChangeRequestSCMRevision
Constructor.- Parameters:
head- theSCMHeadthat theSCMRevisionbelongs to.target- theSCMRevisionof theChangeRequestSCMHead.getTarget().
-
-
Method Details
-
getTarget
Returns the revision of theChangeRequestSCMHead.getTarget()that thisChangeRequestSCMHeadis associated with.- Returns:
- a "target" or "base" branch revision.
-
isMerge
@Exported public final boolean isMerge()Is this aChangeRequestSCMRevisionthat will be merged on top ofgetTarget()?- Returns:
trueif the effective revision is the result of merging onto thegetTarget()revisionfalseif the effective revision ignores thegetTarget().- See Also:
-
equivalent
Performs an equality comparison as forequals(Object)but excludes thegetTarget()SCMRevisionfrom the comparison (though theChangeRequestSCMHead.getTarget()will be included as part of theSCMRevision.getHead()comparison.- Parameters:
revision- the revision to compare with.- Returns:
trueif 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:
equalsin classSCMRevision
-
hashCode
public final int hashCode()- Specified by:
hashCodein classSCMRevision
-