Example usage for org.apache.commons.lang3.builder EqualsBuilder append

List of usage examples for org.apache.commons.lang3.builder EqualsBuilder append

Introduction

In this page you can find the example usage for org.apache.commons.lang3.builder EqualsBuilder append.

Prototype

public EqualsBuilder append(final boolean[] lhs, final boolean[] rhs) 

Source Link

Document

Deep comparison of array of boolean.

Usage

From source file:org.sakaiproject.tool.assessment.data.dao.grading.AssessmentGradingData.java

@Override
public boolean equals(Object obj) {
    if (this == obj)
        return true;
    if (obj == null)
        return false;
    if (getClass() != obj.getClass())
        return false;
    AssessmentGradingData other = (AssessmentGradingData) obj;
    EqualsBuilder builder = new EqualsBuilder();
    builder.appendSuper(super.equals(obj));
    builder.append(agentId, other.agentId);
    builder.append(assessmentGradingId, other.assessmentGradingId);
    builder.append(attemptDate, other.attemptDate);
    builder.append(comments, other.comments);
    builder.append(finalScore, other.finalScore);
    builder.append(forGrade, other.forGrade);
    builder.append(gradedBy, other.gradedBy);
    builder.append(gradedDate, other.gradedDate);
    builder.append(isAutoSubmitted, other.isAutoSubmitted);
    builder.append(isLate, other.isLate);
    builder.append(isRecorded, other.isRecorded);
    builder.append(itemGradingSet, other.itemGradingSet);
    builder.append(lastVisitedPart, other.lastVisitedPart);
    builder.append(lastVisitedQuestion, other.lastVisitedQuestion);
    builder.append(publishedAssessmentId, other.publishedAssessmentId);
    builder.append(publishedAssessmentTitle, other.publishedAssessmentTitle);
    builder.append(publishedItemId, other.publishedItemId);
    builder.append(status, other.status);
    builder.append(submittedDate, other.submittedDate);
    builder.append(timeElapsed, other.timeElapsed);
    builder.append(totalAutoScore, other.totalAutoScore);
    builder.append(totalOverrideScore, other.totalOverrideScore);
    builder.append(totalSubmitted, other.totalSubmitted);
    return builder.isEquals();
}

From source file:org.sakaiproject.tool.assessment.data.dao.grading.ItemGradingData.java

@Override
public boolean equals(Object obj) {
    if (this == obj)
        return true;
    if (obj == null)
        return false;
    if (getClass() != obj.getClass())
        return false;

    ItemGradingData other = (ItemGradingData) obj;
    EqualsBuilder builder = new EqualsBuilder();
    builder.appendSuper(super.equals(obj));
    builder.append(agentId, other.agentId);
    builder.append(answerText, other.answerText);
    builder.append(assessmentGradingId, other.assessmentGradingId);
    builder.append(attemptsRemaining, other.attemptsRemaining);
    builder.append(autoScore, other.autoScore);
    builder.append(comments, other.comments);
    builder.append(gradedBy, other.gradedBy);
    builder.append(gradedDate, other.gradedDate);
    builder.append(itemGradingId, other.itemGradingId);
    builder.append(isCorrect, other.isCorrect);
    builder.append(lastDuration, other.lastDuration);
    builder.append(mediaArray, other.mediaArray);
    builder.append(overrideScore, other.overrideScore);
    builder.append(publishedAnswerId, other.publishedAnswerId);
    builder.append(publishedItemId, other.publishedItemId);
    builder.append(publishedItemTextId, other.publishedItemTextId);
    builder.append(rationale, other.rationale);
    builder.append(review, other.review);
    builder.append(submittedDate, other.submittedDate);
    return builder.isEquals();
}

From source file:org.sakaiproject.tool.assessment.data.dao.grading.MediaData.java

