List of usage examples for org.apache.commons.beanutils DynaClass equals
public boolean equals(Object obj)
From source file:org.apache.ddlutils.dynabean.SqlDynaBean.java
/** * {@inheritDoc}/* w w w . ja va 2 s.c o m*/ */ public boolean equals(Object obj) { if (obj instanceof SqlDynaBean) { SqlDynaBean other = (SqlDynaBean) obj; DynaClass dynaClass = getDynaClass(); if (dynaClass.equals(other.getDynaClass())) { DynaProperty[] props = dynaClass.getDynaProperties(); for (int idx = 0; idx < props.length; idx++) { Object value = get(props[idx].getName()); Object otherValue = other.get(props[idx].getName()); if (value == null) { if (otherValue != null) { return false; } } else { return value.equals(otherValue); } } return true; } } return false; }