Search in sources :

Example 46 with EqualsBuilder

use of org.apache.commons.lang.builder.EqualsBuilder in project pentaho-platform by pentaho.

the class PentahoRole method equals.

public boolean equals(Object obj) {
    if (obj instanceof PentahoRole == false) {
        return false;
    }
    if (this == obj) {
        return true;
    }
    PentahoRole rhs = (PentahoRole) obj;
    boolean result;
    if ((tenant == null) && (rhs.tenant == null)) {
        result = new EqualsBuilder().append(name, rhs.name).isEquals();
    } else {
        result = new EqualsBuilder().append(name, rhs.name).append(tenant, rhs.tenant).isEquals();
    }
    return result;
}
Also used : IPentahoRole(org.pentaho.platform.api.engine.security.userroledao.IPentahoRole) EqualsBuilder(org.apache.commons.lang.builder.EqualsBuilder)

Example 47 with EqualsBuilder

use of org.apache.commons.lang.builder.EqualsBuilder in project pentaho-platform by pentaho.

the class MockPentahoRole method equals.

public boolean equals(Object obj) {
    if (obj instanceof MockPentahoRole == false) {
        return false;
    }
    if (this == obj) {
        return true;
    }
    MockPentahoRole rhs = (MockPentahoRole) obj;
    boolean result;
    if ((tenant == null) && (rhs.tenant == null)) {
        result = new EqualsBuilder().append(name, rhs.name).isEquals();
    } else {
        result = new EqualsBuilder().append(name, rhs.name).append(tenant, rhs.tenant).isEquals();
    }
    return result;
}
Also used : EqualsBuilder(org.apache.commons.lang.builder.EqualsBuilder)

Example 48 with EqualsBuilder

use of org.apache.commons.lang.builder.EqualsBuilder in project googleads-java-lib by googleads.

the class DateTimesHelperTest method assertEquals.

/**
 * Asserts that two API date times are equal.
 */
private static void assertEquals(ApiDateTime expected, ApiDateTime actual) {
    boolean equals = expected == actual || new EqualsBuilder().append(expected.getDate().getYear(), actual.getDate().getYear()).append(expected.getDate().getMonth(), actual.getDate().getMonth()).append(expected.getDate().getDay(), actual.getDate().getDay()).append(expected.getHour(), actual.getHour()).append(expected.getMinute(), actual.getMinute()).append(expected.getSecond(), actual.getSecond()).append(DateTimeZone.forTimeZone(TimeZone.getTimeZone(expected.getTimeZoneId())).toTimeZone().getRawOffset(), DateTimeZone.forTimeZone(TimeZone.getTimeZone(actual.getTimeZoneId())).toTimeZone().getRawOffset()).isEquals();
    Assert.assertTrue(String.format("Expected: <%s> Actual: <%s>", toString(expected), toString(actual)), equals);
}
Also used : EqualsBuilder(org.apache.commons.lang.builder.EqualsBuilder)

Example 49 with EqualsBuilder

use of org.apache.commons.lang.builder.EqualsBuilder in project googleads-java-lib by googleads.

the class DateTimesTest method assertEquals.

/**
 * Asserts that two API date times are equal.
 */
private static void assertEquals(com.google.api.ads.admanager.jaxws.v202108.DateTime expected, com.google.api.ads.admanager.jaxws.v202108.DateTime actual) {
    boolean equals = expected == actual || new EqualsBuilder().append(expected.getDate().getYear(), actual.getDate().getYear()).append(expected.getDate().getMonth(), actual.getDate().getMonth()).append(expected.getDate().getDay(), actual.getDate().getDay()).append(expected.getHour(), actual.getHour()).append(expected.getMinute(), actual.getMinute()).append(expected.getSecond(), actual.getSecond()).append(DateTimeZone.forTimeZone(TimeZone.getTimeZone(expected.getTimeZoneId())).toTimeZone().getRawOffset(), DateTimeZone.forTimeZone(TimeZone.getTimeZone(actual.getTimeZoneId())).toTimeZone().getRawOffset()).isEquals();
    Assert.assertTrue(String.format("Expected: <%s> Actual: <%s>", toString(expected), toString(actual)), equals);
}
Also used : EqualsBuilder(org.apache.commons.lang.builder.EqualsBuilder)

Example 50 with EqualsBuilder

use of org.apache.commons.lang.builder.EqualsBuilder in project googleads-java-lib by googleads.

the class DateTimesTest method assertEquals.

/**
 * Asserts that two API date times are equal.
 */
private static void assertEquals(com.google.api.ads.admanager.jaxws.v202111.DateTime expected, com.google.api.ads.admanager.jaxws.v202111.DateTime actual) {
    boolean equals = expected == actual || new EqualsBuilder().append(expected.getDate().getYear(), actual.getDate().getYear()).append(expected.getDate().getMonth(), actual.getDate().getMonth()).append(expected.getDate().getDay(), actual.getDate().getDay()).append(expected.getHour(), actual.getHour()).append(expected.getMinute(), actual.getMinute()).append(expected.getSecond(), actual.getSecond()).append(DateTimeZone.forTimeZone(TimeZone.getTimeZone(expected.getTimeZoneId())).toTimeZone().getRawOffset(), DateTimeZone.forTimeZone(TimeZone.getTimeZone(actual.getTimeZoneId())).toTimeZone().getRawOffset()).isEquals();
    Assert.assertTrue(String.format("Expected: <%s> Actual: <%s>", toString(expected), toString(actual)), equals);
}
Also used : EqualsBuilder(org.apache.commons.lang.builder.EqualsBuilder)

Aggregations

EqualsBuilder (org.apache.commons.lang.builder.EqualsBuilder)95 ZooKeeper (org.apache.zookeeper.ZooKeeper)1 Product (org.candlepin.model.Product)1 AbstractStepMeta (org.pentaho.di.core.util.AbstractStepMeta)1 IPentahoRole (org.pentaho.platform.api.engine.security.userroledao.IPentahoRole)1 IPentahoUser (org.pentaho.platform.api.engine.security.userroledao.IPentahoUser)1