@Override
public boolean equals(Object obj) {
    if (this == obj)
        return true;
    if (obj == null)
        return false;
    if (getClass() != obj.getClass())
        return false;
    MediaData other = (MediaData) obj;//from  w w w  . j a  va2  s  .com
    EqualsBuilder builder = new EqualsBuilder();
    builder.appendSuper(super.equals(obj));
    builder.append(createdBy, other.createdBy);
    builder.append(createdDate, other.createdDate);
    builder.append(description, other.description);
    builder.append(duration, other.duration);
    builder.append(durationIsOver, other.durationIsOver);
    builder.append(fileSize, other.fileSize);
    builder.append(filename, other.filename);
    builder.append(isHtmlInline, other.isHtmlInline);
    builder.append(isLink, other.isLink);
    builder.append(itemGradingData, other.itemGradingData);
    builder.append(lastModifiedBy, other.lastModifiedBy);
    builder.append(lastModifiedDate, other.lastModifiedDate);
    builder.append(location, other.location);
    builder.append(media, other.media);
    builder.append(mediaId, other.mediaId);
    builder.append(mimeType, other.mimeType);
    builder.append(status, other.status);
    builder.append(timeAllowed, other.timeAllowed);
    return builder.isEquals();
}

From source file:org.silverpeas.admin.web.ComponentEntityMatcher.java

@Override
protected void matches(final EqualsBuilder matcher, final ComponentInstLight expected,
        final ComponentEntity actual) {
    matcher.append("component", actual.getType());
    matcher.appendSuper(expected.getId().endsWith(actual.getId()));
    matcher.append(expected.getName(), actual.getName());
    matcher.append(expected.getLabel(), actual.getLabel());
    matcher.append(expected.getDescription(), actual.getDescription());
    matcher.append(expected.getOrderNum(), actual.getRank());
    matcher.append(expected.getStatus() == null ? "" : expected.getStatus(), actual.getStatus());
    matcher.append(expected.isInheritanceBlocked(), actual.isInheritanceBlocked());
    matcher.append("/R" + expected.getName() + "/" + expected.getId() + "/Main", actual.getUrl());
    // URI/*  w  ww  .  j  a v  a  2 s .  c om*/
    matcher.appendSuper(actual.getParentURI().toString()
            .endsWith("/spaces/" + expected.getDomainFatherId().replaceFirst(Admin.SPACE_KEY_PREFIX, "")));
}

From source file:org.silverpeas.admin.web.SpaceEntityMatcher.java

@Override
protected void matches(final EqualsBuilder matcher, final SpaceInstLight expected, final SpaceEntity actual) {
    matcher.append("space", actual.getType());
    matcher.append(expected.getShortId(), actual.getId());
    matcher.append(expected.getName(), actual.getLabel());
    matcher.append(expected.getDescription(), actual.getDescription());
    matcher.append(expected.getOrderNum(), actual.getRank());
    matcher.append(expected.getLevel(), actual.getLevel());
    matcher.append(expected.getStatus() == null ? "" : expected.getStatus(), actual.getStatus());
    matcher.append(expected.isDisplaySpaceFirst(), actual.isSpaceDisplayedAtFirst());
    matcher.append(expected.isInheritanceBlocked(), actual.isInheritanceBlocked());
    // URI/* w w w  .ja  v  a 2 s.com*/
    if (!expected.isRoot()) {
        matcher.appendSuper(actual.getParentURI().toString().endsWith("/spaces/" + expected.getFatherId()));
    } else {
        matcher.appendSuper(actual.getParentURI() == null || actual.getParentURI().toString().equals(""));
    }
    matcher.append(true, actual.getSpacesURI().toString()
            .endsWith("/" + SPACES_BASE_URI + "/" + expected.getShortId() + "/" + SPACES_SPACES_URI_PART));
    matcher.append(true, actual.getComponentsURI().toString()
            .endsWith("/" + SPACES_BASE_URI + "/" + expected.getShortId() + "/" + SPACES_COMPONENTS_URI_PART));
    matcher.append(true, actual.getContentURI().toString()
            .endsWith("/" + SPACES_BASE_URI + "/" + expected.getShortId() + "/" + SPACES_CONTENT_URI_PART));
    matcher.append(true, actual.getAppearanceURI().toString()
            .endsWith("/" + SPACES_BASE_URI + "/" + expected.getShortId() + "/" + SPACES_APPEARANCE_URI_PART));
}

From source file:org.silverpeas.components.forums.model.Moderator.java

