HERE Android SDK Developer's Guide

Fare

The class Fare is a member of com.here.android.mpa.urbanmobility .

Class Summary

public final class Fare

extends java.lang.Object

Represents information about a single fare (e.g.

[For complete information, see the section Class Details]

Method Summary

Table 1. Methods in Fare
Methods

public boolean equals (Object o)

public String getCurrency ()

Gets ISO 4217 code of currency in which the price is given, e.g.

public Boolean getEstimated ()

Gets whether the fare price is estimated or if it's an exact value.

public FareType getFareType ()

Gets type of fare represented by this object.

public java.util.Collection <Link> getLinks ()

Gets the collection of Links associated with this fare e.g.

public double getMaximumPrice ()

Gets maximum price of the fare (or parking costs if reason is "parking")

public String getName ()

Gets name of the fare.

public double getPrice ()

Gets price of the fare (or parking costs if reason is "parking")

public String getPriceAsString ()

Gets the fare price as a formatted, ready-to-display string, entailing the currency.

public String getReason ()

Gets the reason for the cost described in this element, e.g.

public int hashCode ()

public String toString ()

Class Details

Represents information about a single fare (e.g. ticket).

IMPORTANT: Urban Mobility routing is a Beta feature. The related classes are subject to change without notice.

Method Details

public boolean equals (Object o)

Parameters:

  • o

public String getCurrency ()

Gets ISO 4217 code of currency in which the price is given, e.g. "EUR".

Returns:

ISO 4217 code of currency of the price

See also:

ISO 4217

public Boolean getEstimated ()

Gets whether the fare price is estimated or if it's an exact value. For example most taxi fares can only be estimated since the final price depends on the trip duration which is affected by the traffic.

Returns:

true if the price is estimated, false if exact

public FareType getFareType ()

Gets type of fare represented by this object. The client application is responsible to correctly visualize the fare model to the user. Since the supported fare types can be extended in the future, it's recommended hiding the fare information when encountering an unrecognized fare type.

Returns:

type of fare

Gets the collection of Links associated with this fare e.g. to booking page.

Returns:

Collection of Links associated with this fare, or empty collection.

public double getMaximumPrice ()

Gets maximum price of the fare (or parking costs if reason is "parking")

If the price is a range, indicated by fare type being set to RANGE, this value will be representing the upper bound of the range, and getPrice() returns possibly the lower bound of a price range. If the price is not a range, this method will return the same value as getPrice().

Returns:

price of the fare (possibly upper bound of a price range)

See also:

getFareType()

getPrice()

public String getName ()

Gets name of the fare.

Returns:

name of the fare

public double getPrice ()

Gets price of the fare (or parking costs if reason is "parking")

For parking costs this is the maximum hourly rate or daily rate.

When fare type is set to RANGE, this method returns the lower bound of a price range, and getMaximumPrice() contains the upper bound of a price range, or the same value as this method if the price is exact.

Returns:

price of the fare (possibly lower bound of a price range)

See also:

getFareType()

getMaximumPrice()

public String getPriceAsString ()

Gets the fare price as a formatted, ready-to-display string, entailing the currency. Insensitive to locale, uses a fixed convention for simplicity sake.

Returns:

fare price as a ready-to-display string (incl. currency)

public String getReason ()

Gets the reason for the cost described in this element, e.g. parking.

Returns:

the reason for the cost (eg. parking)

public int hashCode ()

public String toString ()

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.