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:de.micromata.tpsb.doc.parser.FileInfo.java

@Override
public boolean equals(Object obj) {
    if (obj instanceof FileInfo == false) {
        return false;
    }//from  w ww  .  ja  v  a  2 s .  co  m
    if (obj == this) {
        return true;
    }
    final FileInfo lhs = (FileInfo) obj;
    final EqualsBuilder eq = new EqualsBuilder();
    eq.append(className, lhs.className);
    return eq.isEquals();
}

From source file:com.norconex.committer.core.AbstractFileQueueCommitter.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }/*from   w w w.j  av  a 2 s . c  om*/
    if (obj == null) {
        return false;
    }
    if (!(obj instanceof AbstractFileQueueCommitter)) {
        return false;
    }
    AbstractFileQueueCommitter other = (AbstractFileQueueCommitter) obj;
    EqualsBuilder equalsBuilder = new EqualsBuilder();
    equalsBuilder.appendSuper(super.equals(other));
    equalsBuilder.append(queue, other.queue);
    return equalsBuilder.isEquals();
}

From source file:com.nmote.smpp.BroadcastSmPDU.java

/**
 * Checks if <code>o</code> and this object are equal.
 *
 * @return true if objects are equal, false otherwise
 */// www .ja v  a2  s .c  o m
public boolean equals(Object o) {
    boolean result;
    if (o instanceof BroadcastSmPDU) {
        BroadcastSmPDU p = (BroadcastSmPDU) o;
        EqualsBuilder b = new EqualsBuilder();
        b.append(p.getSequence(), getSequence());
        b.append(p.getStatus(), getStatus());

        // Appending mandatory parameters
        b.append(p.service_type, service_type);
        b.append(p.source_addr, source_addr);
        b.append(p.message_id, message_id);
        b.append(p.priority_flag, priority_flag);
        b.append(p.schedule_delivery_time, schedule_delivery_time);
        b.append(p.validity_period, validity_period);
        b.append(p.replace_if_present_flag, replace_if_present_flag);
        b.append(p.data_coding, data_coding);
        b.append(p.sm_default_msg_id, sm_default_msg_id);

        // Appending optional parameters
        b.append(p.getParameters(), getParameters());

        result = b.isEquals();
    } else {
        result = false;
    }

    return result;
}

From source file:net.sf.dynamicreports.design.base.style.DRDesignStyle.java

@Override
public boolean equals(Object obj) {
    EqualsBuilder equalsBuilder = new EqualsBuilder().appendSuper(super.equals(obj));
    if (equalsBuilder.isEquals()) {
        DRDesignStyle o = (DRDesignStyle) obj;
        if (!(parentStyle == null ? o.getParentStyle() == null
                : parentStyle.getName().equals(o.getParentStyle().getName()))) {
            return false;
        }//ww  w  . j a  v a  2  s. co m
        equalsBuilder.append(name, o.name).append(conditionalStyles, o.conditionalStyles);
    }
    return equalsBuilder.isEquals();
}

From source file:de.renew.workflow.connector.internal.cases.ScenarioHandler.java

@Override
public boolean equals(final Object obj) {
    if (obj instanceof IScenario) {
        final IScenario other = (IScenario) obj;

        final EqualsBuilder builder = new EqualsBuilder();

        final Case caze = getCase();
        final Case otherCase = other.getCase();

        if (caze != null && otherCase != null) {
            builder.append(caze.getName(), otherCase.getName());
            builder.append(caze.getURI(), otherCase.getURI());
        } else//from   ww w.  j  a  va2s .c  o m
            builder.append(caze, otherCase);

        builder.append(getProject(), other.getProject());

        return builder.isEquals();
    }

    return super.equals(obj);
}

From source file:io.netlibs.bgp.protocol.attributes.CommunityPathAttribute.java

@Override
protected boolean subclassEquals(final PathAttribute obj) {
    final CommunityPathAttribute o = (CommunityPathAttribute) obj;

    final EqualsBuilder builder = (new EqualsBuilder()).append(this.getMembers().size(), o.getMembers().size());

    if (builder.isEquals()) {
        final Iterator<CommunityMember> lit = this.getMembers().iterator();
        final Iterator<CommunityMember> rit = o.getMembers().iterator();

        while (lit.hasNext()) {
            builder.append(lit.next(), rit.next());
        }/*  ww  w  .j  a  v  a 2 s .c om*/
    }

    return builder.isEquals();
}

From source file:com.silverpeas.gallery.web.MediaEntityMatcher.java

