INTSAMPLES-19 Change Return Type to List<> from Array
This commit is contained in:
@@ -17,6 +17,7 @@ package org.springframework.integration.samples.testing.externalgateway;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.context.support.AbstractApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
@@ -36,8 +37,8 @@ public class Main {
|
||||
BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
|
||||
String zip = console.readLine().trim();
|
||||
WeatherAndTraffic weatherAndTraffic = context.getBean("wat", WeatherAndTraffic.class);
|
||||
String[] result = weatherAndTraffic.getByZip(zip);
|
||||
System.out.println(result[0] + "\r\n" + result[1] + "\r\n");
|
||||
List<String> result = weatherAndTraffic.getByZip(zip);
|
||||
System.out.println(result.get(0) + "\r\n" + result.get(1) + "\r\n");
|
||||
context.close();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.springframework.integration.samples.testing.externalgateway;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Gary Russell
|
||||
* @since 2.0.2
|
||||
@@ -22,6 +24,6 @@ package org.springframework.integration.samples.testing.externalgateway;
|
||||
*/
|
||||
public interface WeatherAndTraffic {
|
||||
|
||||
public String[] getByZip(String zip);
|
||||
public List<String> getByZip(String zip);
|
||||
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<channel id="aggregatorChannel" />
|
||||
|
||||
<aggregator input-channel="aggregatorChannel"
|
||||
expression="#this.![payload].toArray()"/>
|
||||
expression="#this.![payload]"/>
|
||||
|
||||
<task:executor id="executor" pool-size="10"/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user