}
@Override
public PlaceRequest toPlaceRequest(String placeToken)
throws TokenFormatException {
PlaceRequest result = null;
int qMarkLocations;
int ampLocation;
String[] paramParts;
String paramPart;
Logger.trace("getting place request for " + placeToken);
try {
qMarkLocations = placeToken.indexOf('?');
if (qMarkLocations < 0) {
ampLocation = placeToken.indexOf('&');
if (ampLocation >= 0) {
placeToken = placeToken.substring(0, ampLocation);
}
result = new PlaceRequest(placeToken);
} else {
result = new PlaceRequest(
placeToken.substring(0, qMarkLocations));
paramPart = placeToken.substring(qMarkLocations + 1);
paramParts = paramPart.split("&");
result = addParamsToRequest(result, paramParts);
}