@SuppressWarnings("unchecked")
@Override/*from  w  ww .  jav  a2 s  .co m*/
public boolean matches(final Object item) {
    boolean match = false;
    if (item instanceof LinkedHashMap) {
        final AbstractMediaEntity actual = from((LinkedHashMap<String, Object>) item);
        final EqualsBuilder matcher = new EqualsBuilder();
        matcher.appendSuper(actual.getURI().toString().endsWith("/gallery/componentName5/albums/3/"
                + expected.getType().getMediaWebUriPart() + "/" + expected.getId()));
        matcher.appendSuper(actual.getParentURI().toString().endsWith("/gallery/componentName5/albums/3"));
        matcher.append(expected.getType(), actual.getType());
        matcher.append(expected.getId(), actual.getId());
        matcher.append(expected.getTitle(), actual.getTitle());
        matcher.append(expected.getDescription(), actual.getDescription());
        // URL
        if (expected.getInternalMedia() != null) {
            matcher.appendSuper(actual.getUrl().toString()
                    .endsWith("/gallery/componentName5/" + expected.getType().getMediaWebUriPart() + "/"
                            + expected.getId() + "/content?_t=1325372400000"));
        } else {
            matcher.appendSuper(
                    actual.getUrl().toString().equals("/homepageUrl/componentName5/" + expected.getId()));
        }
        // Other URLs
        if (expected.getType().isPhoto()) {
            PhotoEntity photoEntity = (PhotoEntity) actual;
            matcher.appendSuper(photoEntity.getPreviewUrl().toString()
                    .contains("/silverpeas/services/gallery/componentName5/photos/7/content?_t=1325372400000"
                            + "&resolution=PREVIEW"));
            matcher.appendSuper(photoEntity.getThumbUrl().toString()
                    .contains("/silverpeas/gallery/jsp/icons/notAvailable_fr_133x100.jpg"));
        } else {
            matcher.appendSuper(actual.getThumbUrl().toString().equals("/silverpeas/gallery/jsp/icons/"
                    + expected.getType().getName().toLowerCase() + "_266x150.png"));
        }
        match = matcher.isEquals();
    }
    return match;
}

From source file:com.feilong.taglib.display.pager.command.PagerParams.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }//from w  w w  .j a va2  s . com
    if (obj == this) {
        return true;
    }
    if (obj.getClass() != getClass()) {
        return false;
    }

    //????reflectionEqualsAccessibleObject.setAccessible???
    //?????
    // 
    //EqualsBuilder.reflectionEquals(this, obj);

    PagerParams pagerParams = (PagerParams) obj;
    EqualsBuilder equalsBuilder = new EqualsBuilder();

    return equalsBuilder //
            //.appendSuper(super.equals(obj))//
            .append(this.charsetType, pagerParams.getCharsetType())//
            .append(this.locale, pagerParams.getLocale())//
            .append(this.pageParamName, pagerParams.getPageParamName())//
            .append(this.pageUrl, pagerParams.getPageUrl())//
            .append(this.skin, pagerParams.getSkin())//
            .append(this.vmPath, pagerParams.getVmPath())//

            .append(this.debugIsNotParseVM, pagerParams.getDebugIsNotParseVM())//
            .append(this.currentPageNo, pagerParams.getCurrentPageNo())//
            .append(this.maxIndexPages, pagerParams.getMaxIndexPages())//
            .append(this.maxShowPageNo, pagerParams.getMaxShowPageNo())//
            .append(this.pageSize, pagerParams.getPageSize())//
            .append(this.totalCount, pagerParams.getTotalCount())//
            .isEquals();
}

From source file:fr.landel.utils.commons.tuple.Generic.java

/**
 * <p>//w  w  w.  j av  a 2  s.c  om
 * Compares this generic to another. Each sub-objects are checked.
 * </p>
 * 
 * @param obj
 *            the object to compare to, null returns false
 * @return true if the elements of the generic are equal
 */
@Override
public boolean equals(final Object obj) {
    if (obj == this) {
        return true;
    }
    if (obj instanceof Generic) {
        final Generic<?> other = (Generic<?>) obj;

        if (this.getAll().size() != other.getAll().size()) {
            return false;
        }

        final EqualsBuilder equalsBuilder = new EqualsBuilder();

        final Iterator<T> iterator = this.getAll().iterator();
        final Iterator<?> otherIterator = other.getAll().iterator();
        while (iterator.hasNext() && otherIterator.hasNext()) {
            equalsBuilder.append(iterator.next(), otherIterator.next());
        }

        return equalsBuilder.isEquals();
    }
    return false;
}

From source file:io.netlibs.bgp.protocol.attributes.ASPathAttribute.java

@Override
protected boolean subclassEquals(PathAttribute obj) {
    ASPathAttribute o = (ASPathAttribute) obj;

    EqualsBuilder builder = (new EqualsBuilder()).append(getAsType(), o.getAsType())
            .append(getPathSegments().size(), o.getPathSegments().size());

    if (builder.isEquals()) {
        Iterator<PathSegment> lit = getPathSegments().iterator();
        Iterator<PathSegment> rit = o.getPathSegments().iterator();

        while (lit.hasNext())
            builder.append(lit.next(), rit.next());
    }// w w w  . jav a 2s  .c  om

    return builder.isEquals();
}