This makes it possible to read polygons or multipoints too. Since the encoded format is just a list of points the reader needs to be told what Feature to create from the encoded list. The example code is edited to reflect that API extension.
This class is able to convert an encoded polyline string into a LineString embedded in a Vector Feature. See https://developers.google.com/maps/documentation/utilities/polylinealgorithm for more information.