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.timrcoulson.gymbro.entity.Exercise.java

@Override
public boolean equals(Object obj) {
    if (obj == null)
        return false;
    if (!(obj instanceof Exercise))
        return false;
    Exercise exercise = (Exercise) obj;/*from w ww . j a  v a2s . c o m*/
    if (!(new EqualsBuilder().append(name, exercise.name).append(reps, exercise.reps)
            .append(rest, exercise.rest).append(weight, exercise.weight).append(increment, exercise.increment)
            .append(unit, exercise.unit).append(order, exercise.order).isEquals()))
        return false;
    if (!(exercise.getSets().size() == this.getSets().size()))
        return false;
    Iterator<? extends Set> setIterator = exercise.getSets().iterator();
    for (Set set : this.getSets()) {
        if (!setIterator.next().equals(set))
            return false;
    }
    return true;
}

From source file:com.invariantproperties.project.student.matcher.InstructorEquality.java

@Override
public boolean matchesSafely(Instructor actual) {
    if (actual == null) {
        return false;
    }/*from w ww .ja v  a 2  s . c  om*/

    EqualsBuilder eq = new EqualsBuilder();
    eq.append(expected.getId(), actual.getId());
    eq.append(expected.getUuid(), actual.getUuid());
    eq.append(expected.getName(), actual.getName());
    eq.append(expected.getEmailAddress(), actual.getEmailAddress());
    eq.append(expected.getCreationDate(), actual.getCreationDate());

    return eq.isEquals();
}

From source file:br.com.logique.methodcache.MethodParameter.java

@Override
public boolean equals(Object o) {
    if (this == o)
        return true;

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

    MethodParameter that = (MethodParameter) o;

    return new EqualsBuilder().append(clazz, that.clazz).append(method, that.method)
            .append(parameters, that.parameters).isEquals();
}

From source file:com.jdom.mediadownloader.series.util.AvailableSeries.java

/**
 * {@inheritDoc}/*from   w w  w  . j  av a 2 s  .  co  m*/
 * 
 * @return
 */
@Override
public boolean equals(Object obj) {
    // Only consider the name important
    if (obj instanceof AvailableSeries) {
        AvailableSeries that = (AvailableSeries) obj;

        EqualsBuilder builder = new EqualsBuilder();
        builder.append(this.getName(), that.getName());
        return builder.isEquals();
    }
    return false;
}

From source file:io.cloudslang.lang.compiler.caching.CacheResult.java

@Override
public boolean equals(Object o) {
    if (this == o) {
        return true;
    }//from  w w  w . ja  v a 2s .co  m

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

    CacheResult that = (CacheResult) o;

    return new EqualsBuilder().append(state, that.state)
            .append(executableModellingResult, that.executableModellingResult).isEquals();
}

From source file:com.maskyn.fileeditorpro.util.GreatUri.java

@Override
public boolean equals(Object obj) {
    if (!(obj instanceof GreatUri))
        return false;
    if (obj == this)
        return true;

    GreatUri rhs = (GreatUri) obj;//w w w  .ja  va2  s. co  m
    return new EqualsBuilder().
    // if deriving: appendSuper(super.equals(obj)).
            append(uri, rhs.uri).isEquals();
}

From source file:com.hp.ov.sdk.dto.Fabric.java

@Override
public boolean equals(Object obj) {
    if (this == obj)
        return true;

    if (obj instanceof Fabric) {
        Fabric fabric = (Fabric) obj;/* ww w . ja va 2 s  .co  m*/

        return new EqualsBuilder().appendSuper(super.equals(obj)).append(domainUri, fabric.domainUri)
                .append(reservedVlanRange, fabric.reservedVlanRange).isEquals();
    }
    return false;
}

From source file:com.wavemaker.commons.model.security.LoginConfig.java

@Override
public boolean equals(final Object o) {
    if (this == o)
        return true;

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

    final LoginConfig that = (LoginConfig) o;

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

From source file:com.antonjohansson.elasticsearchshell.domain.index.IndexDocs.java

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

    IndexDocs that = (IndexDocs) obj;
    return new EqualsBuilder().append(this.count, that.count).append(this.deleted, that.deleted).isEquals();
}

From source file:io.cloudslang.content.ssh.entities.ProxyConnectionDetails.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }/*from w  ww. ja v a2  s. c o  m*/
    if (obj == this) {
        return true;
    }
    if (obj.getClass() != getClass()) {
        return false;
    }
    ProxyConnectionDetails that = (ProxyConnectionDetails) obj;
    return new EqualsBuilder().appendSuper(super.equals(obj)).append(proxyPort, that.getProxyPort())
            .append(proxyHost, that.getProxyHost()).append(proxyUsername, that.getProxyUsername())
            .append(proxyPassword, that.getProxyPassword()).isEquals();
}