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

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

Introduction

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

Prototype

public EqualsBuilder() 

Source Link

Document

Constructor for EqualsBuilder.

Starts off assuming that equals is true.

Usage

From source file:com.yahoo.parsec.clients.ParsecEqualsUtil.java

/**
 * Ning request equals./*from   www.  jav  a 2  s . c o m*/
 *
 * @param lhs lhs
 * @param rhs rhs
 *
 * @return true when two Ning Request are equal by value
 */
static boolean ningRequestEquals(final Request lhs, final Request rhs) {
    if (!toStringEquals(lhs.getProxyServer(), rhs.getProxyServer())) {
        return false;
    }

    if (!byteArrayListEquals(lhs.getCompositeByteData(), rhs.getCompositeByteData())) {
        return false;
    }

    if (!partListEquals(lhs.getParts(), rhs.getParts())) {
        return false;
    }

    return new EqualsBuilder().append(lhs.getBodyEncoding(), rhs.getBodyEncoding())
            .append(lhs.getByteData(), rhs.getByteData()).append(lhs.getContentLength(), rhs.getContentLength())
            .append(lhs.getFollowRedirect(), rhs.getFollowRedirect()).append(lhs.getMethod(), rhs.getMethod())
            .append(lhs.getRangeOffset(), rhs.getRangeOffset())
            .append(lhs.getRequestTimeout(), rhs.getRequestTimeout())
            .append(lhs.getStringData(), rhs.getStringData()).append(lhs.getUrl(), rhs.getUrl())
            .append(lhs.getVirtualHost(), rhs.getVirtualHost()).isEquals();
}

From source file:ductive.commons.Equals.java

public static <T> boolean eq(T lhs, Object rhs, EqualsDefinition<T> definition) {
    if (lhs == rhs)
        return true;

    if (lhs == null || rhs == null)
        return false;

    if (lhs.getClass() != rhs.getClass())
        return false;

    EqualsBuilder b = new EqualsBuilder();
    definition.check(lhs, Equals.<T>cast(rhs), b);
    return b.isEquals();
}

From source file:com.sg.domail.vo.SchemaId.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }//from   w w w  .  ja  v a 2s  .c  o  m
    if (obj == null || this.getClass() != obj.getClass()) {
        return false;
    }

    SchemaId other = (SchemaId) obj;
    return new EqualsBuilder().append(this.id, other.id).isEquals();
}

From source file:com.sg.domail.vo.Locale.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }/*w  w  w  .j a  v a2  s  . co  m*/
    if (obj == null || this.getClass() != obj.getClass()) {
        return false;
    }

    Locale other = (Locale) obj;
    return new EqualsBuilder().append(this.code, other.code).isEquals();
}

From source file:com.sg.domail.vo.PdfPurchase.java

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

    PdfPurchase other = (PdfPurchase) obj;
    return new EqualsBuilder().append(this.schemaId, other.schemaId).isEquals();
}

From source file:com.sg.domail.vo.Producer.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }//from   www .  j  a  v  a  2s  .  c  om
    if (obj == null || this.getClass() != obj.getClass()) {
        return false;
    }

    Producer other = (Producer) obj;
    return new EqualsBuilder().append(this.producer, other.producer).isEquals();
}

From source file:com.sg.dto.operation.GetAccountRolesOperation.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }//  w  ww.j  av a  2s.  c  o  m
    if (obj == null || this.getClass() != obj.getClass()) {
        return false;
    }

    GetAccountRolesOperation other = (GetAccountRolesOperation) obj;
    return new EqualsBuilder().append(this.accountId, other.accountId).isEquals();
}

From source file:com.comcast.cdn.traffic_control.traffic_router.core.request.Request.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    } else if (obj instanceof Request) {
        final Request rhs = (Request) obj;
        return new EqualsBuilder().append(getClientIP(), rhs.getClientIP())
                .append(getHostname(), rhs.getHostname()).isEquals();
    } else {/*w  w w . j av  a  2 s  .  c om*/
        return false;
    }
}

From source file:bz.tsung.jsonapi4j.models.ResourceIdentifier.java

@Override
public boolean equals(Object o) {
    if (this == o) {
        return true;
    }/*from www. j  a v a 2 s  .c  o  m*/

    if (o == null || getClass() != o.getClass()) {
        return false;
    }

    ResourceIdentifier that = (ResourceIdentifier) o;

    return new EqualsBuilder().append(type, that.type).append(id, that.id).isEquals();
}

From source file:gov.ca.cwds.cals.service.dto.LicenseStatusTypeDto.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }/*w  ww  . j a v a  2s . co m*/
    if (obj == this) {
        return true;
    }
    if (obj.getClass() != getClass()) {
        return false;
    }
    LicenseStatusTypeDto licenseStatusTypeDto = (LicenseStatusTypeDto) obj;
    EqualsBuilder equalsBuilder = new EqualsBuilder();
    equalsBuilder.appendSuper(super.equals(obj));
    equalsBuilder.append(isActive, licenseStatusTypeDto.isActive);
    return equalsBuilder.isEquals();
}