Skip to content

Commit 92375ed

Browse files
committed
---
yaml --- r: 9 b: refs/heads/master c: 68d808a h: refs/heads/master i: 7: 5a317e2 v: v3
1 parent 837a257 commit 92375ed

10 files changed

Lines changed: 143 additions & 214 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: 468d80ae3cf199683c64ae16053f890178c8c1bf
2+
refs/heads/master: 68d808ac1cd8a032cf28adf2077df92d87e1cd12

trunk/.classpath

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,26 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
4-
<attributes>
5-
<attribute name="maven.pomderived" value="true"/>
6-
</attributes>
7-
</classpathentry>
83
<classpathentry kind="src" output="target/classes" path="src/main/java">
94
<attributes>
105
<attribute name="optional" value="true"/>
116
<attribute name="maven.pomderived" value="true"/>
127
</attributes>
138
</classpathentry>
14-
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
15-
<attributes>
16-
<attribute name="maven.pomderived" value="true"/>
17-
</attributes>
18-
</classpathentry>
199
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
2010
<attributes>
2111
<attribute name="optional" value="true"/>
2212
<attribute name="maven.pomderived" value="true"/>
2313
</attributes>
2414
</classpathentry>
25-
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
26-
<attributes>
27-
<attribute name="maven.pomderived" value="true"/>
28-
</attributes>
29-
</classpathentry>
3015
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
3116
<attributes>
3217
<attribute name="maven.pomderived" value="true"/>
3318
</attributes>
19+
<accessrules>
20+
<accessrule kind="nonaccessible" pattern="**/repackaged/**"/>
21+
</accessrules>
3422
</classpathentry>
23+
<classpathentry kind="var" path="ECLIPSE_HOME"/>
24+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
3525
<classpathentry kind="output" path="target/classes"/>
3626
</classpath>

trunk/.project

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
</arguments>
1212
</buildCommand>
1313
<buildCommand>
14-
<name>org.eclipse.m2e.core.maven2Builder</name>
14+
<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
1515
<arguments>
1616
</arguments>
1717
</buildCommand>
1818
<buildCommand>
19-
<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
19+
<name>org.eclipse.m2e.core.maven2Builder</name>
2020
<arguments>
2121
</arguments>
2222
</buildCommand>

trunk/.settings/de.loskutov.anyedit.AnyEditTools.prefs

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,95 @@
11
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
3+
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
4+
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
5+
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
6+
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
7+
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
28
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
39
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
410
org.eclipse.jdt.core.compiler.compliance=1.7
11+
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
512
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
13+
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
14+
org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
15+
org.eclipse.jdt.core.compiler.problem.deadCode=warning
16+
org.eclipse.jdt.core.compiler.problem.deprecation=warning
17+
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
18+
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
19+
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
20+
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
621
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
22+
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
23+
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
24+
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
25+
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
26+
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
27+
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
28+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
29+
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
30+
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
31+
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
32+
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
33+
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
34+
org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
35+
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
36+
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
37+
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
38+
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
39+
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
40+
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
41+
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
42+
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
43+
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
44+
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
45+
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
46+
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
47+
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
48+
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
49+
org.eclipse.jdt.core.compiler.problem.nullReference=warning
50+
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
51+
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
52+
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
53+
org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
54+
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
55+
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
56+
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
57+
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
58+
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
59+
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
60+
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
61+
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
62+
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
63+
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
64+
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
65+
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
66+
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
67+
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
68+
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
69+
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
70+
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
71+
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
72+
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
73+
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
74+
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
75+
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
76+
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
77+
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
78+
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
79+
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
80+
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
81+
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
82+
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
83+
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
84+
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
85+
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
86+
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
87+
org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
88+
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
89+
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
90+
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
91+
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
92+
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
93+
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
94+
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
795
org.eclipse.jdt.core.compiler.source=1.7

trunk/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,10 @@
1414
<artifactId>google-oauth-client</artifactId>
1515
<version>1.18.0-rc</version>
1616
</dependency>
17+
<dependency>
18+
<groupId>com.google.guava</groupId>
19+
<artifactId>guava</artifactId>
20+
<version>RELEASE</version>
21+
</dependency>
1722
</dependencies>
1823
</project>
Lines changed: 18 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,50 @@
11
package com.google.gcloud;
22

