Skip to content

Commit

Permalink
Merge pull request #482 from domesticmouse/master
Browse files Browse the repository at this point in the history
Fix for #478
  • Loading branch information
domesticmouse committed Jul 18, 2018
2 parents 2a1f151 + dd83e48 commit 9492f02
Showing 1 changed file with 20 additions and 0 deletions.
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

0 comments on commit 9492f02

Please sign in to comment.