import java.util.List
import java.util.Map
import java.util.regex.Pattern
+import org.gaul.modernizer_maven_annotations.SuppressModernizer
import org.opendaylight.mdsal.binding.model.api.ConcreteType
import org.opendaylight.mdsal.binding.model.api.Constant
import org.opendaylight.mdsal.binding.model.api.Enumeration
/**
* Template for generating JAVA class.
*/
+@SuppressModernizer
class ClassTemplate extends BaseTemplate {
protected val List<GeneratedProperty> properties
*
* @return string with the <code>equals()</code> method definition in JAVA format
*/
- def protected generateEquals() '''
+ def private generateEquals() '''
«IF !genTO.equalsIdentifiers.empty»
@«Override.importedName»
- public boolean equals(java.lang.Object obj) {
+ public final boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
- if (obj == null) {
+ if (!(obj instanceof «type.name»)) {
return false;
}
- if (getClass() != obj.getClass()) {
- return false;
- }
- «type.name» other = («type.name») obj;
+ final «type.name» other = («type.name») obj;
«FOR property : genTO.equalsIdentifiers»
«val fieldName = property.fieldName»
if (!«property.importedUtilClass».equals(«fieldName», other.«fieldName»)) {