类 GeoApiContext
java.lang.Object
ai.nextbillion.maps.GeoApiContext
public class GeoApiContext
extends java.lang.Object
The entry point for making requests against the Google Geo APIs.
Construct this object by using the enclosed GeoApiContext.Builder.
GeoApiContexts should be shared
GeoApiContext works best when you create a single GeoApiContext instance, or one per API key, and reuse it for all your Google Geo API queries. This is because each GeoApiContext manages its own thread pool, back-end client, and other resources.
When you are finished with a GeoApiContext object, you must call shutdown() on it to
release its resources.
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classGeoApiContext.BuilderThe Builder forGeoApiContext.static interfaceGeoApiContext.RequestHandlerThe service provider interface that enables requests to be handled via switchable back ends. -
方法概要
修饰符和类型 方法 说明 voidclearExperienceId()Clears the experience ID if set the HTTP header fieldHttpHeaders.X_GOOG_MAPS_EXPERIENCE_IDwill be omitted from subsequent calls.java.lang.StringgetExperienceId()voidsetExperienceId(java.lang.String... experienceId)Sets the value for the HTTP header field nameHttpHeaders.X_GOOG_MAPS_EXPERIENCE_IDto be used on subsequent API calls.voidshutdown()Shut down this GeoApiContext instance, reclaiming resources.
-
方法详细资料
-
setExperienceId
public void setExperienceId(java.lang.String... experienceId)Sets the value for the HTTP header field nameHttpHeaders.X_GOOG_MAPS_EXPERIENCE_IDto be used on subsequent API calls. Calling this method withnullis equivalent to callingclearExperienceId().- 参数:
experienceId- The experience ID if set, otherwise null
-
getExperienceId
public java.lang.String getExperienceId()- 返回:
- Returns the experience ID if set, otherwise, null
-
clearExperienceId
public void clearExperienceId()Clears the experience ID if set the HTTP header fieldHttpHeaders.X_GOOG_MAPS_EXPERIENCE_IDwill be omitted from subsequent calls. -
shutdown
public void shutdown()Shut down this GeoApiContext instance, reclaiming resources. After shutdown() has been called, no further queries may be done against this instance.
-