Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] #5004 - Initial MapboxAccountManager singleton
Browse files Browse the repository at this point in the history
  • Loading branch information
bleege committed May 11, 2016
1 parent 1225821 commit 56cf42e
Showing 1 changed file with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.mapbox.mapboxsdk;

public class MapboxAccountManager {

private static MapboxAccountManager mapboxAccountManager = null;

private final String accessToken;

/**
* MapboxAccountManager should NOT be instantiated directly.
* Use MapboxAccountManager.getInstance() instead.
* @param accessToken
*/
private MapboxAccountManager(String accessToken) {
super();
this.accessToken = accessToken;
}

/**
* Get an instance of MapboxAccountManager configured with the app's Access Token
* @param accessToken Mapbox Access Token. You can get one on the Mapbox Web site.
* @return MapboxAccountManager instance for app
*/
public static MapboxAccountManager getInstance(String accessToken) {
if (mapboxAccountManager == null) {
mapboxAccountManager = new MapboxAccountManager(accessToken);
}
return mapboxAccountManager;
}

/**
* Access Token for this application
* @return Mapbox Access Token
*/
public String getAccessToken() {
return accessToken;
}
}

0 comments on commit 56cf42e

Please sign in to comment.