private Stream <CompilationMessage> ValidateAggregationUpdateMethod(ExecutableElement aggregationFunction, Element returnType, IList <ExecutableElement> updateMethods) { if (updateMethods.Count != 1) { return(Stream.of(MissingAnnotation(aggregationFunction, returnType, updateMethods, typeof(UserAggregationUpdate)))); } Stream <CompilationMessage> errors = Stream.empty(); ExecutableElement updateMethod = updateMethods.GetEnumerator().next(); if (!IsValidUpdateSignature(updateMethod)) { errors = Stream.of(new AggregationError(updateMethod, "@%s usage error: method should be public, non-static and define 'void' as return type.", typeof(UserAggregationUpdate).Name)); } return(Stream.concat(errors, _functionVisitor.validateParameters(updateMethod.Parameters))); }
public override Stream <CompilationMessage> VisitExecutable(ExecutableElement executableElement, Void ignored) { return(Stream.of <Stream <CompilationMessage> >(_functionVisitor.validateEnclosingClass(executableElement), _functionVisitor.validateParameters(executableElement.Parameters), _functionVisitor.validateName(executableElement), _functionVisitor.validateReturnType(executableElement)).flatMap(System.Func.identity())); }