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

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

public int hashCode()

toString

public String toString()