/** * @param key the key. * @param function the function (usually a JDK8 lambda). * @param <P> the payload type. * @return the enricher spec. * @see ContentEnricher#setPropertyExpressions(Map) * @see FunctionExpression */ public <P> EnricherSpec propertyFunction(String key, Function<Message<P>, Object> function) { this.propertyExpressions.put(key, new FunctionExpression<Message<P>>(function)); return _this(); }
/** * @param key the key. * @param function the function (usually a JDK8 lambda). * @param <P> the payload type. * @return the enricher spec. * @see ContentEnricher#setPropertyExpressions(Map) * @see FunctionExpression */ public <P> EnricherSpec propertyFunction(String key, Function<Message<P>, Object> function) { this.propertyExpressions.put(key, new FunctionExpression<Message<P>>(function)); return _this(); }
/** * @param variable the uri template variable. * @param valueFunction the function to evaluate value for te uri template variable. * @param <P> the payload type. * @return the current Spec. * @since 1.1.1 * @see HttpRequestExecutingMessageHandler#setUriVariableExpressions(Map) */ public <P> HttpMessageHandlerSpec uriVariable(String variable, Function<Message<P>, ?> valueFunction) { return uriVariable(variable, new FunctionExpression<Message<P>>(valueFunction)); }
/** * @param name the header name. * @param function the function (usually a JDK8 lambda). * @param overwrite true to overwrite the header if already present. * @param <P> the payload type. * @return the enricher spec. * @see ContentEnricher#setHeaderExpressions(Map) * @see FunctionExpression */ public <P> EnricherSpec headerFunction(String name, Function<Message<P>, Object> function, Boolean overwrite) { return headerExpression(name, new FunctionExpression<Message<P>>(function), overwrite); }
/** * Configure a {@link Function} to be invoked to generate the local file name; * argument passed to the {@code apply} method is the remote file name. * @param localFilenameFunction the localFilenameFunction. * @return the spec. * @see FunctionExpression */ public S localFilename(Function<String, String> localFilenameFunction) { return localFilenameExpression(new FunctionExpression<String>(localFilenameFunction)); }
/** * @param uriVariablesFunction to use. * @param <P> the payload type. * @return the current Spec. * @since 1.1.1 * @see HttpRequestExecutingMessageHandler#setUriVariablesExpression(Expression) */ public <P> HttpMessageHandlerSpec uriVariablesFunction(Function<Message<P>, Map<String, ?>> uriVariablesFunction) { return uriVariablesExpression(new FunctionExpression<Message<P>>(uriVariablesFunction)); }
/** * Configure a {@link Function} to select messages. The argument for the function * is a {@link javax.mail.internet.MimeMessage}; {@code apply} returns a boolean * result (true means select the message). * @param selectorFunction the selectorFunction. * @return the spec. * @see FunctionExpression */ public ImapIdleChannelAdapterSpec selector(Function<MimeMessage, Boolean> selectorFunction) { return selectorExpression(new FunctionExpression<MimeMessage>(selectorFunction)); }
/** * @param variable the uri template variable. * @param valueFunction the function to evaluate value for te uri template variable. * @param <P> the payload type. * @return the current Spec. * @since 1.1.1 * @see HttpRequestExecutingMessageHandler#setUriVariableExpressions(Map) */ public <P> HttpMessageHandlerSpec uriVariable(String variable, Function<Message<P>, ?> valueFunction) { return uriVariable(variable, new FunctionExpression<Message<P>>(valueFunction)); }
/** * The factory method for the {@link DecodingTransformer}. * @param codec the {@link Codec} to use. * @param typeFunction the target type function. * @param <T> the target type. * @return the {@link DecodingTransformer} instance. * @since 1.2 */ public static <T> DecodingTransformer<T> decoding(Codec codec, Function<Message<?>, Class<T>> typeFunction) { return decoding(codec, new FunctionExpression<Message<?>>(typeFunction)); }
/** * Configure a {@link Function} to be invoked to generate the local file name; * argument passed to the {@code apply} method is the remote file name. * @param localFilenameFunction the localFilenameFunction. * @return the spec. * @see FunctionExpression */ public S localFilename(Function<String, String> localFilenameFunction) { return localFilenameExpression(new FunctionExpression<String>(localFilenameFunction)); }
/** * The factory method for the {@link DecodingTransformer}. * @param codec the {@link Codec} to use. * @param typeFunction the target type function. * @param <T> the target type. * @return the {@link DecodingTransformer} instance. * @since 1.2 */ public static <T> DecodingTransformer<T> decoding(Codec codec, Function<Message<?>, Class<T>> typeFunction) { return decoding(codec, new FunctionExpression<Message<?>>(typeFunction)); }
/** * @param name the header name. * @param function the function (usually a JDK8 lambda). * @param overwrite true to overwrite the header if already present. * @param <P> the payload type. * @return the enricher spec. * @see ContentEnricher#setHeaderExpressions(Map) * @see FunctionExpression */ public <P> EnricherSpec headerFunction(String name, Function<Message<P>, Object> function, Boolean overwrite) { return headerExpression(name, new FunctionExpression<Message<P>>(function), overwrite); }
/** * @param header the header name to add. * @param headerFunction the function to evaluate the header value against {@link HttpEntity}. * @return the current Spec. * @since 1.1.1 * @see HttpRequestHandlingEndpointSupport#setHeaderExpressions(Map) */ public S headerFunction(String header, Function<HttpEntity<?>, ?> headerFunction) { return headerExpression(header, new FunctionExpression<HttpEntity<?>>(headerFunction)); }
/** * Configure a {@link Function} to select messages. The argument for the function * is a {@link javax.mail.internet.MimeMessage}; {@code apply} returns a boolean * result (true means select the message). * @param selectorFunction the selectorFunction. * @return the spec. * @see FunctionExpression */ public ImapIdleChannelAdapterSpec selector(Function<MimeMessage, Boolean> selectorFunction) { return selectorExpression(new FunctionExpression<MimeMessage>(selectorFunction)); }
/** * @param uriVariablesFunction to use. * @param <P> the payload type. * @return the current Spec. * @since 1.1.1 * @see HttpRequestExecutingMessageHandler#setUriVariablesExpression(Expression) */ public <P> HttpMessageHandlerSpec uriVariablesFunction(Function<Message<P>, Map<String, ?>> uriVariablesFunction) { return uriVariablesExpression(new FunctionExpression<Message<P>>(uriVariablesFunction)); }
/** * @param requestPayloadFunction the requestPayloadFunction. * @param <P> the payload type. * @return the enricher spec. * @see ContentEnricher#setRequestPayloadExpression(Expression) * @see FunctionExpression */ public <P> EnricherSpec requestPayload(Function<Message<P>, ?> requestPayloadFunction) { this.enricher.setRequestPayloadExpression(new FunctionExpression<Message<P>>(requestPayloadFunction)); return _this(); }
public <P> S remoteDirectory(Function<Message<P>, String> remoteDirectoryFunction) { this.target.setRemoteDirectoryExpression(new FunctionExpression<Message<P>>(remoteDirectoryFunction)); return _this(); }
public <P> S remoteDirectory(Function<Message<P>, String> remoteDirectoryFunction) { this.target.setRemoteDirectoryExpression(new FunctionExpression<Message<P>>(remoteDirectoryFunction)); return _this(); }
public <P> S temporaryRemoteDirectory(Function<Message<P>, String> temporaryRemoteDirectoryFunction) { this.target.setTemporaryRemoteDirectoryExpression( new FunctionExpression<Message<P>>(temporaryRemoteDirectoryFunction)); return _this(); }
@Bean public IntegrationFlow xsltFlow() { return f -> f .transform(Transformers.xslt(this.xslt, Tuples.of("testParam", new FunctionExpression<Message<?>>(m -> m.getHeaders().get("testParam"))), Tuples.of("testParam2", new FunctionExpression<Message<?>>(m -> m.getHeaders().get("testParam2"))), Tuples.of("unresolved", new FunctionExpression<Message<?>>(m -> m.getHeaders().get("foo"))), Tuples.of("testParam3", new LiteralExpression("hello")) )) .channel(receivedChannel()); }