Skip to content

Commit 5a2398b

Browse files
committed
work in progress
1 parent 615c04e commit 5a2398b

4 files changed

Lines changed: 18 additions & 20 deletions

File tree

.classpath

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,5 @@
2323
</attributes>
2424
</classpathentry>
2525
<classpathentry kind="var" path="ECLIPSE_HOME"/>
26-
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
27-
<attributes>
28-
<attribute name="maven.pomderived" value="true"/>
29-
</attributes>
30-
</classpathentry>
31-
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
32-
<attributes>
33-
<attribute name="maven.pomderived" value="true"/>
34-
</attributes>
35-
</classpathentry>
3626
<classpathentry kind="output" path="target/classes"/>
3727
</classpath>

src/main/java/com/google/gcloud/datastore/DateAndTime.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
import java.util.Date;
99

1010
/**
11-
* A Google Cloud Datastore timestamp.
12-
* A Datastore timestamp is represented in micro-seconds.
11+
* A Google Cloud Datastore timestamp (represented in micro-seconds).
1312
* This class is immutable.
1413
*
1514
* @see <a href="https://cloud.google.com/datastore/docs/concepts/entities">Google Cloud Datastore Entities, Properties, and Keys</a>

src/main/java/com/google/gcloud/datastore/ListValue.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@
1010
import java.util.List;
1111

1212
public final class ListValue extends
13-
Value<List<Value<?, ?, ?>>, ListValue, ListValue.Builder> {
13+
Value<List<? extends Value<?, ?, ?>>, ListValue, ListValue.Builder> {
1414

1515
private static final long serialVersionUID = -5461475706792576395L;
1616

17-
static final BaseMarshaller<List<Value<?, ?, ?>>, ListValue, Builder> MARSHALLER =
18-
new BaseMarshaller<List<Value<?, ?, ?>>, ListValue, Builder>() {
17+
static final BaseMarshaller<List<? extends Value<?, ?, ?>>, ListValue, Builder> MARSHALLER =
18+
new BaseMarshaller<List<? extends Value<?, ?, ?>>, ListValue, Builder>() {
1919

2020
@Override
2121
public int getProtoFieldId() {
2222
return LIST_VALUE_FIELD_NUMBER;
2323
}
2424

2525
@Override
26-
public Builder newBuilder(List<Value<?, ?, ?>> values) {
26+
public Builder newBuilder(List<? extends Value<?, ?, ?>> values) {
2727
return new Builder().set(values);
2828
}
2929

@@ -45,7 +45,7 @@ protected void setValue(ListValue from, DatastoreV1.Value.Builder to) {
4545
};
4646

4747
public static final class Builder extends
48-
Value.BaseBuilder<List<Value<?, ?, ?>>, ListValue, Builder> {
48+
Value.BaseBuilder<List<? extends Value<?, ?, ?>>, ListValue, Builder> {
4949

5050
private ImmutableList.Builder<Value<?, ?, ?>> listBuilder = ImmutableList.builder();
5151

@@ -74,7 +74,7 @@ public Builder addValue(Value<?, ?, ?> first, Value<?, ?, ?>... other) {
7474
* @see com.google.gcloud.datastore.Value.BaseBuilder#set(java.lang.Object)
7575
*/
7676
@Override
77-
public Builder set(List<Value<?, ?, ?>> properties) {
77+
public Builder set(List<? extends Value<?, ?, ?>> properties) {
7878
listBuilder = ImmutableList.<Value<?, ?, ?>>builder();
7979
for (Value<?, ?, ?> property : properties) {
8080
addValue(property);
@@ -83,7 +83,7 @@ public Builder set(List<Value<?, ?, ?>> properties) {
8383
}
8484

8585
@Override
86-
public List<Value<?, ?, ?>> get() {
86+
public List<? extends Value<?, ?, ?>> get() {
8787
return listBuilder.build();
8888
}
8989

@@ -94,7 +94,7 @@ public ListValue build() {
9494
}
9595
}
9696

97-
public ListValue(List<Value<?, ?, ?>> properties) {
97+
public ListValue(List<? extends Value<?, ?, ?>> properties) {
9898
this(new Builder().set(properties));
9999
}
100100

src/test/java/com/google/gcloud/datastore/DatastoreServiceTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import org.junit.Before;
1212
import org.junit.Test;
1313

14+
import java.util.Collections;
1415
import java.util.HashMap;
1516
import java.util.Iterator;
1617
import java.util.Map;
@@ -29,14 +30,22 @@ public class DatastoreServiceTest {
2930
private static final Key KEY1 = PARTIAL_KEY1.newKey("name");
3031
private static final Key KEY2 = new Key.Builder(KEY1, KIND2, 1).build();
3132
private static final Key KEY3 = KEY2.builder().name("bla").build();
33+
private static final KeyValue KEY_VALUE = new KeyValue(KEY1);
34+
private static final ListValue LIST_VALUE1 = new ListValue.Builder()
35+
.addValue(NULL_VALUE)
36+
.addValue(STR_VALUE, BOOL_VALUE)
37+
.build();
38+
private static final ListValue LIST_VALUE2 = new ListValue(Collections.singletonList(KEY_VALUE));
3239
private static final PartialEntity PARTIAL_ENTITY1 = new PartialEntity.Builder(PARTIAL_KEY2)
3340
.setProperty("str", STR_VALUE)
3441
.setProperty("bool", BOOL_VALUE)
42+
.setProperty("list", LIST_VALUE1)
3543
.build();
3644
private static final Entity ENTITY1 = new Entity.Builder(KEY1)
3745
.setProperty("str", STR_VALUE)
3846
.setProperty("bool", BOOL_VALUE)
3947
.setProperty("partial1", new PartialEntityValue(PARTIAL_ENTITY1))
48+
.setProperty("list", LIST_VALUE2)
4049
.build();
4150
private static final Entity ENTITY2 = new Entity.Builder(KEY2, ENTITY1)
4251
.removeProperty("str")

0 commit comments

Comments
 (0)