GetNearestZoneRequest.java
1.57 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
package com.arellomobile.android.push.request;
import android.content.Context;
import android.location.Location;
import com.arellomobile.android.push.data.PushZoneLocation;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
public class GetNearestZoneRequest
extends PushRequest
{
private Location b;
private PushZoneLocation c;
public GetNearestZoneRequest(Location paramLocation)
{
this.b = paramLocation;
}
protected void buildParams(Context paramContext, Map<String, Object> paramMap)
{
paramMap.put("lat", Double.valueOf(this.b.getLatitude()));
paramMap.put("lng", Double.valueOf(this.b.getLongitude()));
}
public String getMethod()
{
return "getNearestZone";
}
public PushZoneLocation getNearestLocation()
{
return this.c;
}
public void parseResponse(JSONObject paramJSONObject)
throws JSONException
{
try
{
paramJSONObject = paramJSONObject.getJSONObject("response");
this.c = new PushZoneLocation();
this.c.setName(paramJSONObject.getString("name"));
this.c.setLat(paramJSONObject.getDouble("lat"));
this.c.setLng(paramJSONObject.getDouble("lng"));
this.c.setDistanceTo(paramJSONObject.getLong("distance"));
return;
}
catch (JSONException paramJSONObject)
{
this.c = null;
throw paramJSONObject;
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/arellomobile/android/push/request/GetNearestZoneRequest.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/