templates.equalst Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JavaForger Show documentation
Show all versions of JavaForger Show documentation
JavaForger can create source code from templates using existing java classes as input.
import org.apache.commons.lang3.builder.EqualsBuilder;
@Override
public boolean equals(Object obj) {
boolean equals = false;
if (this == obj) {
equals = true;
} else if (obj != null && getClass() == obj.getClass()) {
${mergeClassName} other = (${mergeClassName}) obj;
equals = new EqualsBuilder()
<#if class.extend??>
.appendSuper(super.equals(obj))
#if>
<#list fields as field>
.append(${field.name}, other.${field.name})
#list>
.isEquals();
}
return equals;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy