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 theSCMRevision
of aChangeRequestSCMHead
.- Since:
- 2.2.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ChangeRequestSCMRevision(H head, SCMRevision target)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract int
_hashCode()
Compute thehashCode()
excludinggetTarget()
.boolean
equals(Object o)
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.SCMRevision
getTarget()
Returns the revision of theChangeRequestSCMHead.getTarget()
that thisChangeRequestSCMHead
is associated with.int
hashCode()
boolean
isMerge()
Is this aChangeRequestSCMRevision
that will be merged on top ofgetTarget()
?-
Methods inherited from class jenkins.scm.api.SCMRevision
getHead, isDeterministic, toString
-
-
-
-
Constructor Detail
-
ChangeRequestSCMRevision
protected ChangeRequestSCMRevision(@NonNull H head, @NonNull SCMRevision target)
Constructor.- Parameters:
head
- theSCMHead
that theSCMRevision
belongs to.target
- theSCMRevision
of theChangeRequestSCMHead.getTarget()
.
-
-
Method Detail
-
getTarget
@Exported @NonNull public final SCMRevision 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:
ChangeRequestSCMHead2
-
equivalent
public 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.- 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
public final boolean equals(Object o)
- Specified by:
equals
in classSCMRevision
-
hashCode
public final int hashCode()
- Specified by:
hashCode
in classSCMRevision
-
-