WebImage.java
3.24 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
package com.google.android.gms.common.images;
import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import com.google.android.gms.common.internal.safeparcel.zza;
import com.google.android.gms.common.internal.zzaa;
import java.util.Locale;
import org.json.JSONException;
import org.json.JSONObject;
public final class WebImage
extends zza
{
public static final Parcelable.Creator<WebImage> CREATOR = new zzb();
final int a;
private final Uri b;
private final int c;
private final int d;
WebImage(int paramInt1, Uri paramUri, int paramInt2, int paramInt3)
{
this.a = paramInt1;
this.b = paramUri;
this.c = paramInt2;
this.d = paramInt3;
}
public WebImage(Uri paramUri)
throws IllegalArgumentException
{
this(paramUri, 0, 0);
}
public WebImage(Uri paramUri, int paramInt1, int paramInt2)
throws IllegalArgumentException
{
this(1, paramUri, paramInt1, paramInt2);
if (paramUri == null) {
throw new IllegalArgumentException("url cannot be null");
}
if ((paramInt1 < 0) || (paramInt2 < 0)) {
throw new IllegalArgumentException("width and height must not be negative");
}
}
public WebImage(JSONObject paramJSONObject)
throws IllegalArgumentException
{
this(a(paramJSONObject), paramJSONObject.optInt("width", 0), paramJSONObject.optInt("height", 0));
}
private static Uri a(JSONObject paramJSONObject)
{
Uri localUri = null;
if (paramJSONObject.has("url")) {}
try
{
localUri = Uri.parse(paramJSONObject.getString("url"));
return localUri;
}
catch (JSONException paramJSONObject) {}
return null;
}
public final boolean equals(Object paramObject)
{
if (this == paramObject) {}
do
{
return true;
if ((paramObject == null) || (!(paramObject instanceof WebImage))) {
return false;
}
paramObject = (WebImage)paramObject;
} while ((zzaa.equal(this.b, ((WebImage)paramObject).b)) && (this.c == ((WebImage)paramObject).c) && (this.d == ((WebImage)paramObject).d));
return false;
}
public final int getHeight()
{
return this.d;
}
public final Uri getUrl()
{
return this.b;
}
public final int getWidth()
{
return this.c;
}
public final int hashCode()
{
return zzaa.hashCode(new Object[] { this.b, Integer.valueOf(this.c), Integer.valueOf(this.d) });
}
public final JSONObject toJson()
{
JSONObject localJSONObject = new JSONObject();
try
{
localJSONObject.put("url", this.b.toString());
localJSONObject.put("width", this.c);
localJSONObject.put("height", this.d);
return localJSONObject;
}
catch (JSONException localJSONException) {}
return localJSONObject;
}
public final String toString()
{
return String.format(Locale.US, "Image %dx%d %s", new Object[] { Integer.valueOf(this.c), Integer.valueOf(this.d), this.b.toString() });
}
public final void writeToParcel(Parcel paramParcel, int paramInt)
{
zzb.a(this, paramParcel, paramInt);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/google/android/gms/common/images/WebImage.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/