Package com.iizix.geo
Class DeviceLocation
- java.lang.Object
- com.iizix.geo.DeviceLocation
public class DeviceLocation extends java.lang.Object
Class holding the location of a device.- Author:
- Christopher Mindus
Constructor Summary
Constructors Constructor Description DeviceLocation(java.lang.String device, GeoLocation location)
Constructor.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Checks for equality.java.lang.String
getDeviceUUID()
Returns the device UUID if possible.GeoLocation
getLocation()
Retrieves the location of the device.int
hashCode()
Hash code.java.lang.String
toString()
String representation of the class.
Constructor Detail
DeviceLocation
public DeviceLocation(java.lang.String device, GeoLocation location)
Constructor.- Parameters:
device
- The device UUID.location
- The location.- Throws:
java.lang.NullPointerException
- If deviceId or location is null.
Method Detail
getLocation
public GeoLocation getLocation()
Retrieves the location of the device.- Returns:
- The location.
getDeviceUUID
public java.lang.String getDeviceUUID()
Returns the device UUID if possible.- Returns:
- The device UUID, "browser" or "unknown".
equals
public boolean equals(java.lang.Object o)
Checks for equality.- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- The object to compare with.- Returns:
- When equals, false otherwise.
hashCode
public int hashCode()
Hash code.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- Returns the hash code.
toString
public java.lang.String toString()
String representation of the class.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string with user and distance.