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;
}
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;
}
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);
}
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);
}
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);
}
Aggregations