protected MutableClassDeclaration generateImpl(final MutableClassDeclaration impl, @Extension final TransformationContext context) { final Function1<AnnotationReference, Boolean> _function = (AnnotationReference it) -> { AnnotationTypeDeclaration _annotationTypeDeclaration = it.getAnnotationTypeDeclaration(); Type _findTypeGlobally = context.findTypeGlobally(JsonRpcData.class); return Boolean.valueOf(Objects.equal(_annotationTypeDeclaration, _findTypeGlobally)); }; impl.removeAnnotation(IterableExtensions.findFirst(impl.getAnnotations(), _function)); JsonRpcDataTransformationContext _jsonRpcDataTransformationContext = new JsonRpcDataTransformationContext(context); this.generateImplMembers(impl, _jsonRpcDataTransformationContext); this.generateToString(impl, context); Type _type = impl.getExtendedClass().getType(); Type _type_1 = context.newTypeReference(Object.class).getType(); final boolean shouldIncludeSuper = (!Objects.equal(_type, _type_1)); final EqualsHashCodeProcessor.Util equalsHashCodeUtil = new EqualsHashCodeProcessor.Util(context); final Function1<MutableFieldDeclaration, Boolean> _function_1 = (MutableFieldDeclaration it) -> { boolean _isStatic = it.isStatic(); return Boolean.valueOf((!_isStatic)); }; final Iterable<? extends MutableFieldDeclaration> fields = IterableExtensions.filter(impl.getDeclaredFields(), _function_1); equalsHashCodeUtil.addEquals(impl, fields, shouldIncludeSuper); equalsHashCodeUtil.addHashCode(impl, fields, shouldIncludeSuper); return impl; }
protected MutableClassDeclaration generateImpl(final MutableClassDeclaration impl, @Extension final TransformationContext context) { final Function1<AnnotationReference, Boolean> _function = (AnnotationReference it) -> { AnnotationTypeDeclaration _annotationTypeDeclaration = it.getAnnotationTypeDeclaration(); Type _findTypeGlobally = context.findTypeGlobally(JsonRpcData.class); return Boolean.valueOf(Objects.equal(_annotationTypeDeclaration, _findTypeGlobally)); }; impl.removeAnnotation(IterableExtensions.findFirst(impl.getAnnotations(), _function)); JsonRpcDataTransformationContext _jsonRpcDataTransformationContext = new JsonRpcDataTransformationContext(context); this.generateImplMembers(impl, _jsonRpcDataTransformationContext); this.generateToString(impl, context); Type _type = impl.getExtendedClass().getType(); Type _type_1 = context.newTypeReference(Object.class).getType(); final boolean shouldIncludeSuper = (!Objects.equal(_type, _type_1)); final EqualsHashCodeProcessor.Util equalsHashCodeUtil = new EqualsHashCodeProcessor.Util(context); final Function1<MutableFieldDeclaration, Boolean> _function_1 = (MutableFieldDeclaration it) -> { boolean _isStatic = it.isStatic(); return Boolean.valueOf((!_isStatic)); }; final Iterable<? extends MutableFieldDeclaration> fields = IterableExtensions.filter(impl.getDeclaredFields(), _function_1); equalsHashCodeUtil.addEquals(impl, fields, shouldIncludeSuper); equalsHashCodeUtil.addHashCode(impl, fields, shouldIncludeSuper); return impl; }
boolean _not_1 = (!_hasEquals); if (_not_1) { ehUtil.addEquals(it, util.getDataFields(it), ehUtil.hasSuperEquals(it));
boolean _not_1 = (!_hasEquals); if (_not_1) { ehUtil.addEquals(it, util.getDataFields(it), ehUtil.hasSuperEquals(it));
@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)); } } } }