Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #478 #482

Merged
merged 2 commits into from
Jul 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/main/java/com/google/maps/PlaceAutocompleteRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,30 @@ protected PlaceAutocompleteRequest(GeoApiContext context) {
public static final class SessionToken implements UrlValue {
private UUID uuid;

/** This constructor creates a new session. */
public SessionToken() {
uuid = UUID.randomUUID();
}

/**
* Construct a session that is a continuation of a previous session.
*
* @param uuid The universally unique identifier for this session.
*/
public SessionToken(UUID uuid) {
this.uuid = uuid;
}

/**
* Retrieve the universally unique identifier for this session. This enables you to recreate the
* session token in a later context.
*
* @return Returns the universally unique identifier for this session.
*/
public UUID getUUID() {
return uuid;
}

@Override
public String toUrlValue() {
return uuid.toString();
Expand Down