/** {@inheritDoc} */ public int compareTo(ComparisonResult o) { if (o == null) { return 1; } else { if (!o.getPenaltyPoints().equals(getPenaltyPoints())) { return getPenaltyPoints().compareTo(o.getPenaltyPoints()); } else { return getAdditionalInfoInCurrentValue().compareTo(o.getAdditionalInfoInCurrentValue()); } } }
/** * Amalgamates the given ComparisonResult into this ComparisonResult. * * @param comparisonResult The ComparisonResult to include. */ public void addComparisonResult(ComparisonResult comparisonResult) { this.penaltyPoints += comparisonResult.penaltyPoints; if (comparisonResult.getAdditionalInfoInCurrentValue()) { this.additionalInfoInCurrentValue = comparisonResult.getAdditionalInfoInCurrentValue(); } }