Skip to content

Commit 060ec57

Browse files
author
Ajay Kannan
committed
---
yaml --- r: 3195 b: refs/heads/master c: 3ccc7ed h: refs/heads/master i: 3193: 7d37182 3191: 9463df4
1 parent e7fda5b commit 060ec57

8 files changed

Lines changed: 17 additions & 24 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: f6eedddbb5d0f8a297633a524cf0eee08046c53c
2+
refs/heads/master: 3ccc7ed1660a1cc5eb0853bbdd2a38ba10e996e8
33
refs/heads/travis: e21ee7b88a5edc3f3d8c71f90c3fc32abf7e8dd6
44
refs/heads/gh-pages: 4e0561bb4504bf647db669a14417b2b2c87ba45d
55
refs/heads/pubsub-alpha: 1a0e970f265af871e02274085b9662b3fe29058b

trunk/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/GeoPoint.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ public final class GeoPoint extends Serializable<com.google.type.LatLng> {
4646
this.longitude = longitude;
4747
}
4848

49+
public double getLatitude() {
50+
return latitude;
51+
}
52+
53+
public double getLongitude() {
54+
return longitude;
55+
}
56+
4957
@Override
5058
public String toString() {
5159
return Double.toString(latitude) + ", " + Double.toString(longitude);
@@ -58,9 +66,8 @@ public int hashCode() {
5866

5967
@Override
6068
public boolean equals(Object obj) {
61-
return obj == this
62-
|| (obj instanceof GeoPoint && new Double(this.latitude).equals(((GeoPoint) obj).latitude))
63-
&& new Double(this.longitude).equals(((GeoPoint) obj).longitude);
69+
return obj == this || (obj instanceof GeoPoint && this.latitude == ((GeoPoint) obj).latitude
70+
&& this.longitude == ((GeoPoint) obj).longitude);
6471
}
6572

6673
public static GeoPoint of(double latitude, double longitude) {

trunk/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/GqlQuery.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,6 @@ public Builder<V> setBinding(String name, DateTime... value) {
212212
namedBindings.put(name, toBinding(DateTimeValue.MARSHALLER, Arrays.asList(value)));
213213
return this;
214214
}
215-
216-
public Builder<V> setBinding(String name, GeoPoint... value) {
217-
namedBindings.put(name, toBinding(GeoPointValue.MARSHALLER, Arrays.asList(value)));
218-
return this;
219-
}
220215

221216
public Builder<V> setBinding(String name, Key... value) {
222217
namedBindings.put(name, toBinding(KeyValue.MARSHALLER, Arrays.asList(value)));
@@ -263,11 +258,6 @@ public Builder<V> addBinding(DateTime... value) {
263258
return this;
264259
}
265260

266-
public Builder<V> addBinding(GeoPoint... value) {
267-
positionalBindings.add(toBinding(GeoPointValue.MARSHALLER, Arrays.asList(value)));
268-
return this;
269-
}
270-
271261
public Builder<V> addBinding(Key... value) {
272262
positionalBindings.add(toBinding(KeyValue.MARSHALLER, Arrays.asList(value)));
273263
return this;

trunk/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/StructuredQuery.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import static com.google.gcloud.datastore.BooleanValue.of;
2222
import static com.google.gcloud.datastore.DateTimeValue.of;
2323
import static com.google.gcloud.datastore.DoubleValue.of;
24-
import static com.google.gcloud.datastore.GeoPointValue.of;
2524
import static com.google.gcloud.datastore.KeyValue.of;
2625
import static com.google.gcloud.datastore.LongValue.of;
2726
import static com.google.gcloud.datastore.StringValue.of;
@@ -421,10 +420,6 @@ public static PropertyFilter eq(String property, DateTime value) {
421420
return new PropertyFilter(property, Operator.EQUAL, of(value));
422421
}
423422

424-
public static PropertyFilter eq(String property, GeoPoint value) {
425-
return new PropertyFilter(property, Operator.EQUAL, of(value));
426-
}
427-
428423
public static PropertyFilter eq(String property, Key value) {
429424
return new PropertyFilter(property, Operator.EQUAL, of(value));
430425
}

trunk/gcloud-java-datastore/src/test/java/com/google/gcloud/datastore/BaseEntityTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class BaseEntityTest {
3535

3636
private static final Blob BLOB = Blob.copyFrom(new byte[]{1, 2});
3737
private static final DateTime DATE_TIME = DateTime.now();
38-
private static final GeoPoint GEO_POINT = new GeoPoint(30.5, -40.5);
38+
private static final GeoPoint GEO_POINT = new GeoPoint(37.422035, -122.084124);
3939
private static final Key KEY = Key.builder("ds1", "k1", "n1").build();
4040
private static final Entity ENTITY = Entity.builder(KEY).set("name", "foo").build();
4141
private static final IncompleteKey INCOMPLETE_KEY = IncompleteKey.builder("ds1", "k1").build();

trunk/gcloud-java-datastore/src/test/java/com/google/gcloud/datastore/DatastoreTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ public class DatastoreTest {
7474
.build();
7575
private static final ListValue LIST_VALUE2 = ListValue.of(Collections.singletonList(KEY_VALUE));
7676
private static final DateTimeValue DATE_TIME_VALUE = new DateTimeValue(DateTime.now());
77-
private static final GeoPointValue GEO_POINT_VALUE = new GeoPointValue(new GeoPoint(30.5, 40.5));
77+
private static final GeoPointValue GEO_POINT_VALUE =
78+
new GeoPointValue(new GeoPoint(37.422035, -122.084124));
7879
private static final FullEntity<IncompleteKey> PARTIAL_ENTITY1 =
7980
FullEntity.builder(INCOMPLETE_KEY2).set("str", STR_VALUE).set("bool", BOOL_VALUE)
8081
.set("list", LIST_VALUE1).build();

trunk/gcloud-java-datastore/src/test/java/com/google/gcloud/datastore/GeoPointTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public class GeoPointTest {
2828
@Rule
2929
public ExpectedException thrown = ExpectedException.none();
3030

31-
private static GeoPoint gp1 = new GeoPoint(10.5, 20.5);
32-
private static GeoPoint gp2 = new GeoPoint(10.5, 30.5);
31+
private static GeoPoint gp1 = new GeoPoint(37.422035, -122.084124);
32+
private static GeoPoint gp2 = new GeoPoint(0.0, 0.0);
3333

3434
private static final String INVALID_LAT_MESSAGE =
3535
"latitude must be in the range [-90, 90] degrees";

trunk/gcloud-java-datastore/src/test/java/com/google/gcloud/datastore/SerializationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class SerializationTest {
4545
IncompleteKey.builder(KEY1, "v").ancestors(PathElement.of("p", 1)).build();
4646
private static final Key KEY2 = Key.builder(KEY1, "v", 2).build();
4747
private static final DateTime DATE_TIME1 = DateTime.now();
48-
private static final GeoPoint GEO_POINT = new GeoPoint(30.5, 40.5);
48+
private static final GeoPoint GEO_POINT = new GeoPoint(37.422035, -122.084124);
4949
private static final Blob BLOB1 = Blob.copyFrom(UTF_8.encode("hello world"));
5050
private static final Cursor CURSOR1 = Cursor.copyFrom(new byte[] {1,2});
5151
private static final Cursor CURSOR2 = Cursor.copyFrom(new byte[]{10});

0 commit comments

Comments
 (0)