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

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

Introduction

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

Prototype

boolean isEquals

To view the source code for org.apache.commons.lang3.builder EqualsBuilder isEquals.

Click Source Link

Document

If the fields tested are equals.

Usage

From source file:org.bgp4j.net.attributes.MultiProtocolUnreachableNLRI.java

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

    EqualsBuilder builer = (new EqualsBuilder()).append(getAddressFamily(), o.getAddressFamily())
            .append(getSubsequentAddressFamily(), o.getSubsequentAddressFamily())
            .append(getNlris().size(), o.getNlris().size());

    if (builer.isEquals()) {
        Iterator<NetworkLayerReachabilityInformation> lit = getNlris().iterator();
        Iterator<NetworkLayerReachabilityInformation> rit = o.getNlris().iterator();

        while (lit.hasNext())
            builer.append(lit.next(), rit.next());
    }//w  ww.  j  av a2  s  .c  om

    return builer.isEquals();
}

From source file:org.bgp4j.net.attributes.PathAttribute.java

@Override
public boolean equals(Object obj) {
    if (!(obj instanceof PathAttribute))
        return false;

    PathAttribute o = (PathAttribute) obj;

    EqualsBuilder builder = new EqualsBuilder();

    builder.append(internalType(), o.internalType()).append(getCategory(), o.getCategory())
            .append(isOptional(), o.isOptional()).append(isPartial(), o.isPartial())
            .append(isTransitive(), o.isTransitive());

    if (internalType() == o.internalType())
        builder.appendSuper(subclassEquals(o));

    return builder.isEquals();
}

From source file:org.bonitasoft.engine.bdm.model.field.RelationField.java

@Override
public boolean equals(final Object obj) {
    if (obj instanceof RelationField) {
        final RelationField other = (RelationField) obj;
        if (reference == null ^ other.reference == null) {
            return false;
        }/*w  w w.  j  av a2  s. c  o  m*/
        EqualsBuilder builder = new EqualsBuilder().appendSuper(super.equals(obj)).append(type, other.type);
        if (reference != null && other.reference != null) {
            builder = builder.append(reference.getQualifiedName(), other.reference.getQualifiedName());
        }
        return builder.isEquals();
    }
    return false;
}

From source file:org.grouplens.lenskit.data.pref.PreferenceDomain.java

@Override
public boolean equals(Object o) {
    if (o == this) {
        return true;
    } else if (o instanceof PreferenceDomain) {
        PreferenceDomain od = (PreferenceDomain) o;
        EqualsBuilder eqb = new EqualsBuilder();
        eqb.append(minimum, od.getMinimum());
        eqb.append(maximum, od.getMaximum());
        eqb.append(hasPrecision(), od.hasPrecision());
        if (eqb.isEquals() && hasPrecision() && od.hasPrecision()) {
            eqb.append(precision, od.getPrecision());
        }/*from   ww w. ja  v  a  2  s. c  om*/
        return eqb.isEquals();
    } else {
        return false;
    }
}

From source file:org.jasig.cas.authentication.BasicCredentialMetaData.java

@Override
public boolean equals(final Object other) {
    if (!(other instanceof BasicCredentialMetaData)) {
        return false;
    }//from w  ww .  jav  a 2  s  .co m
    final BasicCredentialMetaData md = (BasicCredentialMetaData) other;
    final EqualsBuilder builder = new EqualsBuilder();
    builder.append(this.id, md.id);
    builder.append(this.credentialClass, md.credentialClass);
    return builder.isEquals();
}

From source file:org.jasig.cas.authentication.DefaultHandlerResult.java

@Override
public boolean equals(final Object obj) {
    if (!(obj instanceof DefaultHandlerResult)) {
        return false;
    }//from   ww  w.  j  ava  2  s . c om
    if (obj == this) {
        return true;
    }
    final DefaultHandlerResult other = (DefaultHandlerResult) obj;
    final EqualsBuilder builder = new EqualsBuilder();
    builder.append(this.handlerName, other.handlerName);
    builder.append(this.credentialMetaData, other.credentialMetaData);
    builder.append(this.principal, other.principal);
    builder.append(this.warnings, other.warnings);
    return builder.isEquals();
}

From source file:org.jasig.cas.authentication.HandlerResult.java

@Override
public boolean equals(final Object obj) {
    if (!(obj instanceof HandlerResult)) {
        return false;
    }//from  ww w. j  a v  a2s.c o  m
    if (obj == this) {
        return true;
    }
    final HandlerResult other = (HandlerResult) obj;
    final EqualsBuilder builder = new EqualsBuilder();
    builder.append(this.handlerName, other.handlerName);
    builder.append(this.credentialMetaData, other.credentialMetaData);
    builder.append(this.principal, other.principal);
    builder.append(this.warnings, other.warnings);
    return builder.isEquals();
}

From source file:org.jasig.cas.authentication.ImmutableAuthentication.java

@Override
public boolean equals(final Object obj) {
    if (!(obj instanceof Authentication)) {
        return false;
    }/*from  ww w. j a  va 2s .  c  o  m*/
    if (obj == this) {
        return true;
    }
    final Authentication other = (Authentication) obj;
    final EqualsBuilder builder = new EqualsBuilder();
    builder.append(this.principal, other.getPrincipal());
    builder.append(this.credentials, other.getCredentials());
    builder.append(this.successes, other.getSuccesses());
    builder.append(this.authenticationDate, other.getAuthenticationDate().getTime());
    builder.append(wrap(this.attributes), other.getAttributes());
    builder.append(wrap(this.failures), other.getFailures());
    return builder.isEquals();
}

From source file:org.jboss.arquillian.model.testSuite.Mask.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }/*w  w w  . j  av  a2 s  .  c o  m*/
    if (getClass() != obj.getClass()) {
        return false;
    }
    final Mask mask = (Mask) obj;
    EqualsBuilder equalsBuilder = new EqualsBuilder();
    equalsBuilder.append(this.width, mask.width);
    equalsBuilder.append(this.height, mask.height);
    equalsBuilder.append(this.left, mask.left);
    equalsBuilder.append(this.top, mask.top);
    equalsBuilder.append(this.getPattern(), mask.getPattern());
    return equalsBuilder.isEquals();

}

From source file:org.jlgranda.fede.model.sales.Detail.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }//from www  . j a  v a 2  s.  com
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    Detail other = (Detail) obj;
    EqualsBuilder eb = new EqualsBuilder();

    if (other.getProduct() != null) {
        eb.append(getProductId(), other.getProductId()).append(getProduct(), other.getProduct())
                .append(getInvoice(), other.getInvoice());
    } else {
        eb.append(getProductId(), other.getProductId()).append(getInvoice(), other.getInvoice());

    }
    return eb.isEquals();
}