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

template.PojoEqualsHashcode.ftl Maven / Gradle / Ivy

<#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