JMethod jMethod = new JMethod("equals", JType.BOOLEAN, "true if the objects are equal.");
jMethod.setComment("Overrides the java.lang.Object.equals method.");
jMethod.addParameter(new JParameter(SGTypes.OBJECT, "obj"));
if (getConfig().useJava50()) {
jMethod.addAnnotation(new JAnnotation(new JAnnotationType("Override")));
}
jclass.addMethod(jMethod);
JSourceCode jsc = jMethod.getSourceCode();
jsc.add("if ( this == obj )");