/** * {@inheritDoc} */ @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SCMRevisionImpl that = (SCMRevisionImpl) o; return StringUtils.equals(hash, that.hash) && getHead().equals(that.getHead()); }
@Override public boolean equivalent(ChangeRequestSCMRevision<?> o) { if (!(o instanceof PullRequestSCMRevision)) { return false; } PullRequestSCMRevision other = (PullRequestSCMRevision) o; return getHead().equals(other.getHead()) && pullHash.equals(other.pullHash); }
/** * {@inheritDoc} */ @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SCMRevisionImpl that = (SCMRevisionImpl) o; return revision == that.revision && getHead().equals(that.getHead()); }
/** * {@inheritDoc} */ @NonNull @Override public SubversionSCM build(@NonNull SCMHead head, @CheckForNull SCMRevision revision) { if (revision != null && !head.equals(revision.getHead())) { revision = null; } if (revision != null && !(revision instanceof SCMRevisionImpl)) { revision = null; } StringBuilder remote = new StringBuilder(remoteBase); if (!remoteBase.endsWith("/")) { remote.append('/'); } remote.append(head.getName()); if (revision != null) { remote.append('@').append(((SCMRevisionImpl) revision).getRevision()); } else if (remote.indexOf("@") != -1) { // name contains an @ so need to ensure there is an @ at the end of the name remote.append('@'); } return new SubversionSCM(remote.toString(), credentialsId, "."); }