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

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

Introduction

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

Prototype

public static boolean reflectionEquals(final Object lhs, final Object rhs, final boolean testTransients) 

Source Link

Document

This method uses reflection to determine if the two Objects are equal.

It uses AccessibleObject.setAccessible to gain access to private fields.

Usage

From source file:com.francetelecom.clara.cloud.logicalmodel.LogicalNodeServiceAssociation.java

public boolean equalsDeep(Object obj) {
    return EqualsBuilder.reflectionEquals(this, obj, EXCLUDED_EQUALS_DEEP_FIELDS);
}

From source file:com.msopentech.odatajclient.engine.data.ODataTimestamp.java

/**
 * {@inheritDoc }//  w  w  w . j  a v  a2s  .  c om
 */
@Override
public boolean equals(final Object obj) {
    return EqualsBuilder.reflectionEquals(this, obj, "sdf");
}

From source file:com.francetelecom.clara.cloud.logicalmodel.LogicalModelItem.java

@Override
public boolean equals(Object obj) {
    //See http://commons.apache.org/lang/api-2.5/org/apache/commons/lang/builder/HashCodeBuilder.html
    return EqualsBuilder.reflectionEquals(this, obj, EXCLUDED_EQUALS_FIELDS);
}

From source file:com.francetelecom.clara.cloud.logicalmodel.LogicalModelItem.java

/**
 * Utility method for subclasses to request equals with fields at our level, but excluding subclasses
 * fields//from w w w  .  j av  a2s .  co  m
 */
protected boolean equals(Object obj, String[] excludedSubclassfields) {
    return EqualsBuilder.reflectionEquals(this, obj,
            EqualsUtils.mergeExcludedFieldLists(excludedSubclassfields, EXCLUDED_EQUALS_FIELDS));
}

From source file:de.blizzy.documentr.markdown.HtmlSerializerContextTest.java

@Test
public void addAndGetHeaders() {
    Header[] headers = { new Header("foo", 1), //$NON-NLS-1$
            new Header("bar", 2), //$NON-NLS-1$
            new Header("baz", 3) //$NON-NLS-1$
    };/*w  w  w.j  ava 2s  .c om*/
    for (Header header : headers) {
        htmlSerializerContext.addHeader(header.getText(), header.getLevel());
    }

    List<Header> result = htmlSerializerContext.getHeaders();
    for (int i = 0; i < result.size(); i++) {
        assertTrue(EqualsBuilder.reflectionEquals(result.get(i), headers[i], true));
    }
}

From source file:com.github.fedorchuck.webstore.domainmodels.Commodity.java

@Override
public boolean equals(Object that) {
    return EqualsBuilder.reflectionEquals(this, that, "id");
}

From source file:libepg.epg.section.body.networkinformationtable.TransportStreamLoop.java

/**
 * @return ???true// www  .ja va2  s .  co m
 */
@Override
public boolean equals(Object obj) {
    return EqualsBuilder.reflectionEquals(this, obj, true);
}

From source file:com.francetelecom.clara.cloud.commons.MavenReference.java

@Override
public boolean equals(Object obj) {
    return EqualsBuilder.reflectionEquals(this, obj, EXCLUDED_EQUALS_FIELDS);
}

From source file:com.btoddb.chronicle.TokenizedFormatter.java

public boolean equals(Object o) {
    return EqualsBuilder.reflectionEquals(this, o, false);
}

From source file:io.specto.hoverfly.junit.core.model.Request.java

@Override
public boolean equals(Object obj) {
    return EqualsBuilder.reflectionEquals(this, obj, "requestType");
}