Skip to content

Commit 70a1976

Browse files
committed
---
yaml --- r: 53 b: refs/heads/master c: 393682e h: refs/heads/master i: 51: 0d1ed74 v: v3
1 parent 0a45e79 commit 70a1976

5 files changed

Lines changed: 21 additions & 43 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: ea5765bb5df9d86277c2e452746ead11531329c5
2+
refs/heads/master: 393682e16733b65bbc7809199711dfb255ae4c93

trunk/.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>

trunk/.settings/org.eclipse.jdt.core.prefs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonN
88
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
99
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
1010
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
11-
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
12-
org.eclipse.jdt.core.compiler.compliance=1.7
1311
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
1412
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
1513
org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
@@ -92,4 +90,3 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
9290
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
9391
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
9492
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
95-
org.eclipse.jdt.core.compiler.source=1.7

trunk/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<plugin>
5454
<groupId>org.apache.maven.plugins</groupId>
5555
<artifactId>maven-compiler-plugin</artifactId>
56-
<version>2.5.1</version>
56+
<version>3.1</version>
5757
<configuration>
5858
<source>1.7</source>
5959
<target>1.7</target>

trunk/src/main/java/com/google/gcloud/datastore/Value.java

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -40,85 +40,72 @@ public enum Type {
4040
/**
4141
* Represents a {@code null} value.
4242
*/
43-
NULL(NullValue.MARSHALLER, NullValue.MARSHALLER),
43+
NULL(NullValue.MARSHALLER),
4444

4545
/**
4646
* Represents a {@code string} value.
4747
*/
48-
STRING(StringValue.MARSHALLER, StringValue.MARSHALLER),
48+
STRING(StringValue.MARSHALLER),
4949

5050
/**
5151
* Represents an entity ({@link PartialEntity} or {@link Entity}) value.
5252
*/
53-
ENTITY(EntityValue.MARSHALLER, EntityValue.MARSHALLER),
53+
ENTITY(EntityValue.MARSHALLER),
5454

5555
/**
5656
* Represents a {@code list} of {@link Value}s.
5757
*/
58-
LIST(ListValue.MARSHALLER, ListValue.MARSHALLER),
58+
LIST(ListValue.MARSHALLER),
5959

6060
/**
6161
* Represents a {@code key} as a value.
6262
*/
63-
KEY(KeyValue.MARSHALLER, KeyValue.MARSHALLER),
63+
KEY(KeyValue.MARSHALLER),
6464

6565
/**
6666
* Represents a {@code long} value.
6767
*/
68-
LONG(LongValue.MARSHALLER, LongValue.MARSHALLER),
68+
LONG(LongValue.MARSHALLER),
6969

7070
/**
7171
* Represents a {@code double} value.
7272
*/
73-
DOUBLE(DoubleValue.MARSHALLER, DoubleValue.MARSHALLER),
73+
DOUBLE(DoubleValue.MARSHALLER),
7474

7575
/**
7676
* Represents a {@code boolean} value.
7777
*/
78-
BOOLEAN(BooleanValue.MARSHALLER, BooleanValue.MARSHALLER),
78+
BOOLEAN(BooleanValue.MARSHALLER),
7979

8080
/**
8181
* Represents a {@link DateTime} value.
8282
*/
83-
DATE_TIME(DateTimeValue.MARSHALLER, DateTimeValue.MARSHALLER),
83+
DATE_TIME(DateTimeValue.MARSHALLER),
8484

8585
/**
8686
* Represents a {@link Blob} value.
8787
*/
88-
BLOB(BlobValue.MARSHALLER, BlobValue.MARSHALLER),
88+
BLOB(BlobValue.MARSHALLER),
8989

9090
/**
9191
* Represents a raw/unparsed value.
9292
*/
93-
RAW_VALUE(RawValue.MARSHALLER, RawValue.MARSHALLER);
93+
RAW_VALUE(RawValue.MARSHALLER);
9494

9595

96-
@SuppressWarnings("rawtypes") private final BuilderFactory builderFactory;
9796
@SuppressWarnings("rawtypes") private final Marshaller marshaller;
9897

99-
<V, P extends Value<V>, B extends Builder<V, P, B>> Type(Marshaller<V, P, B> marshaller,
100-
BuilderFactory<V, P, B> builderFactory) {
98+
<V, P extends Value<V>, B extends Builder<V, P, B>> Type(Marshaller<V, P, B> marshaller) {
10199
this.marshaller = marshaller;
102-
this.builderFactory = builderFactory;
103100
int fieldId = marshaller.getProtoFieldId();
104101
if (fieldId > 0) {
105102
DESCRIPTOR_TO_TYPE_MAP.put(fieldId, this);
106103
}
107104
}
108105

109-
<V, P extends Value<V>, B extends Builder<V, P, B>> Marshaller<V, P, B> getMarshaller() {
106+
Marshaller getMarshaller() {
110107
return marshaller;
111108
}
112-
113-
<V, P extends Value<V>, B extends Builder<V, P, B>> BuilderFactory<V, P, B>
114-
getBuilderFactory() {
115-
return builderFactory;
116-
}
117-
}
118-
119-
interface BuilderFactory<V, P extends Value<V>, B extends Builder<V, P, B>> {
120-
121-
B newBuilder(V value);
122109
}
123110

124111
interface Builder<V, P extends Value<V>, B extends Builder<V, P, B>> {
@@ -142,6 +129,10 @@ interface Builder<V, P extends Value<V>, B extends Builder<V, P, B>> {
142129
P build();
143130
}
144131

132+
interface BuilderFactory<V, P extends Value<V>, B extends Builder<V, P, B>> {
133+
B newBuilder(V value);
134+
}
135+
145136
interface Marshaller<V, P extends Value<V>, B extends Builder<V, P, B>> {
146137

147138
B fromProto(DatastoreV1.Value proto);
@@ -314,9 +305,9 @@ public boolean equals(Object obj) {
314305
}
315306

316307
@Override
317-
@SuppressWarnings({"unchecked", "rawtypes"})
308+
@SuppressWarnings("unchecked")
318309
protected DatastoreV1.Value toPb() {
319-
return type().getMarshaller().toProto((Value) this);
310+
return type().getMarshaller().toProto(this);
320311
}
321312

322313
static Value<?> fromPb(DatastoreV1.Value proto) {

0 commit comments

Comments
 (0)