@Override
public void doTransform(final MutableClassDeclaration it, @Extension final TransformationContext context) {
AnnotationReference _findAnnotation = it.findAnnotation(context.findTypeGlobally(Data.class));
boolean _tripleNotEquals = (_findAnnotation != null);
if (_tripleNotEquals) {
return;
}
@Extension
final EqualsHashCodeProcessor.Util util = new EqualsHashCodeProcessor.Util(context);
boolean _hasEquals = util.hasEquals(it);
if (_hasEquals) {
final AnnotationReference annotation = it.findAnnotation(context.findTypeGlobally(EqualsHashCode.class));
context.addWarning(annotation, "equals is already defined, this annotation has no effect");
} else {
boolean _hasHashCode = util.hasHashCode(it);
if (_hasHashCode) {
context.addWarning(it, "hashCode is already defined, this annotation has no effect");
} else {
final Function1<MutableFieldDeclaration, Boolean> _function = (MutableFieldDeclaration it_1) -> {
return Boolean.valueOf((((!it_1.isStatic()) && (!it_1.isTransient())) && context.isThePrimaryGeneratedJavaElement(it_1)));
};
final Iterable<? extends MutableFieldDeclaration> fields = IterableExtensions.filter(it.getDeclaredFields(), _function);
util.addEquals(it, fields, util.hasSuperEquals(it));
util.addHashCode(it, fields, util.hasSuperHashCode(it));
}
}
}
}