Class DirectionsRequest.Builder

  • Enclosing class:
    DirectionsRequest

    public static final class DirectionsRequest.Builder
    extends java.lang.Object
    DirectionsRequest builder static inner class.
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • from

        @NonNull
        public DirectionsRequest.Builder from​(@NonNull
                                              Point from,
                                              @NonNull
                                              Angle bearingFrom)
        Sets the starting point of the route, and the bearing of the user to generate the appropriate instructions.
        Parameters:
        from - Point point inside a building (Point.isIndoor() == true)
        bearingFrom - Angle user's bearing
        Returns:
        a reference to this Builder, so that the methods can be chained together.
      • from

        @NonNull
        public DirectionsRequest.Builder from​(@NonNull
                                              Location currentLocation)
        Sets the current user's position as the starting point of the route.
        Parameters:
        currentLocation - current user's Location, obtained with LocationManager
        Returns:
        a reference to this Builder, so that the methods can be chained together.
      • to

        @NonNull
        public DirectionsRequest.Builder to​(@NonNull
                                            Point to)
        Sets the point to, where the route should end.
        Parameters:
        to - Point point inside a building (Point.isIndoor() == true)
        Returns:
        a reference to this Builder, so that the methods can be chained together.
      • isAccessible

        @NonNull
        public DirectionsRequest.Builder isAccessible​(boolean isAccessible)
        Sets if the route has to be suitable for wheel chairs (true) or not (false)
        Parameters:
        isAccessible - boolean
        Returns:
        a reference to this Builder, so that the methods can be chained together.
      • minimizeFloorChanges

        public DirectionsRequest.Builder minimizeFloorChanges​(boolean minimizeFloorChanges)
        Sets if you want to calculate a route minimizing the floor changes even if the route is longer. By default this is set to false, and it will calculate the shortest route.
        Returns:
        a reference to this Builder, so that the methods can be chained together.
      • includedTags

        public DirectionsRequest.Builder includedTags​(java.util.List<java.lang.String> includedTags)
        List of tags that you want to use when calculating a route. Only the tags added here will be used. Other tags on the graph will be excluded. The edges without a tag will always be used. If you don't include or exclude any tags the entire graph will be used to calculate the route.
        Returns:
        a reference to this Builder, so that the methods can be chained together.
      • excludedTags

        public DirectionsRequest.Builder excludedTags​(java.util.List<java.lang.String> excludedTags)
        List of tags that you want your route to avoid. If you exclude a tag the route will never pass through an edge that has this tag. If the route can only be generated passing through an edge with this tags the route calculation will fail.
        Returns:
        a reference to this Builder, so that the methods can be chained together.
      • excluding

        public DirectionsRequest.Builder excluding​(Circle exclusion)
        Add an area that will be excluded from the calculated route. The route will never contain a path that collides with the given circle. For example:
           DirectionsRequest request = new DirectionsRequest.Builder()
             .from(...)
             .to(...)
             .excluding(new Circle(center, radius))
             .build();
         

        Call this method as many times as you need to exclude multiple areas.

        If the given circle contains the beginning/end point of the route then an error 3061 will be generated and forwarded to your handler at DirectionsManager.requestDirections(DirectionsRequest, Handler).

        Parameters:
        exclusion - The Circle to be excluded.
        Returns:
        a reference to this Builder, so that the methods can be chained together.
      • build

        @NonNull
        public DirectionsRequest build()
        Returns a DirectionsRequest built from the parameters previously set.
        Returns:
        a DirectionsRequest built with parameters of this DirectionsRequest.Builder