@Override
public boolean equals(final Object obj) {
    if (obj == null) {
        return false;
    }//from www  . j a v  a2 s . c o m
    if (obj == this) {
        return true;
    }
    if (obj.getClass() != getClass()) {
        return false;
    }
    Moderator other = (Moderator) obj;
    EqualsBuilder builder = new EqualsBuilder();
    builder.append(getUserId(), other.getUserId());
    builder.append(getForumId(), other.getForumId());
    builder.append(isByInheritance(), other.isByInheritance());
    return builder.isEquals();
}

From source file:org.silverpeas.components.resourcesmanager.model.Category.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }//  ww  w  .  ja  v  a  2 s . c o m
    if (getClass() != obj.getClass()) {
        return false;
    }
    final Category other = (Category) obj;
    EqualsBuilder matcher = new EqualsBuilder();
    matcher.append(getId(), other.getId());
    matcher.append(getInstanceId(), other.getInstanceId());
    matcher.append(getName(), other.getName());
    matcher.append(isBookable(), other.isBookable());
    matcher.append(getForm(), other.getForm());
    matcher.append(getCreaterId(), other.getCreaterId());
    matcher.append(getUpdaterId(), other.getUpdaterId());
    matcher.append(getDescription(), other.getDescription());
    return matcher.isEquals();
}

From source file:org.silverpeas.components.resourcesmanager.model.Reservation.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }//from ww w . ja v a 2 s  .c  o  m
    if (getClass() != obj.getClass()) {
        return false;
    }
    final Reservation other = (Reservation) obj;
    EqualsBuilder matcher = new EqualsBuilder();
    matcher.append(getId(), other.getId());
    matcher.append(getEvent(), other.getEvent());
    matcher.append(getBeginDate(), other.getBeginDate());
    matcher.append(getEndDate(), other.getEndDate());
    matcher.append(getReason(), other.getReason());
    matcher.append(getPlace(), other.getPlace());
    matcher.append(getUserId(), other.getUserId());
    matcher.append(getInstanceId(), other.getInstanceId());
    return matcher.isEquals();
}

From source file:org.silverpeas.components.resourcesmanager.model.Resource.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }/*from  ww w . j  av  a  2  s.  c o m*/
    if (getClass() != obj.getClass()) {
        return false;
    }
    final Resource other = (Resource) obj;
    EqualsBuilder matcher = new EqualsBuilder();
    matcher.append(getId(), other.getId());
    matcher.append(getCategory(), other.getCategory());
    matcher.append(getName(), other.getName());
    matcher.append(isBookable(), other.isBookable());
    matcher.append(getDescription(), other.getDescription());
    matcher.append(getCreaterId(), other.getCreaterId());
    matcher.append(getUpdaterId(), other.getUpdaterId());
    matcher.append(getInstanceId(), other.getInstanceId());
    return matcher.isEquals();
}

From source file:org.silverpeas.components.suggestionbox.model.SuggestionMatcher.java

@Override
public boolean matches(final Object item) {
    boolean match = false;
    if (item instanceof Suggestion) {
        final Suggestion actual = (Suggestion) item;
        final EqualsBuilder matcher = new EqualsBuilder();

        if (expected.containsKey(PROPERTY.ID)) {
            matcher.append(actual.getId(), expected.get(PROPERTY.ID));
        }//from   www .java 2 s. c  o m

        if (expected.containsKey(PROPERTY.TITLE)) {
            matcher.append(actual.getTitle(), expected.get(PROPERTY.TITLE));
        }

        if (expected.containsKey(PROPERTY.STATUS)) {
            matcher.append(actual.getValidation().getStatus(), expected.get(PROPERTY.STATUS));
        }

        if (expected.containsKey(PROPERTY.LAST_UPDATE_DATE)) {
            if (expected.get(PROPERTY.LAST_UPDATE_DATE) == null) {
                matcher.appendSuper(actual.getLastUpdateDate() == null);
            } else {
                matcher.appendSuper(actual.getLastUpdateDate() != null && actual.getLastUpdateDate()
                        .compareTo((Date) expected.get(PROPERTY.LAST_UPDATE_DATE)) == 0);
            }
        }

        match = matcher.isEquals();
    }
    return match;
}