@@ -1405,7 +1405,7 @@ public B enrichHeaders(Consumer<HeaderEnricherSpec> headerEnricherConfigurer) {
1405
1405
* @return the current {@link BaseIntegrationFlowDefinition}.
1406
1406
*/
1407
1407
public B split () {
1408
- return split (( Consumer < SplitterEndpointSpec < DefaultMessageSplitter >>) null );
1408
+ return splitWith (( splitterSpec ) -> { } );
1409
1409
}
1410
1410
1411
1411
/**
@@ -1420,21 +1420,47 @@ public B split() {
1420
1420
* @param endpointConfigurer the {@link Consumer} to provide integration endpoint options
1421
1421
* and for {@link DefaultMessageSplitter}.
1422
1422
* @return the current {@link BaseIntegrationFlowDefinition}.
1423
+ * @deprecated since 6.2 in favor of {@link #splitWith(Consumer)}.
1423
1424
* @see SplitterEndpointSpec
1424
1425
*/
1426
+ @ Deprecated (since = "6.2" , forRemoval = true )
1427
+ @ SuppressWarnings ("removal" )
1425
1428
public B split (@ Nullable Consumer <SplitterEndpointSpec <DefaultMessageSplitter >> endpointConfigurer ) {
1426
1429
return split (new DefaultMessageSplitter (), endpointConfigurer );
1427
1430
}
1428
1431
1432
+
1433
+ /**
1434
+ * Populate the splitter with provided options to the current integration flow position:
1435
+ * <pre class="code">
1436
+ * {@code
1437
+ * .splitWith(s -> s.applySequence(false).delimiters(","))
1438
+ * }
1439
+ * </pre>
1440
+ * or with the refenrence to POJO service method call:
1441
+ * <pre class="code">
1442
+ * {@code
1443
+ * .splitWith(s -> s.ref("someService").method("someMethod"))
1444
+ * }
1445
+ * </pre>
1446
+ * @param splitterConfigurer the {@link Consumer} to provide options splitter endpoint.
1447
+ * @return the current {@link BaseIntegrationFlowDefinition}.
1448
+ * @since 6.2
1449
+ * @see SplitterSpec
1450
+ */
1451
+ public B splitWith (Consumer <SplitterSpec > splitterConfigurer ) {
1452
+ return register (new SplitterSpec (), splitterConfigurer );
1453
+ }
1454
+
1429
1455
/**
1430
1456
* Populate the {@link ExpressionEvaluatingSplitter} with provided SpEL expression.
1431
1457
* @param expression the splitter SpEL expression.
1432
1458
* and for {@link ExpressionEvaluatingSplitter}.
1433
1459
* @return the current {@link BaseIntegrationFlowDefinition}.
1434
- * @see SplitterEndpointSpec
1460
+ * @see SplitterSpec
1435
1461
*/
1436
1462
public B split (String expression ) {
1437
- return split ( expression , ( Consumer < SplitterEndpointSpec < ExpressionEvaluatingSplitter >>) null );
1463
+ return splitWith (( splitterSpec ) -> splitterSpec . expression ( expression ) );
1438
1464
}
1439
1465
1440
1466
/**
@@ -1443,8 +1469,11 @@ public B split(String expression) {
1443
1469
* @param endpointConfigurer the {@link Consumer} to provide integration endpoint options
1444
1470
* and for {@link ExpressionEvaluatingSplitter}.
1445
1471
* @return the current {@link BaseIntegrationFlowDefinition}.
1472
+ * @deprecated since 6.2 in favor of {@link #splitWith(Consumer)}.
1446
1473
* @see SplitterEndpointSpec
1447
1474
*/
1475
+ @ Deprecated (since = "6.2" , forRemoval = true )
1476
+ @ SuppressWarnings ("removal" )
1448
1477
public B split (String expression ,
1449
1478
@ Nullable Consumer <SplitterEndpointSpec <ExpressionEvaluatingSplitter >> endpointConfigurer ) {
1450
1479
@@ -1472,7 +1501,7 @@ public B split(Object service) {
1472
1501
* @see MethodInvokingSplitter
1473
1502
*/
1474
1503
public B split (Object service , @ Nullable String methodName ) {
1475
- return split ( service , methodName , null );
1504
+ return splitWith (( splitterSpec ) -> splitterSpec . ref ( service ). method ( methodName ) );
1476
1505
}
1477
1506
1478
1507
/**
@@ -1484,9 +1513,12 @@ public B split(Object service, @Nullable String methodName) {
1484
1513
* @param endpointConfigurer the {@link Consumer} to provide integration endpoint options
1485
1514
* and for {@link MethodInvokingSplitter}.
1486
1515
* @return the current {@link BaseIntegrationFlowDefinition}.
1516
+ * @deprecated since 6.2 in favor of {@link #splitWith(Consumer)}.
1487
1517
* @see SplitterEndpointSpec
1488
1518
* @see MethodInvokingSplitter
1489
1519
*/
1520
+ @ Deprecated (since = "6.2" , forRemoval = true )
1521
+ @ SuppressWarnings ("removal" )
1490
1522
public B split (Object service , @ Nullable String methodName ,
1491
1523
@ Nullable Consumer <SplitterEndpointSpec <MethodInvokingSplitter >> endpointConfigurer ) {
1492
1524
@@ -1508,7 +1540,7 @@ public B split(Object service, @Nullable String methodName,
1508
1540
* @return the current {@link BaseIntegrationFlowDefinition}.
1509
1541
*/
1510
1542
public B split (String beanName , @ Nullable String methodName ) {
1511
- return split ( beanName , methodName , null );
1543
+ return splitWith (( splitterSpec ) -> splitterSpec . refName ( beanName ). method ( methodName ) );
1512
1544
}
1513
1545
1514
1546
/**
@@ -1520,8 +1552,11 @@ public B split(String beanName, @Nullable String methodName) {
1520
1552
* @param endpointConfigurer the {@link Consumer} to provide integration endpoint options
1521
1553
* and for {@link MethodInvokingSplitter}.
1522
1554
* @return the current {@link BaseIntegrationFlowDefinition}.
1555
+ * @deprecated since 6.2 in favor of {@link #splitWith(Consumer)}.
1523
1556
* @see SplitterEndpointSpec
1524
1557
*/
1558
+ @ Deprecated (since = "6.2" , forRemoval = true )
1559
+ @ SuppressWarnings ("removal" )
1525
1560
public B split (String beanName , @ Nullable String methodName ,
1526
1561
@ Nullable Consumer <SplitterEndpointSpec <MethodInvokingSplitter >> endpointConfigurer ) {
1527
1562
@@ -1540,10 +1575,10 @@ public B split(String beanName, @Nullable String methodName,
1540
1575
* </pre>
1541
1576
* @param messageProcessorSpec the splitter {@link MessageProcessorSpec}.
1542
1577
* @return the current {@link BaseIntegrationFlowDefinition}.
1543
- * @see SplitterEndpointSpec
1578
+ * @see SplitterSpec
1544
1579
*/
1545
1580
public B split (MessageProcessorSpec <?> messageProcessorSpec ) {
1546
- return split ( messageProcessorSpec , ( Consumer < SplitterEndpointSpec < MethodInvokingSplitter >>) null );
1581
+ return splitWith (( splitterSpec ) -> splitterSpec . ref ( messageProcessorSpec ) );
1547
1582
}
1548
1583
1549
1584
/**
@@ -1561,8 +1596,11 @@ public B split(MessageProcessorSpec<?> messageProcessorSpec) {
1561
1596
* @param endpointConfigurer the {@link Consumer} to provide integration endpoint options
1562
1597
* and for {@link MethodInvokingSplitter}.
1563
1598
* @return the current {@link BaseIntegrationFlowDefinition}.
1599
+ * @deprecated since 6.2 in favor of {@link #splitWith(Consumer)}.
1564
1600
* @see SplitterEndpointSpec
1565
1601
*/
1602
+ @ Deprecated (since = "6.2" , forRemoval = true )
1603
+ @ SuppressWarnings ("removal" )
1566
1604
public B split (MessageProcessorSpec <?> messageProcessorSpec ,
1567
1605
@ Nullable Consumer <SplitterEndpointSpec <MethodInvokingSplitter >> endpointConfigurer ) {
1568
1606
@@ -1595,7 +1633,7 @@ public B split(MessageProcessorSpec<?> messageProcessorSpec,
1595
1633
* @see LambdaMessageProcessor
1596
1634
*/
1597
1635
public <P > B split (Class <P > expectedType , Function <P , ?> splitter ) {
1598
- return split ( expectedType , splitter , null );
1636
+ return splitWith (( splitterSpec ) -> splitterSpec . function ( splitter ). expectedType ( expectedType ) );
1599
1637
}
1600
1638
1601
1639
/**
@@ -1621,9 +1659,12 @@ public <P> B split(Class<P> expectedType, Function<P, ?> splitter) {
1621
1659
* @param endpointConfigurer the {@link Consumer} to provide integration endpoint options.
1622
1660
* @param <P> the payload type or {@code Message.class}.
1623
1661
* @return the current {@link BaseIntegrationFlowDefinition}.
1662
+ * @deprecated since 6.2 in favor of {@link #splitWith(Consumer)}.
1624
1663
* @see LambdaMessageProcessor
1625
1664
* @see SplitterEndpointSpec
1626
1665
*/
1666
+ @ Deprecated (since = "6.2" , forRemoval = true )
1667
+ @ SuppressWarnings ("removal" )
1627
1668
public <P > B split (@ Nullable Class <P > expectedType , Function <P , ?> splitter ,
1628
1669
@ Nullable Consumer <SplitterEndpointSpec <MethodInvokingSplitter >> endpointConfigurer ) {
1629
1670
@@ -1640,10 +1681,10 @@ public <P> B split(@Nullable Class<P> expectedType, Function<P, ?> splitter,
1640
1681
* @param splitterMessageHandlerSpec the {@link MessageHandlerSpec} to populate.
1641
1682
* @param <S> the {@link AbstractMessageSplitter}
1642
1683
* @return the current {@link BaseIntegrationFlowDefinition}.
1643
- * @see SplitterEndpointSpec
1684
+ * @see SplitterSpec
1644
1685
*/
1645
1686
public <S extends AbstractMessageSplitter > B split (MessageHandlerSpec <?, S > splitterMessageHandlerSpec ) {
1646
- return split ( splitterMessageHandlerSpec , ( Consumer < SplitterEndpointSpec < S >>) null );
1687
+ return splitWith (( splitterSpec ) -> splitterSpec . ref ( splitterMessageHandlerSpec ) );
1647
1688
}
1648
1689
1649
1690
/**
@@ -1653,8 +1694,11 @@ public <S extends AbstractMessageSplitter> B split(MessageHandlerSpec<?, S> spli
1653
1694
* @param endpointConfigurer the {@link Consumer} to provide integration endpoint options.
1654
1695
* @param <S> the {@link AbstractMessageSplitter}
1655
1696
* @return the current {@link BaseIntegrationFlowDefinition}.
1697
+ * @deprecated since 6.2 in favor of {@link #splitWith(Consumer)}.
1656
1698
* @see SplitterEndpointSpec
1657
1699
*/
1700
+ @ Deprecated (since = "6.2" , forRemoval = true )
1701
+ @ SuppressWarnings ("removal" )
1658
1702
public <S extends AbstractMessageSplitter > B split (MessageHandlerSpec <?, S > splitterMessageHandlerSpec ,
1659
1703
@ Nullable Consumer <SplitterEndpointSpec <S >> endpointConfigurer ) {
1660
1704
@@ -1667,10 +1711,10 @@ public <S extends AbstractMessageSplitter> B split(MessageHandlerSpec<?, S> spli
1667
1711
* flow position.
1668
1712
* @param splitter the {@link AbstractMessageSplitter} to populate.
1669
1713
* @return the current {@link BaseIntegrationFlowDefinition}.
1670
- * @see SplitterEndpointSpec
1714
+ * @see SplitterSpec
1671
1715
*/
1672
1716
public B split (AbstractMessageSplitter splitter ) {
1673
- return split ( splitter , ( Consumer < SplitterEndpointSpec < AbstractMessageSplitter >>) null );
1717
+ return splitWith (( splitterSpec ) -> splitterSpec . ref ( splitter ) );
1674
1718
}
1675
1719
1676
1720
/**
@@ -1680,8 +1724,11 @@ public B split(AbstractMessageSplitter splitter) {
1680
1724
* @param endpointConfigurer the {@link Consumer} to provide integration endpoint options.
1681
1725
* @param <S> the {@link AbstractMessageSplitter}
1682
1726
* @return the current {@link BaseIntegrationFlowDefinition}.
1727
+ * @deprecated since 6.2 in favor of {@link #splitWith(Consumer)}.
1683
1728
* @see SplitterEndpointSpec
1684
1729
*/
1730
+ @ Deprecated (since = "6.2" , forRemoval = true )
1731
+ @ SuppressWarnings ("removal" )
1685
1732
public <S extends AbstractMessageSplitter > B split (S splitter ,
1686
1733
@ Nullable Consumer <SplitterEndpointSpec <S >> endpointConfigurer ) {
1687
1734
0 commit comments