public abstract static class NbmapMatrix.Builder
extends java.lang.Object
By default, the directions profile is set to driving (without traffic) but can be changed to reflect your users use-case.
Note to contributors: All optional booleans in this builder use the object Boolean
rather than the primitive to allow for unset (null) values.
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
abstract NbmapMatrix.Builder |
accessToken(java.lang.String accessToken)
Required to call when this is being built.
|
NbmapMatrix.Builder |
addAnnotations(java.lang.String... annotations)
Optionally pass in annotations to control to change which data to return.
|
NbmapMatrix.Builder |
addApproaches(java.lang.String... approaches)
A semicolon-separated list indicating the side of the road from
which to approach waypoints in a requested route.
|
abstract NbmapMatrix.Builder |
baseUrl(java.lang.String baseUrl)
Optionally change the APIs base URL to something other then the default Nbmap one.
|
NbmapMatrix |
build()
This uses the provided parameters set using the
NbmapMatrix.Builder and first checks that all
values are valid, formats the values as strings for easier consumption by the API, and lastly
creates a new NbmapMatrix object with the values provided. |
abstract NbmapMatrix.Builder |
clientAppName(java.lang.String clientAppName)
Base package name or other simple string identifier.
|
NbmapMatrix.Builder |
coordinate(com.nbmap.geojson.Point coordinate)
This will add a single
Point to the coordinate list which is used to determine the
duration between points. |
NbmapMatrix.Builder |
coordinateListSizeLimit(java.lang.Integer coordinateListSizeLimit)
Override the standard maximum coordinate list size of 25 so that you can
make a Matrix API call with a list of coordinates as large as the value you give to
this method.
|
NbmapMatrix.Builder |
coordinates(java.util.List<com.nbmap.geojson.Point> coordinates)
Add a list of
Point's which define the points to perform the matrix on. |
NbmapMatrix.Builder |
destinations(java.lang.Integer... destinations)
Optionally pass in indexes to generate an asymmetric matrix.
|
abstract NbmapMatrix.Builder |
profile(java.lang.String profile)
This selects which mode of transportation the user will be using to accurately give the
matrix durations.
|
NbmapMatrix.Builder |
sources(java.lang.Integer... sources)
Optionally pass in indexes to generate an asymmetric matrix.
|
abstract NbmapMatrix.Builder |
user(java.lang.String user)
The username for the account that the directions engine runs on.
|
public abstract NbmapMatrix.Builder user(java.lang.String user)
DirectionsCriteria.PROFILE_DEFAULT_USER.user - a non-null string which will replace the default user used in the directions
requestpublic NbmapMatrix.Builder coordinates(java.util.List<com.nbmap.geojson.Point> coordinates)
Point's which define the points to perform the matrix on. The minimum
points is 2 and the maximum points allowed in totals 25. You can use this method in
conjunction with coordinate(Point).coordinates - a List full of Points which define the points to perform the
matrix onpublic NbmapMatrix.Builder coordinate(@NonNull com.nbmap.geojson.Point coordinate)
Point to the coordinate list which is used to determine the
duration between points. This can be called up to 25 times until you hit the maximum allowed
points. You can use this method in conjunction with coordinates(List).coordinate - a Point which you'd like the duration between all other pointspublic abstract NbmapMatrix.Builder profile(@NonNull java.lang.String profile)
profile - required to be one of the String values found in the
DirectionsCriteria.ProfileCriteriapublic abstract NbmapMatrix.Builder accessToken(@NonNull java.lang.String accessToken)
ServicesException will be thrown.accessToken - Nbmap access token, You must have a Nbmap account inorder to use
the Optimization APIpublic NbmapMatrix.Builder addAnnotations(@Nullable java.lang.String... annotations)
annotations - 1 or more annotationspublic NbmapMatrix.Builder addApproaches(@Nullable java.lang.String... approaches)
approaches - null if you'd like the default approaches,
else one of the options found in
DirectionsCriteria.ApproachesCriteria.public NbmapMatrix.Builder destinations(@Nullable java.lang.Integer... destinations)
destinations - 1 or more indexes as a integer, if more then one, separate with a commapublic NbmapMatrix.Builder sources(@Nullable java.lang.Integer... sources)
sources - 1 or more indexes as a integer, if more then one, separate with a commapublic abstract NbmapMatrix.Builder clientAppName(@NonNull java.lang.String clientAppName)
clientAppName - base package name or other simple string identifierpublic abstract NbmapMatrix.Builder baseUrl(@NonNull java.lang.String baseUrl)
baseUrl - base url used as end pointpublic NbmapMatrix.Builder coordinateListSizeLimit(@NonNull java.lang.Integer coordinateListSizeLimit)
coordinateListSizeLimit - the max limit of coordinates used by a single callpublic NbmapMatrix build()
NbmapMatrix.Builder and first checks that all
values are valid, formats the values as strings for easier consumption by the API, and lastly
creates a new NbmapMatrix object with the values provided.