Skip to content

Commit 5eb95f6

Browse files
committed
More Kotlin DSL improvements
1 parent 9759950 commit 5eb95f6

File tree

3 files changed

+179
-94
lines changed

3 files changed

+179
-94
lines changed

spring-integration-core/src/main/java/org/springframework/integration/dsl/BaseIntegrationFlowDefinition.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2021 the original author or authors.
2+
* Copyright 2019-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -496,7 +496,7 @@ public B wireTap(MessageChannel wireTapChannel, Consumer<WireTapSpec> wireTapCon
496496
* <pre class="code">
497497
* {@code
498498
* .transform("payload")
499-
* .wireTap(new WireTap(tapChannel().selector(m -> m.getPayload().equals("foo")))
499+
* .wireTap(new WireTap(tapChannel()).selector(m -> m.getPayload().equals("foo")))
500500
* .channel("foo")
501501
* }
502502
* </pre>
@@ -1721,7 +1721,7 @@ public B resequence() {
17211721
* Populate the
17221722
* {@link org.springframework.integration.aggregator.ResequencingMessageHandler} with
17231723
* provided options from {@link ResequencerSpec}.
1724-
* In addition accept options for the integration endpoint using {@link GenericEndpointSpec}.
1724+
* In addition, accept options for the integration endpoint using {@link GenericEndpointSpec}.
17251725
* Typically used with a Java 8 Lambda expression:
17261726
* <pre class="code">
17271727
* {@code
@@ -1744,7 +1744,7 @@ public B resequence(Consumer<ResequencerSpec> resequencer) {
17441744
* @return the current {@link BaseIntegrationFlowDefinition}.
17451745
*/
17461746
public B aggregate() {
1747-
return aggregate(null);
1747+
return aggregate((Consumer<AggregatorSpec>) null);
17481748
}
17491749

17501750
/**
@@ -1760,7 +1760,7 @@ public B aggregate(Object aggregatorProcessor) {
17601760

17611761
/**
17621762
* Populate the {@link AggregatingMessageHandler} with provided options from {@link AggregatorSpec}.
1763-
* In addition accept options for the integration endpoint using {@link GenericEndpointSpec}.
1763+
* In addition, accept options for the integration endpoint using {@link GenericEndpointSpec}.
17641764
* Typically used with a Java 8 Lambda expression:
17651765
* <pre class="code">
17661766
* {@code

spring-integration-core/src/main/kotlin/org/springframework/integration/dsl/IntegrationFlowDsl.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2021 the original author or authors.
2+
* Copyright 2020-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,7 +22,6 @@ import org.springframework.integration.endpoint.MessageProducerSupport
2222
import org.springframework.integration.gateway.MessagingGatewaySupport
2323
import org.springframework.messaging.Message
2424
import org.springframework.messaging.MessageChannel
25-
import java.util.function.Consumer
2625

2726
private fun buildIntegrationFlow(flowBuilder: IntegrationFlowBuilder,
2827
flow: (KotlinIntegrationFlowDefinition) -> Unit) =
@@ -160,6 +159,8 @@ fun integrationFlow(producerSpec: MessageProducerSpec<*, *>,
160159
* `IntegrationFlows.from(IntegrationFlow)` factory method.
161160
*
162161
* @author Artem Bilan
162+
*
163+
* @since 5.5.8
163164
*/
164165
fun integrationFlow(sourceFlow: IntegrationFlow, flow: KotlinIntegrationFlowDefinition.() -> Unit) =
165166
buildIntegrationFlow(IntegrationFlows.from(sourceFlow), flow)

0 commit comments

Comments
 (0)