Package 

Class FoodManager

  • All Implemented Interfaces:
    com.telenav.commerce.foodservice.api.IFoodApi

    
    public final class FoodManager
     implements IFoodApi
                        

    This class represents the concrete implementation of the IFoodApi

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Unit init(SDKOptions sdkOptions, IFoodUserServiceProvider userServiceProvider, IFoodPaymentServiceProvider paymentProvider) This method initialize or updates the food service.
      CommerceResponse<List<Brand>> getBrands() Makes a search for the available food brands.
      CommerceResponse<List<FoodStore>> getFoodStores(GeoLocation location, String brandId) Makes a search based on the given location and brand and returns a list of FoodStore.
      CommerceResponse<List<FoodStore>> getFoodStoresAlongRoute(GeoLocation location, String brandId, String merchantKey, List<GeoLocation> routePoints) Returns a list of available food stores around the given location, along the provided route, and for the given brand.
      CommerceResponse<List<FoodOrderInformation>> getHistory(Boolean onlyActive) Retrieves user's food orders.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FoodManager

        FoodManager(IFoodCommerceApi foodCommerceApi)
        Parameters:
        foodCommerceApi - The food commerce API implementation.
    • Method Detail

      • init

         Unit init(SDKOptions sdkOptions, IFoodUserServiceProvider userServiceProvider, IFoodPaymentServiceProvider paymentProvider)

        This method initialize or updates the food service. Before interacting with food service, the client is responsible to call this method. In case that a switch to a different environment is desired, the method can be called again with the new endpoint and corresponding api keys and tokens.

        Parameters:
        sdkOptions - The component used to set the apiKey, apiSecret, endpoint, applicationID.
        userServiceProvider - The user dependency required by food service for proper running.
        paymentProvider - The user dependency required by food service for proper running.
      • getFoodStores

        @WorkerThread() CommerceResponse<List<FoodStore>> getFoodStores(GeoLocation location, String brandId)

        Makes a search based on the given location and brand and returns a list of FoodStore. Maximum 9 results are retrieved.

        Parameters:
        location - the location for which the search is done.
        brandId - the id of the Brand for which the search should be done.
      • getFoodStoresAlongRoute

        @WorkerThread() CommerceResponse<List<FoodStore>> getFoodStoresAlongRoute(GeoLocation location, String brandId, String merchantKey, List<GeoLocation> routePoints)

        Returns a list of available food stores around the given location, along the provided route, and for the given brand. The results have the first one set as the default store

        Parameters:
        location - the coordinates around which the search should be done.
        brandId - the id of the Brand for which the search should be done.
        routePoints - list of route GeoLocation objects representing the route points
      • getHistory

        @WorkerThread() CommerceResponse<List<FoodOrderInformation>> getHistory(Boolean onlyActive)

        Retrieves user's food orders.

        Parameters:
        onlyActive - set if request should return only active orders