All Downloads are FREE. Search and download functionalities are using the official Maven repository.

appfusepojo.PojoEqualsHashcode.ftl Maven / Gradle / Ivy

Go to download

This plugin is used with Maven to generate source or resource artifacts for extending the functionality of your AppFuse application.

There is a newer version: 2.0-m4
Show newest version
<#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)}
         return result;
   }   




© 2015 - 2024 Weber Informatics LLC | Privacy Policy