Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs and code cleanup #529

Merged
merged 1 commit into from
Jan 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ public enum Type {
/**
* Base builder for tables.
*
* @param <T> the table type.
* @param <B> the table builder.
* @param <T> the table type
* @param <B> the table builder
*/
public abstract static class Builder<T extends BaseTableInfo, B extends Builder<T, B>> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,31 +500,31 @@ public static QueryResultsOption maxWaitTime(long maxWaitTime) {
/**
* Deletes the requested dataset.
*
* @return {@code true} if dataset was deleted, {@code false} if it was not found.
* @return {@code true} if dataset was deleted, {@code false} if it was not found
* @throws BigQueryException upon failure
*/
boolean delete(String datasetId, DatasetDeleteOption... options) throws BigQueryException;

/**
* Deletes the requested dataset.
*
* @return {@code true} if dataset was deleted, {@code false} if it was not found.
* @return {@code true} if dataset was deleted, {@code false} if it was not found
* @throws BigQueryException upon failure
*/
boolean delete(DatasetId datasetId, DatasetDeleteOption... options) throws BigQueryException;

/**
* Deletes the requested table.
*
* @return {@code true} if table was deleted, {@code false} if it was not found.
* @return {@code true} if table was deleted, {@code false} if it was not found
* @throws BigQueryException upon failure
*/
boolean delete(String datasetId, String tableId) throws BigQueryException;

/**
* Deletes the requested table.
*
* @return {@code true} if table was deleted, {@code false} if it was not found.
* @return {@code true} if table was deleted, {@code false} if it was not found
* @throws BigQueryException upon failure
*/
boolean delete(TableId tableId) throws BigQueryException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public Dataset update(DatasetInfo datasetInfo, BigQuery.DatasetOption... options
/**
* Deletes this dataset.
*
* @return {@code true} if dataset was deleted, {@code false} if it was not found.
* @return {@code true} if dataset was deleted, {@code false} if it was not found
* @throws BigQueryException upon failure
*/
public boolean delete() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
* @see <a href="https://cloud.google.com/bigquery/docs/reference/v2/jobs">Jobs</a>
*
* @param <S> the statistics type.
* @param <S> the statistics type
*/
public abstract class JobInfo<S extends JobStatistics> implements Serializable {

Expand Down Expand Up @@ -92,9 +92,9 @@ public enum WriteDisposition {
/**
* Base builder for jobs.
*
* @param <T> the job type.
* @param <S> the job statistics type.
* @param <B> the job builder.
* @param <T> the job type
* @param <S> the job statistics type
* @param <B> the job builder
*/
public abstract static class Builder<T extends JobInfo, S extends JobStatistics,
B extends Builder<T, S, B>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public BigQueryOptions options() {
*
* @param bigquery the BigQuery service to be used to issue the delete request
* @param dataset the dataset to be deleted
* @return {@code true} if deletion succeeded, {@code false} if the dataset was not found.
* @return {@code true} if deletion succeeded, {@code false} if the dataset was not found
* @throws BigQueryException upon failure
*/
public static boolean forceDelete(BigQuery bigquery, String dataset) {
Expand All @@ -80,7 +80,7 @@ public static String generateDatasetName() {
*
* @param projectId id of the project to be used for running the tests
* @param keyStream input stream for a JSON key
* @return A {@code RemoteBigQueryHelper} object for the provided options.
* @return A {@code RemoteBigQueryHelper} object for the provided options
* @throws BigQueryHelperException if {@code keyStream} is not a valid JSON key stream
*/
public static RemoteBigQueryHelper create(String projectId, InputStream keyStream)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

package com.google.gcloud.bigquery;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

Expand Down Expand Up @@ -302,8 +302,8 @@ public void testCreateExternalTable() throws InterruptedException {
assertEquals(createdTableInfo.tableId(), remoteTableInfo.tableId());
assertEquals(TABLE_SCHEMA, remoteTableInfo.schema());
QueryRequest request = QueryRequest.builder(
"SELECT TimestampField, StringField, IntegerField, BooleanField FROM " + DATASET + "." +
tableName)
"SELECT TimestampField, StringField, IntegerField, BooleanField FROM " + DATASET + "."
+ tableName)
.defaultDataset(DatasetId.of(DATASET))
.maxWaitTime(60000L)
.maxResults(1000L)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ public static AuthCredentials createForAppEngine() {
* variable GOOGLE_APPLICATION_CREDENTIALS.
* </p>
*
* @return the credentials instance.
* @throws IOException if the credentials cannot be created in the current environment.
* @return the credentials instance
* @throws IOException if the credentials cannot be created in the current environment
*/
public static AuthCredentials createApplicationDefaults() throws IOException {
return new ApplicationDefaultAuthCredentials();
Expand All @@ -275,7 +275,7 @@ public static AuthCredentials createApplicationDefaults() throws IOException {
*
* @param account id of the Service Account
* @param privateKey private key associated to the account
* @return the credentials instance.
* @return the credentials instance
*/
public static ServiceAccountAuthCredentials createFor(String account, PrivateKey privateKey) {
return new ServiceAccountAuthCredentials(account, privateKey);
Expand All @@ -290,8 +290,8 @@ public static ServiceAccountAuthCredentials createFor(String account, PrivateKey
* </p>
*
* @param jsonCredentialStream stream for Service Account Credentials in JSON format
* @return the credentials instance.
* @throws IOException if the credentials cannot be created from the stream.
* @return the credentials instance
* @throws IOException if the credentials cannot be created from the stream
*/
public static ServiceAccountAuthCredentials createForJson(InputStream jsonCredentialStream)
throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* Base class for service objects.
*
* @param <OptionsT> the {@code ServiceOptions} subclass corresponding to the service.
* @param <OptionsT> the {@code ServiceOptions} subclass corresponding to the service
*/
public abstract class BaseService<OptionsT extends ServiceOptions<?, ?, OptionsT>>
implements Service<OptionsT> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ enum RetryResult {
* This method is called after the evaluation and could alter its result.
*
* @param exception the exception that is being evaluated
* @param retryResult the result of the evaluation so far.
* @param retryResult the result of the evaluation so far
* @return {@link RetryResult} to indicate if the exception should be ignored (
* {@link RetryResult#RETRY}), propagated ({@link RetryResult#NO_RETRY}), or evaluation
* should proceed ({@link RetryResult#CONTINUE_EVALUATION}).
Expand Down Expand Up @@ -250,7 +250,7 @@ boolean shouldRetry(Exception ex) {
Interceptor.RetryResult retryResult =
retryInfo == null ? Interceptor.RetryResult.NO_RETRY : retryInfo.retry;
for (Interceptor interceptor : interceptors) {
Interceptor.RetryResult interceptorRetry =
Interceptor.RetryResult interceptorRetry =
checkNotNull(interceptor.afterEval(ex, retryResult));
if (interceptorRetry != Interceptor.RetryResult.CONTINUE_EVALUATION) {
retryResult = interceptorRetry;
Expand Down
2 changes: 1 addition & 1 deletion gcloud-java-core/src/main/java/com/google/gcloud/Page.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* page = page.nextPage();
* }}</pre>
*
* @param <T> the value type that the page holds.
* @param <T> the value type that the page holds
*/
public interface Page<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/**
* Base implementation for Google Cloud paginated results.
*
* @param <T> the value type that the page holds.
* @param <T> the value type that the page holds
*/
public class PageImpl<T> implements Page<T>, Serializable {

Expand All @@ -39,7 +39,7 @@ public class PageImpl<T> implements Page<T>, Serializable {
/**
* Interface for fetching the next page of results from the service.
*
* @param <T> the value type that the page holds.
* @param <T> the value type that the page holds
*/
public interface NextPageFetcher<T> extends Serializable {
Page<T> nextPage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* ...
* }</pre>
*
* @param <T> the restorable object's type.
* @param <T> the restorable object's type
*/
public interface Restorable<T extends Restorable<T>> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* Implementations of this class must implement {@link java.io.Serializable} to ensure that the
* state of a the object can be correctly serialized.
*
* @param <T> the restored object's type.
* @param <T> the restored object's type
*/
public interface RestorableState<T extends Restorable<T>> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* Interface for service objects.
*
* @param <OptionsT> the {@code ServiceOptions} subclass corresponding to the service.
* @param <OptionsT> the {@code ServiceOptions} subclass corresponding to the service
*/
public interface Service<OptionsT extends ServiceOptions<?, ?, OptionsT>> {
OptionsT options();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* <p>Implementation must provide a public no-arg constructor.
* Loading of a factory implementation is done via {@link java.util.ServiceLoader}.
*
* @param <ServiceT> the service subclass.
* @param <ServiceOptionsT> the {@code ServiceOptions} subclass corresponding to the service.
* @param <ServiceT> the service subclass
* @param <ServiceOptionsT> the {@code ServiceOptions} subclass corresponding to the service
*/
@SuppressWarnings("rawtypes")
public interface ServiceFactory<ServiceT extends Service, ServiceOptionsT extends ServiceOptions> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
/**
* Abstract class representing service options.
*
* @param <ServiceT> the service subclass.
* @param <ServiceRpcT> the spi-layer class corresponding to the service.
* @param <OptionsT> the {@code ServiceOptions} subclass corresponding to the service.
* @param <ServiceT> the service subclass
* @param <ServiceRpcT> the spi-layer class corresponding to the service
* @param <OptionsT> the {@code ServiceOptions} subclass corresponding to the service
*/
public abstract class ServiceOptions<ServiceT extends Service<OptionsT>, ServiceRpcT,
OptionsT extends ServiceOptions<ServiceT, ServiceRpcT, OptionsT>> implements Serializable {
Expand Down Expand Up @@ -160,10 +160,10 @@ private Object readResolve() throws ObjectStreamException {
/**
* Builder for {@code ServiceOptions}.
*
* @param <ServiceT> the service subclass.
* @param <ServiceRpcT> the spi-layer class corresponding to the service.
* @param <OptionsT> the {@code ServiceOptions} subclass corresponding to the service.
* @param <B> the {@code ServiceOptions} builder.
* @param <ServiceT> the service subclass
* @param <ServiceRpcT> the spi-layer class corresponding to the service
* @param <OptionsT> the {@code ServiceOptions} subclass corresponding to the service
* @param <B> the {@code ServiceOptions} builder
*/
protected abstract static class Builder<ServiceT extends Service<OptionsT>, ServiceRpcT,
OptionsT extends ServiceOptions<ServiceT, ServiceRpcT, OptionsT>,
Expand Down Expand Up @@ -215,7 +215,7 @@ public B serviceFactory(ServiceFactory<ServiceT, OptionsT> serviceFactory) {
* replaced by Java8's {@code java.time.Clock}.
*
* @param clock the clock to set
* @return the builder.
* @return the builder
*/
public B clock(Clock clock) {
this.clock = clock;
Expand All @@ -225,7 +225,7 @@ public B clock(Clock clock) {
/**
* Sets project id.
*
* @return the builder.
* @return the builder
*/
public B projectId(String projectId) {
this.projectId = projectId;
Expand All @@ -235,7 +235,7 @@ public B projectId(String projectId) {
/**
* Sets service host.
*
* @return the builder.
* @return the builder
*/
public B host(String host) {
this.host = host;
Expand All @@ -245,7 +245,7 @@ public B host(String host) {
/**
* Sets the transport factory.
*
* @return the builder.
* @return the builder
*/
public B httpTransportFactory(HttpTransportFactory httpTransportFactory) {
this.httpTransportFactory = httpTransportFactory;
Expand All @@ -255,7 +255,7 @@ public B httpTransportFactory(HttpTransportFactory httpTransportFactory) {
/**
* Sets the service authentication credentials.
*
* @return the builder.
* @return the builder
*/
public B authCredentials(AuthCredentials authCredentials) {
this.authCredentials = authCredentials;
Expand All @@ -266,7 +266,7 @@ public B authCredentials(AuthCredentials authCredentials) {
* Sets configuration parameters for request retries. If no configuration is set
* {@link RetryParams#noRetries()} is used.
*
* @return the builder.
* @return the builder
*/
public B retryParams(RetryParams retryParams) {
this.retryParams = retryParams;
Expand All @@ -288,7 +288,7 @@ public B serviceRpcFactory(ServiceRpcFactory<ServiceRpcT, OptionsT> serviceRpcFa
*
* @param connectTimeout connection timeout in milliseconds. 0 for an infinite timeout, a
* negative number for the default value (20000).
* @return the builder.
* @return the builder
*/
public B connectTimeout(int connectTimeout) {
this.connectTimeout = connectTimeout;
Expand All @@ -300,7 +300,7 @@ public B connectTimeout(int connectTimeout) {
*
* @param readTimeout read timeout in milliseconds. 0 for an infinite timeout, a negative number
* for the default value (20000).
* @return the builder.
* @return the builder
*/
public B readTimeout(int readTimeout) {
this.readTimeout = readTimeout;
Expand Down Expand Up @@ -341,7 +341,7 @@ protected ServiceOptions(Class<? extends ServiceFactory<ServiceT, OptionsT>> ser
* Returns whether a service requires a project ID. This method may be overridden in
* service-specific Options objects.
*
* @return true if a project ID is required to use the service, false if not.
* @return true if a project ID is required to use the service, false if not
*/
protected boolean projectIdRequired() {
return true;
Expand Down
Loading