3-
import java.util.Arrays;
4-
import java.util.List;
5-
63
import com.google.api.client.auth.oauth2.Credential;
7-
import com.google.api.client.http.HttpRequestInitializer;
8-
import com.google.api.client.http.HttpTransport;
4+
import com.google.common.base.MoreObjects;
95

10-
public class ServiceOptions {
6+
public abstract class ServiceOptions {
117

12-
private final String host;
138
private static final String DEFAULT_HOST = "https://www.googleapis.com";
14-
private final HttpRequestInitializer initializer;
15-
private final Credential credential;
16-
private final HttpTransport transport;
179

18-
public static final List<String> SCOPES = Arrays.asList(
19-
"https://www.googleapis.com/auth/datastore",
20-
"https://www.googleapis.com/auth/userinfo.email");
10+
private final String host;
11+
private final Credential credential;
2112

22-
ServiceOptions(Builder b) {
23-
this.dataset = b.dataset;
24-
this.host = b.host != null ? b.host : DEFAULT_HOST;
25-
this.initializer = b.initializer;
26-
this.credential = b.credential;
27-
this.transport = b.transport;
13+
protected ServiceOptions(Builder builder) {
14+
host = MoreObjects.firstNonNull(builder.host, DEFAULT_HOST);
15+
credential = builder.credential;
2816
}
2917

30-
/**
31-
* Builder for {@link ServiceOptions}.
32-
*/
33-
protected static class Builder {
34-
private String dataset;
18+
protected abstract static class Builder {
19+
3520
private String host;
36-
private HttpRequestInitializer initializer;
3721
private Credential credential;
38-
private HttpTransport transport;
3922

40-
public Builder() { }
23+
public Builder() {}
4124

4225
public Builder(ServiceOptions options) {
43-
this.dataset = options.dataset;
44-
this.host = options.host;
45-
this.initializer = options.initializer;
46-
this.credential = options.credential;
47-
this.transport = options.transport;
26+
host = options.host;
27+
credential = options.credential;
4828
}
4929

50-
public ServiceOptions build() {
51-
return new ServiceOptions(this);
52-
}
53-
54-
/**
55-
* Sets the dataset used to access the datastore.
56-
*/
57-
public Builder dataset(String newDataset) {
58-
dataset = newDataset;
59-
return this;
60-
}
30+
protected abstract ServiceOptions build();
6131

62-
/**
63-
* Sets the host used to access the datastore.
64-
*/
65-
public Builder host(String newHost) {
66-
host = newHost;
32+
public Builder setHost(String host) {
33+
this.host = host;
6734
return this;
6835
}
6936

70-
/**
71-
* Sets the (optional) initializer to run on HTTP requests to the API.
72-
*/
73-
public Builder initializer(HttpRequestInitializer newInitializer) {
74-
initializer = newInitializer;
75-
return this;
76-
}
77-
78-
/**
79-
* Sets the Google APIs credentials used to access the API.
80-
*/
81-
public Builder credential(Credential newCredential) {
82-
credential = newCredential;
83-
return this;
84-
}
85-
86-
/**
87-
* Sets the transport used to access the API.
88-
*/
89-
public Builder transport(HttpTransport transport) {
90-
this.transport = transport;
37+
public Builder setCredential(Credential credential) {
38+
this.credential = credential;
9139
return this;
9240
}
9341
}
9442

95-
// === getters ===
96-
97-
public String getDataset() {
98-
return dataset;
99-
}
100-
10143
public String getHost() {
10244
return host;
10345
}
10446

105-
public HttpRequestInitializer getInitializer() {
106-
return initializer;
107-
}
108-
10947
public Credential getCredential() {
11048
return credential;
11149
}
112-
113-
public HttpTransport getTransport() {
114-
return transport;
115-
}
116-
}
50+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
public interface DatastoreService {
44

5-
String get(String key)
5+
String get(String key);
66

77
}
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package com.google.gcloud.datastore;
22

33

4-
public interface DatastoreServiceFactory {
4+
public class DatastoreServiceFactory {
55

6-
DatastoreService getDatastoreService(DatastoreServiceOptions options);
6+
public DatastoreService getDatastoreService(DatastoreServiceOptions options) {
7+
return new DatastoreServiceImpl(options);
8+
}
79
}

0 commit comments

Comments
 (0)