File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed
main/java/com/vonage/client/voice
test/java/com/vonage/client/voice Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
2929- Renamed ` com.vonage.client.voice.Endpoint ` to ` CallEndpoint `
3030- Renamed ` com.vonage.client.voice.ncco.Endpoint ` to ` ConnectEndpoint `
3131- Refactored ` CallInfoPage ` to be aligned with other HAL responses (now extends ` HalPageResponse ` )
32+ - Now returns the embedded calls directly as a list rather than array
3233- Added ` get ` prefix to ` VideoStream ` and ` HlsSettings ` accessors
3334- ` NumbersClient#listNumbers ` now returns ` List<OwnedNumber> ` instead of ` ListNumbersResponse `
3435- ` NumbersClient#linkNumber ` now assigns the number to the application by ID
Original file line number Diff line number Diff line change 1717
1818import com .fasterxml .jackson .annotation .JsonIgnore ;
1919import com .fasterxml .jackson .annotation .JsonProperty ;
20- import com .fasterxml .jackson .databind .util .ArrayIterator ;
2120import com .vonage .client .JsonableBaseObject ;
2221import com .vonage .client .common .HalPageResponse ;
2322import java .util .Iterator ;
23+ import java .util .List ;
2424
2525/**
2626 * Response from {@link VoiceClient#listCalls(CallsFilter)}.
@@ -31,7 +31,7 @@ public class CallInfoPage extends HalPageResponse implements Iterable<CallInfo>
3131 @ JsonProperty ("_embedded" ) private Embedded embedded ;
3232
3333 static class Embedded extends JsonableBaseObject {
34- @ JsonProperty ("calls" ) private CallInfo [] callInfos ;
34+ @ JsonProperty ("calls" ) private List < CallInfo > callInfos ;
3535 }
3636
3737 /**
@@ -62,17 +62,17 @@ public Integer getRecordIndex() {
6262 /**
6363 * Gets the call details.
6464 *
65- * @return The CallInfos from the embedded object as an array .
65+ * @return The list of CallInfos from the embedded object.
6666 *
6767 * @since 9.0.0
6868 */
6969 @ JsonIgnore
70- public CallInfo [] getCallInfos () {
70+ public List < CallInfo > getCallInfos () {
7171 return embedded .callInfos ;
7272 }
7373
7474 @ Override
7575 public Iterator <CallInfo > iterator () {
76- return new ArrayIterator <>( getCallInfos ());
76+ return getCallInfos (). iterator ( );
7777 }
7878}
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ public void testBasics() {
9595 assertEquals ("/v1/calls?page_size=10" , links .getFirstUrl ().toString ());
9696 assertEquals ("/v1/calls?page_size=10&record_index=20&order=asc" , links .getSelfUrl ().toString ());
9797 assertEquals ("/v1/calls/1452dad1b27b4e71a90fb18af2656948" , links .getPrevUrl ().toString ());
98- assertEquals ("447700900549" , page .getCallInfos ()[ 0 ] .getTo ().toLog ());
98+ assertEquals ("447700900549" , page .getCallInfos (). getFirst () .getTo ().toLog ());
9999 assertEquals (10 , page .getPageSize ());
100100 assertEquals (0 , page .getRecordIndex ());
101101 }
You can’t perform that action at this time.
0 commit comments