Welcome to mirror list, hosted at ThFree Co, Russian Federation.

GeofenceLocation.java « geofence « maps « mapswithme « com « src « android - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 17ee4b32c9cb82368a81894601c6c6bdcc6fc895 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.mapswithme.maps.geofence;

import android.location.Location;
import android.support.annotation.NonNull;

public class GeofenceLocation
{
  private final double mLat;
  private final double mLon;
  private final float mRadiusInMeters;

  private GeofenceLocation(double lat, double lon, float radiusInMeters)
  {
    mLat = lat;
    mLon = lon;
    mRadiusInMeters = radiusInMeters;
  }

  @Override
  public String toString()
  {
    final StringBuilder sb = new StringBuilder("GeofenceLocation{");
    sb.append("mLat=").append(getLat());
    sb.append(", mLon=").append(getLon());
    sb.append(", mRadiusInMeters=").append(getRadiusInMeters());
    sb.append('}');
    return sb.toString();
  }

  public double getLat()
  {
    return mLat;
  }

  public double getLon()
  {
    return mLon;
  }

  public float getRadiusInMeters()
  {
    return mRadiusInMeters;
  }

  @NonNull
  public static GeofenceLocation from(@NonNull Location location)
  {
    return new GeofenceLocation(location.getLatitude(), location.getLongitude(), location.getAccuracy());
  }
}