appfusepojo.PojoEqualsHashcode.ftl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of appfuse-maven-plugin Show documentation
Show all versions of appfuse-maven-plugin Show documentation
This plugin is used with Maven to generate source or resource artifacts for extending the
functionality of your AppFuse application.
<#if pojo.needsEqualsHashCode() && !clazz.superclass?exists> public boolean equals(Object other) {
if ( (this == other ) ) return true;
if ( (other == null ) ) return false;
if ( !(other instanceof ${pojo.getDeclarationName()}) ) return false;
${pojo.getDeclarationName()} castOther = ( ${pojo.getDeclarationName()} ) other;
return ${pojo.generateEquals("this", "castOther", jdk5)};
}
public int hashCode() {
int result = 17;
<#foreach property in pojo.getAllPropertiesIterator()> ${pojo.generateHashCode(property, "result", "this", jdk5)}
#foreach> return result;
}
#if>