CarLocation

@CarProtocol
public final class CarLocation


Represents a geographical location with a latitude and a longitude.

Summary

Public methods

static @NonNull CarLocation
create(@NonNull Location location)

Returns a new instance of a CarLocation with the same latitude and longitude contained in the given Location.

static @NonNull CarLocation
create(double latitude, double longitude)

Returns a new instance of a CarLocation.

boolean
double

Returns the latitude of the location, in degrees.

double

Returns the longitude of the location, in degrees.

int
String

Public methods

create

Added in 1.0.0
public static @NonNull CarLocation create(@NonNull Location location)

Returns a new instance of a CarLocation with the same latitude and longitude contained in the given Location.

Throws
java.lang.NullPointerException

if location is null

create

Added in 1.0.0
public static @NonNull CarLocation create(double latitude, double longitude)

Returns a new instance of a CarLocation.

equals

Added in 1.4.0-rc02
public boolean equals(@Nullable Object other)

getLatitude

Added in 1.0.0
public double getLatitude()

Returns the latitude of the location, in degrees.

getLongitude

Added in 1.0.0
public double getLongitude()

Returns the longitude of the location, in degrees.

hashCode

Added in 1.4.0-rc02
public int hashCode()

toString

Added in 1.4.0-rc02
public String toString()