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:ezbake.discovery.stethoscope.server.StethoscopeCacheEntry.java

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

    StethoscopeCacheEntry rhs = (StethoscopeCacheEntry) obj;
    return new EqualsBuilder().append(applicationName, rhs.applicationName).append(serviceName, rhs.serviceName)
            .append(time, rhs.time).isEquals();
}

From source file:com.hp.ov.sdk.dto.generated.SwitchManagementConnection.java

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

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

    SwitchManagementConnection that = (SwitchManagementConnection) obj;

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

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

@Override
public boolean matchesSafely(Term actual) {
    if (actual == null) {
        return false;
    }/*w ww.  ja  va  2 s  .c  o m*/

    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.getCreationDate(), actual.getCreationDate());

    return eq.isEquals();
}

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

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

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

    LogicalSwitchGroup that = (LogicalSwitchGroup) obj;

    return new EqualsBuilder().appendSuper(super.equals(obj)).append(fabricUri, that.fabricUri)
            .append(switchMapTemplate, that.switchMapTemplate).isEquals();
}

From source file:de.perdian.apps.dashboard.mvc.modules.sonar.SonarControllerRequest.java

@Override
public boolean equals(Object that) {
    if (that instanceof SonarControllerRequest) {
        SonarControllerRequest thatRequest = (SonarControllerRequest) that;
        EqualsBuilder equalsBuilder = new EqualsBuilder();
        equalsBuilder.append(this.getPassword(), thatRequest.getPassword());
        equalsBuilder.append(this.getProjectName(), thatRequest.getProjectName());
        equalsBuilder.append(this.getUrl(), thatRequest.getUrl());
        equalsBuilder.append(this.getUsername(), thatRequest.getUsername());
        return equalsBuilder.isEquals();
    } else {// ww w . ja v a2  s .  co  m
        return false;
    }
}

From source file:de.perdian.apps.dashboard.mvc.modules.jenkins.JenkinsControllerRequest.java

@Override
public boolean equals(Object that) {
    if (that instanceof JenkinsControllerRequest) {
        JenkinsControllerRequest thatRequest = (JenkinsControllerRequest) that;
        EqualsBuilder equalsBuilder = new EqualsBuilder();
        equalsBuilder.append(this.getJobName(), thatRequest.getJobName());
        equalsBuilder.append(this.getPassword(), thatRequest.getPassword());
        equalsBuilder.append(this.getUrl(), thatRequest.getUrl());
        equalsBuilder.append(this.getUsername(), thatRequest.getUsername());
        return equalsBuilder.isEquals();
    } else {/* w w  w .j  a v  a2  s  . co  m*/
        return false;
    }
}

From source file:com.aqnote.app.wifianalyzer.wifi.graph.tools.GraphColor.java

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

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

    GraphColor otherDetail = (GraphColor) other;
    return new EqualsBuilder().append(getPrimary(), (otherDetail).getPrimary())
            .append(getBackground(), (otherDetail).getBackground()).isEquals();
}

From source file:com.invariantproperties.sandbox.springentitylistener.matcher.UserEquality.java

@Override
public boolean matchesSafely(TwitterUser actual) {
    if (actual == null) {
        return false;
    }/*from  w w w  .java  2 s . c o  m*/

    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.getPassword(), actual.getPassword());

    return eq.isEquals();
}

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

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

    IndexStats that = (IndexStats) obj;
    return new EqualsBuilder().append(this.documents, that.documents).isEquals();
}

From source file:io.github.rhkiswani.javaff.lang.EqualsHelper.java

@Override
protected Boolean doAction(Object... objects) {
    if (objects.length < 2) {
        return false;
    }/*from   www  .  j a  v  a2  s.c o m*/
    if (objects[0] == null && objects[1] == null) {
        return true;
    }
    if (objects[0] == null) {
        return false;
    }
    if (objects[1] == null) {
        return false;
    }
    if (!objects[0].getClass().equals(objects[1].getClass())) {
        return false;
    }
    List<Field> fields = getFieldsByAnnotation(objects[0], EqualsField.class);
    if (fields.size() == 0) {
        return objects[0].equals(objects[1]);
    }
    EqualsBuilder equalsBuilder = new EqualsBuilder();
    for (Field field : fields) {
        equalsBuilder.append(reflectionHelper.getFieldValue(objects[0], field.getName()),
                reflectionHelper.getFieldValue(objects[1], field.getName()));
    }
    return equalsBuilder.isEquals();
}