1616package com .google .maps .model ;
1717
1818import java .io .Serializable ;
19+ import java .util .Arrays ;
20+ import java .util .Objects ;
1921
2022/**
2123 * Represents a single Autocomplete result returned from the Google Places API Web Service.
@@ -61,6 +63,10 @@ public static class MatchedSubstring {
6163
6264 /** The start position of the matched substring, measured in Unicode characters. */
6365 public int offset ;
66+
67+ public String toString () {
68+ return String .format ("(offset=%d, length=%d)" , offset , length );
69+ }
6470 }
6571
6672 /**
@@ -83,5 +89,21 @@ public static class Term {
8389
8490 /** The text of the matched term. */
8591 public String value ;
92+
93+ public String toString () {
94+ return String .format ("(offset=%d, value=%s)" , offset , value );
95+ }
96+ }
97+
98+ public String toString () {
99+ return String .format (
100+ "[AutocompletePrediction: \" %s\" , placeId=%s, types=%s, terms=%s, "
101+ + "matchedSubstrings=%s, structuredFormatting=%s]" ,
102+ description ,
103+ placeId ,
104+ Arrays .toString (types ),
105+ Arrays .toString (terms ),
106+ Arrays .toString (matchedSubstrings ),
107+ Objects .toString (structuredFormatting ));
86108 }
87109}
0 commit comments