diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java index c1d0fcb410d2..f769367b3dba 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java @@ -80,10 +80,6 @@ public enum Type { this.type = type; } - @Deprecated - public Type type() { - return getType(); - } public Type getType() { return type; @@ -131,13 +127,6 @@ public Domain(String domain) { this.domain = domain; } - /** - * Returns the domain name. - */ - @Deprecated - public String domain() { - return getDomain(); - } /** * Returns the domain name. @@ -201,15 +190,6 @@ public Group(String identifier) { this.identifier = identifier; } - /** - * Returns group's identifier, can be either a - * - * special group identifier or a group email. - */ - @Deprecated - public String identifier() { - return getIdentifier(); - } /** * Returns group's identifier, can be either a @@ -306,13 +286,6 @@ public User(String email) { this.email = email; } - /** - * Returns user's email. - */ - @Deprecated - public String email() { - return getEmail(); - } /** * Returns user's email. @@ -369,13 +342,6 @@ public View(TableId id) { this.id = id; } - /** - * Returns table's identity. - */ - @Deprecated - public TableId id() { - return getId(); - } /** * Returns table's identity. @@ -417,13 +383,6 @@ private Acl(Entity entity, Role role) { this.role = role; } - /** - * Returns the entity for this ACL. - */ - @Deprecated - public Entity entity() { - return getEntity(); - } /** * Returns the entity for this ACL. @@ -432,13 +391,6 @@ public Entity getEntity() { return entity; } - /** - * Returns the role specified by this ACL. - */ - @Deprecated - public Role role() { - return getRole(); - } /** * Returns the role specified by this ACL. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java index b58f27e1d81c..824055bc0103 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java @@ -64,11 +64,6 @@ enum DatasetField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } @Override public String getSelector() { @@ -111,11 +106,6 @@ enum TableField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } @Override public String getSelector() { @@ -148,11 +138,6 @@ enum JobField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } @Override public String getSelector() { @@ -207,7 +192,7 @@ private DatasetOption(BigQueryRpc.Option option, Object value) { /** * Returns an option to specify the dataset's fields to be returned by the RPC call. If this * option is not provided all dataset's fields are returned. {@code DatasetOption.fields} can - * be used to specify only the fields of interest. {@link Dataset#datasetId()} is always + * be used to specify only the fields of interest. {@link Dataset#getDatasetId()} is always * returned, even if not specified. */ public static DatasetOption fields(DatasetField... fields) { @@ -277,8 +262,8 @@ private TableOption(BigQueryRpc.Option option, Object value) { /** * Returns an option to specify the table's fields to be returned by the RPC call. If this * option is not provided all table's fields are returned. {@code TableOption.fields} can be - * used to specify only the fields of interest. {@link Table#tableId()} and type (which is part - * of {@link Table#definition()}) are always returned, even if not specified. + * used to specify only the fields of interest. {@link Table#getTableId()} and type (which is part + * of {@link Table#getDefinition()}) are always returned, even if not specified. */ public static TableOption fields(TableField... fields) { return new TableOption(BigQueryRpc.Option.FIELDS, @@ -372,9 +357,9 @@ public static JobListOption pageToken(String pageToken) { /** * Returns an option to specify the job's fields to be returned by the RPC call. If this option * is not provided all job's fields are returned. {@code JobOption.fields()} can be used to - * specify only the fields of interest. {@link Job#jobId()}, {@link JobStatus#state()}, - * {@link JobStatus#error()} as well as type-specific configuration (e.g. - * {@link QueryJobConfiguration#query()} for Query Jobs) are always returned, even if not + * specify only the fields of interest. {@link Job#getJobId()}, {@link JobStatus#getState()}, + * {@link JobStatus#getError()} as well as type-specific configuration (e.g. + * {@link QueryJobConfiguration#getQuery()} for Query Jobs) are always returned, even if not * specified. {@link JobField#SELF_LINK} and {@link JobField#ETAG} can not be selected when * listing jobs. */ @@ -398,8 +383,8 @@ private JobOption(BigQueryRpc.Option option, Object value) { /** * Returns an option to specify the job's fields to be returned by the RPC call. If this option * is not provided all job's fields are returned. {@code JobOption.fields()} can be used to - * specify only the fields of interest. {@link Job#jobId()} as well as type-specific - * configuration (e.g. {@link QueryJobConfiguration#query()} for Query Jobs) are always + * specify only the fields of interest. {@link Job#getJobId()} as well as type-specific + * configuration (e.g. {@link QueryJobConfiguration#getQuery()} for Query Jobs) are always * returned, even if not specified. */ public static JobOption fields(JobField... fields) { @@ -468,7 +453,7 @@ public static QueryResultsOption maxWaitTime(long maxWaitTime) { * } catch (BigQueryException e) { * // the dataset was not created * } - * } + * } * * @throws BigQueryException upon failure */ @@ -546,8 +531,8 @@ public static QueryResultsOption maxWaitTime(long maxWaitTime) { /** * Lists the project's datasets. This method returns partial information on each dataset: - * ({@link Dataset#datasetId()}, {@link Dataset#friendlyName()} and - * {@link Dataset#generatedId()}). To get complete information use either + * ({@link Dataset#getDatasetId()}, {@link Dataset#getFriendlyName()} and + * {@link Dataset#getGeneratedId()}). To get complete information use either * {@link #getDataset(String, DatasetOption...)} or * {@link #getDataset(DatasetId, DatasetOption...)}. * @@ -567,8 +552,8 @@ public static QueryResultsOption maxWaitTime(long maxWaitTime) { /** * Lists the datasets in the provided project. This method returns partial information on each - * dataset: ({@link Dataset#datasetId()}, {@link Dataset#friendlyName()} and - * {@link Dataset#generatedId()}). To get complete information use either + * dataset: ({@link Dataset#getDatasetId()}, {@link Dataset#getFriendlyName()} and + * {@link Dataset#getGeneratedId()}). To get complete information use either * {@link #getDataset(String, DatasetOption...)} or * {@link #getDataset(DatasetId, DatasetOption...)}. * @@ -734,8 +719,8 @@ public static QueryResultsOption maxWaitTime(long maxWaitTime) { /** * Lists the tables in the dataset. This method returns partial information on each table: - * ({@link Table#tableId()}, {@link Table#friendlyName()}, {@link Table#generatedId()} and type, - * which is part of {@link Table#definition()}). To get complete information use either + * ({@link Table#getTableId()}, {@link Table#getFriendlyName()}, {@link Table#getGeneratedId()} and type, + * which is part of {@link Table#getDefinition()}). To get complete information use either * {@link #getTable(TableId, TableOption...)} or * {@link #getTable(String, String, TableOption...)}. * @@ -756,8 +741,8 @@ public static QueryResultsOption maxWaitTime(long maxWaitTime) { /** * Lists the tables in the dataset. This method returns partial information on each table: - * ({@link Table#tableId()}, {@link Table#friendlyName()}, {@link Table#generatedId()} and type, - * which is part of {@link Table#definition()}). To get complete information use either + * ({@link Table#getTableId()}, {@link Table#getFriendlyName()}, {@link Table#getGeneratedId()} + * and type, which is part of {@link Table#getDefinition()}). To get complete information use either * {@link #getTable(TableId, TableOption...)} or * {@link #getTable(String, String, TableOption...)}. * diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryError.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryError.java index 17a5913425ba..25f4e18492ec 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryError.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryError.java @@ -26,12 +26,12 @@ /** * Google Cloud BigQuery Error. Objects of this class represent errors encountered by the BigQuery * service while executing a request. A BigQuery Job that terminated with an error has a non-null - * {@link JobStatus#error()}. A job can also encounter errors during its execution that do not cause - * the whole job to fail (see {@link JobStatus#executionErrors()}). Similarly, queries and insert - * all requests can cause BigQuery errors that do not mean the whole operation failed (see - * {@link QueryResponse#executionErrors()} and {@link InsertAllResponse#insertErrors()}). When a - * {@link BigQueryException} is thrown the BigQuery Error that caused it, if any, can be accessed - * with {@link BigQueryException#error()}. + * {@link JobStatus#getError()}. A job can also encounter errors during its execution that do not + * cause the whole job to fail (see {@link JobStatus#getExecutionErrors()}). Similarly, queries and + * insert all requests can cause BigQuery errors that do not mean the whole operation failed (see + * {@link QueryResponse#getExecutionErrors()} and {@link InsertAllResponse#getInsertErrors()}). + * When a {@link BigQueryException} is thrown the BigQuery Error that caused it, if any, can be + * accessed with {@link BigQueryException#getError()}. */ public final class BigQueryError implements Serializable { @@ -70,16 +70,6 @@ public BigQueryError(String reason, String location, String message) { this.debugInfo = null; } - /** - * Returns short error code that summarizes the error. - * - * @see Troubleshooting - * Errors - */ - @Deprecated - public String reason() { - return getReason(); - } /** * Returns short error code that summarizes the error. @@ -91,13 +81,6 @@ public String getReason() { return reason; } - /** - * Returns where the error occurred, if present. - */ - @Deprecated - public String location() { - return getLocation(); - } /** * Returns where the error occurred, if present. @@ -110,13 +93,6 @@ String getDebugInfo() { return debugInfo; } - /** - * Returns a human-readable description of the error. - */ - @Deprecated - public String message() { - return getMessage(); - } /** * Returns a human-readable description of the error. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java index c2ca9fa43d73..ffae57621909 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java @@ -66,14 +66,6 @@ public BigQueryException(IOException exception) { this.error = error; } - /** - * Returns the {@link BigQueryError} that caused this exception. Returns {@code null} if none - * exists. - */ - @Deprecated - public BigQueryError error() { - return getError(); - } /** * Returns the {@link BigQueryError} that caused this exception. Returns {@code null} if none diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 238db6c79fb2..101f84e0dbe3 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -58,11 +58,6 @@ private static class DatasetPageFetcher implements NextPageFetcher { this.serviceOptions = serviceOptions; } - @Override - @Deprecated - public Page nextPage() { - return getNextPage(); - } @Override public Page getNextPage() { @@ -85,11 +80,6 @@ private static class TablePageFetcher implements NextPageFetcher { this.datasetId = datasetId; } - @Override - @Deprecated - public Page
nextPage() { - return getNextPage(); - } @Override public Page
getNextPage() { @@ -110,11 +100,6 @@ private static class JobPageFetcher implements NextPageFetcher { this.serviceOptions = serviceOptions; } - @Override - @Deprecated - public Page nextPage() { - return getNextPage(); - } @Override public Page getNextPage() { @@ -137,11 +122,6 @@ private static class TableDataPageFetcher implements NextPageFetcher> nextPage() { - return getNextPage(); - } @Override public Page> getNextPage() { @@ -165,11 +145,6 @@ private static class QueryResultsPageFetcherImpl this.job = job; } - @Override - @Deprecated - public QueryResult nextPage() { - return getNextPage(); - } @Override public QueryResult getNextPage() { diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java index 2f8c8844b57b..ac3f784e2c98 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java @@ -105,19 +105,11 @@ public boolean equals(Object obj) { return baseEquals(other); } - @Deprecated - public static BigQueryOptions defaultInstance() { - return getDefaultInstance(); - } public static BigQueryOptions getDefaultInstance() { return newBuilder().build(); } - @Deprecated - public static Builder builder() { - return newBuilder(); - } public static Builder newBuilder() { return new Builder(); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java index ce6cf2011bed..680a87e33ed9 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java @@ -80,13 +80,6 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur } } - /** - * Sets the source tables to copy. - */ - @Deprecated - public Builder sourceTables(List sourceTables) { - return setSourceTables(sourceTables); - } /** * Sets the source tables to copy. @@ -96,13 +89,6 @@ public Builder setSourceTables(List sourceTables) { return this; } - /** - * Sets the destination table of the copy job. - */ - @Deprecated - public Builder destinationTable(TableId destinationTable) { - return setDestinationTable(destinationTable); - } /** * Sets the destination table of the copy job. @@ -112,16 +98,6 @@ public Builder setDestinationTable(TableId destinationTable) { return this; } - /** - * Sets whether the job is allowed to create new tables. - * - * @see - * Create Disposition - */ - @Deprecated - public Builder createDisposition(JobInfo.CreateDisposition createDisposition) { - return setCreateDisposition(createDisposition); - } /** * Sets whether the job is allowed to create new tables. @@ -134,16 +110,6 @@ public Builder setCreateDisposition(JobInfo.CreateDisposition createDisposition) return this; } - /** - * Sets the action that should occur if the destination table already exists. - * - * @see - * Write Disposition - */ - @Deprecated - public Builder writeDisposition(JobInfo.WriteDisposition writeDisposition) { - return setWriteDisposition(writeDisposition); - } /** * Sets the action that should occur if the destination table already exists. @@ -169,13 +135,6 @@ private CopyJobConfiguration(Builder builder) { this.writeDisposition = builder.writeDisposition; } - /** - * Returns the source tables to copy. - */ - @Deprecated - public List sourceTables() { - return getSourceTables(); - } /** * Returns the source tables to copy. @@ -184,13 +143,6 @@ public List getSourceTables() { return sourceTables; } - /** - * Returns the destination table to load the data into. - */ - @Deprecated - public TableId destinationTable() { - return getDestinationTable(); - } /** * Returns the destination table to load the data into. @@ -199,16 +151,6 @@ public TableId getDestinationTable() { return destinationTable; } - /** - * Returns whether the job is allowed to create new tables. - * - * @see - * Create Disposition - */ - @Deprecated - public JobInfo.CreateDisposition createDisposition() { - return this.getCreateDisposition(); - } /** * Returns whether the job is allowed to create new tables. @@ -220,16 +162,6 @@ public JobInfo.CreateDisposition getCreateDisposition() { return this.createDisposition; } - /** - * Returns the action that should occur if the destination table already exists. - * - * @see - * Write Disposition - */ - @Deprecated - public JobInfo.WriteDisposition writeDisposition() { - return getWriteDisposition(); - } /** * Returns the action that should occur if the destination table already exists. @@ -300,13 +232,6 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { return new com.google.api.services.bigquery.model.JobConfiguration().setCopy(configurationPb); } - /** - * Creates a builder for a BigQuery Copy Job configuration given destination and source table. - */ - @Deprecated - public static Builder builder(TableId destinationTable, TableId sourceTable) { - return newBuilder(destinationTable, sourceTable); - } /** * Creates a builder for a BigQuery Copy Job configuration given destination and source table. @@ -315,13 +240,6 @@ public static Builder newBuilder(TableId destinationTable, TableId sourceTable) return newBuilder(destinationTable, ImmutableList.of(checkNotNull(sourceTable))); } - /** - * Creates a builder for a BigQuery Copy Job configuration given destination and source tables. - */ - @Deprecated - public static Builder builder(TableId destinationTable, List sourceTables) { - return newBuilder(destinationTable, sourceTables); - } /** * Creates a builder for a BigQuery Copy Job configuration given destination and source tables. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CsvOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CsvOptions.java index 8cb56d61549f..ed3e8247aa9b 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CsvOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CsvOptions.java @@ -56,17 +56,6 @@ private Builder(CsvOptions csvOptions) { this.skipLeadingRows = csvOptions.skipLeadingRows; } - /** - * Set whether BigQuery should accept rows that are missing trailing optional columns. If - * {@code true}, BigQuery treats missing trailing columns as null values. If {@code false}, - * records with missing trailing columns are treated as bad records, and if there are too many - * bad records, an invalid error is returned in the job result. By default, rows with missing - * trailing columns are considered bad records. - */ - @Deprecated - public Builder allowJaggedRows(boolean allowJaggedRows) { - return setAllowJaggedRows(allowJaggedRows); - } /** * Set whether BigQuery should accept rows that are missing trailing optional columns. If @@ -80,14 +69,6 @@ public Builder setAllowJaggedRows(boolean allowJaggedRows) { return this; } - /** - * Sets whether BigQuery should allow quoted data sections that contain newline characters in a - * CSV file. By default quoted newline are not allowed. - */ - @Deprecated - public Builder allowQuotedNewLines(boolean allowQuotedNewLines) { - return setAllowQuotedNewLines(allowQuotedNewLines); - } /** * Sets whether BigQuery should allow quoted data sections that contain newline characters in a @@ -98,56 +79,28 @@ public Builder setAllowQuotedNewLines(boolean allowQuotedNewLines) { return this; } - /** - * Sets the character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The - * default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split - * using the values set in {@link #quote(String)} and {@link #fieldDelimiter(String)}. - */ - @Deprecated - public Builder encoding(String encoding) { - return setEncoding(encoding); - } /** * Sets the character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The * default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split - * using the values set in {@link #quote(String)} and {@link #fieldDelimiter(String)}. + * using the values set in {@link #setQuote(String)} and {@link #setFieldDelimiter(String)}. */ public Builder setEncoding(String encoding) { this.encoding = encoding; return this; } - /** - * Sets the character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The - * default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split - * using the values set in {@link #quote(String)} and {@link #fieldDelimiter(String)}. - */ - @Deprecated - public Builder encoding(Charset encoding) { - return setEncoding(encoding); - } /** * Sets the character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The * default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split - * using the values set in {@link #quote(String)} and {@link #fieldDelimiter(String)}. + * using the values set in {@link #setQuote(String)} and {@link #setFieldDelimiter(String)}. */ public Builder setEncoding(Charset encoding) { this.encoding = encoding.name(); return this; } - /** - * Sets the separator for fields in a CSV file. BigQuery converts the string to ISO-8859-1 - * encoding, and then uses the first byte of the encoded string to split the data in its raw, - * binary state. BigQuery also supports the escape sequence "\t" to specify a tab separator. - * The default value is a comma (','). - */ - @Deprecated - public Builder fieldDelimiter(String fieldDelimiter) { - return setFieldDelimiter(fieldDelimiter); - } /** * Sets the separator for fields in a CSV file. BigQuery converts the string to ISO-8859-1 @@ -160,41 +113,20 @@ public Builder setFieldDelimiter(String fieldDelimiter) { return this; } - /** - * Sets the value that is used to quote data sections in a CSV file. BigQuery converts the - * string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split - * the data in its raw, binary state. The default value is a double-quote ('"'). If your data - * does not contain quoted sections, set the property value to an empty string. If your data - * contains quoted newline characters, you must also set {@link #allowQuotedNewLines(boolean)} - * property to {@code true}. - */ - @Deprecated - public Builder quote(String quote) { - return setQuote(quote); - } /** * Sets the value that is used to quote data sections in a CSV file. BigQuery converts the * string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split * the data in its raw, binary state. The default value is a double-quote ('"'). If your data * does not contain quoted sections, set the property value to an empty string. If your data - * contains quoted newline characters, you must also set {@link #allowQuotedNewLines(boolean)} - * property to {@code true}. + * contains quoted newline characters, you must also set + * {@link #setAllowQuotedNewLines(boolean)} property to {@code true}. */ public Builder setQuote(String quote) { this.quote = quote; return this; } - /** - * Sets the number of rows at the top of a CSV file that BigQuery will skip when reading the - * data. The default value is 0. This property is useful if you have header rows in the file - * that should be skipped. - */ - @Deprecated - public Builder skipLeadingRows(long skipLeadingRows) { - return setSkipLeadingRows(skipLeadingRows); - } /** * Sets the number of rows at the top of a CSV file that BigQuery will skip when reading the @@ -228,8 +160,8 @@ private CsvOptions(Builder builder) { * Returns whether BigQuery should accept rows that are missing trailing optional columns. If * {@code true}, BigQuery treats missing trailing columns as null values. If {@code false}, * records with missing trailing columns are treated as bad records, and if the number of bad - * records exceeds {@link ExternalTableDefinition#maxBadRecords()}, an invalid error is returned - * in the job result. + * records exceeds {@link ExternalTableDefinition#getMaxBadRecords()}, an invalid error is + * returned in the job result. */ public Boolean allowJaggedRows() { return allowJaggedRows; @@ -243,15 +175,6 @@ public Boolean allowQuotedNewLines() { return allowQuotedNewLines; } - /** - * Returns the character encoding of the data. The supported values are UTF-8 or ISO-8859-1. If - * not set, UTF-8 is used. BigQuery decodes the data after the raw, binary data has been split - * using the values set in {@link #getQuote()} and {@link #getFieldDelimiter()}. - */ - @Deprecated - public String encoding() { - return getEncoding(); - } /** * Returns the character encoding of the data. The supported values are UTF-8 or ISO-8859-1. If @@ -262,13 +185,6 @@ public String getEncoding() { return encoding; } - /** - * Returns the separator for fields in a CSV file. - */ - @Deprecated - public String fieldDelimiter() { - return getFieldDelimiter(); - } /** * Returns the separator for fields in a CSV file. @@ -277,13 +193,6 @@ public String getFieldDelimiter() { return fieldDelimiter; } - /** - * Returns the value that is used to quote data sections in a CSV file. - */ - @Deprecated - public String quote() { - return getQuote(); - } /** * Returns the value that is used to quote data sections in a CSV file. @@ -292,14 +201,6 @@ public String getQuote() { return quote; } - /** - * Returns the number of rows at the top of a CSV file that BigQuery will skip when reading the - * data. - */ - @Deprecated - public Long skipLeadingRows() { - return getSkipLeadingRows(); - } /** * Returns the number of rows at the top of a CSV file that BigQuery will skip when reading the @@ -354,13 +255,6 @@ com.google.api.services.bigquery.model.CsvOptions toPb() { return csvOptions; } - /** - * Returns a builder for a CsvOptions object. - */ - @Deprecated - public static Builder builder() { - return newBuilder(); - } /** * Returns a builder for a CsvOptions object. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java index dbec7c013eaa..c1b549e41635 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java @@ -64,11 +64,6 @@ public static final class Builder extends DatasetInfo.Builder { this.infoBuilder = new DatasetInfo.BuilderImpl(dataset); } - @Override - @Deprecated - public Builder datasetId(DatasetId datasetId) { - return setDatasetId(datasetId); - } @Override public Builder setDatasetId(DatasetId datasetId) { @@ -76,11 +71,6 @@ public Builder setDatasetId(DatasetId datasetId) { return this; } - @Override - @Deprecated - public Builder acl(List acl) { - return setAcl(acl); - } @Override public Builder setAcl(List acl) { @@ -94,11 +84,6 @@ Builder setCreationTime(Long creationTime) { return this; } - @Override - @Deprecated - public Builder defaultTableLifetime(Long defaultTableLifetime) { - return setDefaultTableLifetime(defaultTableLifetime); - } @Override public Builder setDefaultTableLifetime(Long defaultTableLifetime) { @@ -106,11 +91,6 @@ public Builder setDefaultTableLifetime(Long defaultTableLifetime) { return this; } - @Override - @Deprecated - public Builder description(String description) { - return setDescription(description); - } @Override public Builder setDescription(String description) { @@ -124,11 +104,6 @@ Builder setEtag(String etag) { return this; } - @Override - @Deprecated - public Builder friendlyName(String friendlyName) { - return setFriendlyName(friendlyName); - } @Override public Builder setFriendlyName(String friendlyName) { @@ -148,11 +123,6 @@ Builder setLastModified(Long lastModified) { return this; } - @Override - @Deprecated - public Builder location(String location) { - return setLocation(location); - } @Override public Builder setLocation(String location) { @@ -322,13 +292,6 @@ public Table create(String tableId, TableDefinition definition, TableOption... o return bigquery.create(tableInfo, options); } - /** - * Returns the dataset's {@code BigQuery} object used to issue requests. - */ - @Deprecated - public BigQuery bigquery() { - return getBigquery(); - } /** * Returns the dataset's {@code BigQuery} object used to issue requests. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetId.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetId.java index 44b1d69ea3d7..b023f4b3244a 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetId.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetId.java @@ -33,13 +33,6 @@ public final class DatasetId implements Serializable { private final String project; private final String dataset; - /** - * Returns project's user-defined id. - */ - @Deprecated - public String project() { - return getProject(); - } /** * Returns project's user-defined id. @@ -48,13 +41,6 @@ public String getProject() { return project; } - /** - * Returns dataset's user-defined id. - */ - @Deprecated - public String dataset() { - return getDataset(); - } /** * Returns dataset's user-defined id. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java index 457b04e6eced..cdc7b94a1661 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java @@ -74,24 +74,12 @@ public Dataset apply(DatasetInfo datasetInfo) { */ public abstract static class Builder { - /** - * Sets the dataset identity. - */ - @Deprecated - public abstract Builder datasetId(DatasetId datasetId); /** * Sets the dataset identity. */ public abstract Builder setDatasetId(DatasetId datasetId); - /** - * Sets the dataset's access control configuration. - * - * @see Access Control - */ - @Deprecated - public abstract Builder acl(List acl); /** * Sets the dataset's access control configuration. @@ -102,19 +90,6 @@ public abstract static class Builder { abstract Builder setCreationTime(Long creationTime); - /** - * Sets the default lifetime of all tables in the dataset, in milliseconds. The minimum value is - * 3600000 milliseconds (one hour). Once this property is set, all newly-created tables in the - * dataset will have an expirationTime property set to the creation time plus the value in this - * property, and changing the value will only affect new tables, not existing ones. When the - * expirationTime for a given table is reached, that table will be deleted automatically. If a - * table's expirationTime is modified or removed before the table expires, or if you provide an - * explicit expirationTime when creating a table, that value takes precedence over the default - * expiration time indicated by this property. This property is experimental and might be - * subject to change or removed. - */ - @Deprecated - public abstract Builder defaultTableLifetime(Long defaultTableLifetime); /** * Sets the default lifetime of all tables in the dataset, in milliseconds. The minimum value is @@ -129,11 +104,6 @@ public abstract static class Builder { */ public abstract Builder setDefaultTableLifetime(Long defaultTableLifetime); - /** - * Sets a user-friendly description for the dataset. - */ - @Deprecated - public abstract Builder description(String description); /** * Sets a user-friendly description for the dataset. @@ -142,11 +112,6 @@ public abstract static class Builder { abstract Builder setEtag(String etag); - /** - * Sets a user-friendly name for the dataset. - */ - @Deprecated - public abstract Builder friendlyName(String friendlyName); /** * Sets a user-friendly name for the dataset. @@ -157,15 +122,6 @@ public abstract static class Builder { abstract Builder setLastModified(Long lastModified); - /** - * Sets the geographic location where the dataset should reside. This property is experimental - * and might be subject to change or removed. - * - * @see Dataset - * Location - */ - @Deprecated - public abstract Builder location(String location); /** * Sets the geographic location where the dataset should reside. This property is experimental @@ -237,11 +193,6 @@ public Acl apply(Dataset.Access accessPb) { this.selfLink = datasetPb.getSelfLink(); } - @Override - @Deprecated - public Builder datasetId(DatasetId datasetId) { - return setDatasetId(datasetId); - } @Override public Builder setDatasetId(DatasetId datasetId) { @@ -249,11 +200,6 @@ public Builder setDatasetId(DatasetId datasetId) { return this; } - @Override - @Deprecated - public Builder acl(List acl) { - return setAcl(acl); - } @Override public Builder setAcl(List acl) { @@ -267,11 +213,6 @@ Builder setCreationTime(Long creationTime) { return this; } - @Override - @Deprecated - public Builder defaultTableLifetime(Long defaultTableLifetime) { - return setDefaultTableLifetime(defaultTableLifetime); - } @Override public Builder setDefaultTableLifetime(Long defaultTableLifetime) { @@ -280,11 +221,6 @@ public Builder setDefaultTableLifetime(Long defaultTableLifetime) { return this; } - @Override - @Deprecated - public Builder description(String description) { - return setDescription(description); - } @Override public Builder setDescription(String description) { @@ -298,11 +234,6 @@ Builder setEtag(String etag) { return this; } - @Override - @Deprecated - public Builder friendlyName(String friendlyName) { - return setFriendlyName(friendlyName); - } @Override public Builder setFriendlyName(String friendlyName) { @@ -322,11 +253,6 @@ Builder setLastModified(Long lastModified) { return this; } - @Override - @Deprecated - public Builder location(String location) { - return setLocation(location); - } @Override public Builder setLocation(String location) { @@ -360,13 +286,6 @@ public DatasetInfo build() { selfLink = builder.selfLink; } - /** - * Returns the dataset identity. - */ - @Deprecated - public DatasetId datasetId() { - return getDatasetId(); - } /** * Returns the dataset identity. @@ -375,15 +294,6 @@ public DatasetId getDatasetId() { return datasetId; } - /** - * Returns the dataset's access control configuration. - * - * @see Access Control - */ - @Deprecated - public List acl() { - return getAcl(); - } /** * Returns the dataset's access control configuration. @@ -394,13 +304,6 @@ public List getAcl() { return acl; } - /** - * Returns the time when this dataset was created, in milliseconds since the epoch. - */ - @Deprecated - public Long creationTime() { - return getCreationTime(); - } /** * Returns the time when this dataset was created, in milliseconds since the epoch. @@ -409,19 +312,6 @@ public Long getCreationTime() { return creationTime; } - /** - * Returns the default lifetime of all tables in the dataset, in milliseconds. Once this property - * is set, all newly-created tables in the dataset will have an expirationTime property set to the - * creation time plus the value in this property, and changing the value will only affect new - * tables, not existing ones. When the expirationTime for a given table is reached, that table - * will be deleted automatically. If a table's expirationTime is modified or removed before the - * table expires, or if you provide an explicit expirationTime when creating a table, that value - * takes precedence over the default expiration time indicated by this property. - */ - @Deprecated - public Long defaultTableLifetime() { - return getDefaultTableLifetime(); - } /** * Returns the default lifetime of all tables in the dataset, in milliseconds. Once this property @@ -436,13 +326,6 @@ public Long getDefaultTableLifetime() { return defaultTableLifetime; } - /** - * Returns a user-friendly description for the dataset. - */ - @Deprecated - public String description() { - return getDescription(); - } /** * Returns a user-friendly description for the dataset. @@ -451,13 +334,6 @@ public String getDescription() { return description; } - /** - * Returns the hash of the dataset resource. - */ - @Deprecated - public String etag() { - return getEtag(); - } /** * Returns the hash of the dataset resource. @@ -466,13 +342,6 @@ public String getEtag() { return etag; } - /** - * Returns a user-friendly name for the dataset. - */ - @Deprecated - public String friendlyName() { - return getFriendlyName(); - } /** * Returns a user-friendly name for the dataset. @@ -481,13 +350,6 @@ public String getFriendlyName() { return friendlyName; } - /** - * Returns the service-generated id for the dataset. - */ - @Deprecated - public String generatedId() { - return getGeneratedId(); - } /** * Returns the service-generated id for the dataset. @@ -496,14 +358,6 @@ public String getGeneratedId() { return generatedId; } - /** - * Returns the time when this dataset or any of its tables was last modified, in milliseconds - * since the epoch. - */ - @Deprecated - public Long lastModified() { - return getLastModified(); - } /** * Returns the time when this dataset or any of its tables was last modified, in milliseconds @@ -513,16 +367,6 @@ public Long getLastModified() { return lastModified; } - /** - * Returns the geographic location where the dataset should reside. - * - * @see - * Dataset Location - */ - @Deprecated - public String location() { - return getLocation(); - } /** * Returns the geographic location where the dataset should reside. @@ -534,14 +378,6 @@ public String getLocation() { return location; } - /** - * Returns an URL that can be used to access the resource again. The returned URL can be used for - * get or update requests. - */ - @Deprecated - public String selfLink() { - return getSelfLink(); - } /** * Returns an URL that can be used to access the resource again. The returned URL can be used for @@ -633,13 +469,6 @@ public Dataset.Access apply(Acl acl) { return datasetPb; } - /** - * Returns a builder for a {@code DatasetInfo} object given it's identity. - */ - @Deprecated - public static Builder builder(DatasetId datasetId) { - return newBuilder(datasetId); - } /** * Returns a builder for a {@code DatasetInfo} object given it's identity. @@ -648,13 +477,6 @@ public static Builder newBuilder(DatasetId datasetId) { return new BuilderImpl().setDatasetId(datasetId); } - /** - * Returns a builder for a {@code DatasetInfo} object given it's user-defined id. - */ - @Deprecated - public static Builder builder(String datasetId) { - return newBuilder(datasetId); - } /** * Returns a builder for a {@code DatasetInfo} object given it's user-defined id. @@ -663,13 +485,6 @@ public static Builder newBuilder(String datasetId) { return newBuilder(DatasetId.of(datasetId)); } - /** - * Returns a builder for the DatasetInfo object given it's user-defined project and dataset ids. - */ - @Deprecated - public static Builder builder(String projectId, String datasetId) { - return newBuilder(projectId, datasetId); - } /** * Returns a builder for the DatasetInfo object given it's user-defined project and dataset ids. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java index 22f3cde885d9..d83914d4076a 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java @@ -104,18 +104,6 @@ private Builder(Table tablePb) { } } - /** - * Sets the fully-qualified URIs that point to your data in Google Cloud Storage (e.g. - * gs://bucket/path). Each URI can contain one '*' wildcard character that must come after the - * bucket's name. Size limits related to load jobs apply to external data sources, plus an - * additional limit of 10 GB maximum size across all URIs. - * - * @see Quota - */ - @Deprecated - public Builder sourceUris(List sourceUris) { - return setSourceUris(sourceUris); - } /** * Sets the fully-qualified URIs that point to your data in Google Cloud Storage (e.g. @@ -130,17 +118,6 @@ public Builder setSourceUris(List sourceUris) { return this; } - /** - * Sets the source format, and possibly some parsing options, of the external data. Supported - * formats are {@code CSV} and {@code NEWLINE_DELIMITED_JSON}. - * - * - * Source Format - */ - @Deprecated - public Builder formatOptions(FormatOptions formatOptions) { - return setFormatOptions(formatOptions); - } /** * Sets the source format, and possibly some parsing options, of the external data. Supported @@ -154,15 +131,6 @@ public Builder setFormatOptions(FormatOptions formatOptions) { return this; } - /** - * Sets the maximum number of bad records that BigQuery can ignore when reading data. If the - * number of bad records exceeds this value, an invalid error is returned in the job result. - * The default value is 0, which requires that all records are valid. - */ - @Deprecated - public Builder maxBadRecords(Integer maxBadRecords) { - return setMaxBadRecords(maxBadRecords); - } /** * Sets the maximum number of bad records that BigQuery can ignore when reading data. If the @@ -174,26 +142,12 @@ public Builder setMaxBadRecords(Integer maxBadRecords) { return this; } - /** - * Sets whether BigQuery should allow extra values that are not represented in the table schema. - * If true, the extra values are ignored. If false, records with extra columns are treated as - * bad records, and if there are too many bad records, an invalid error is returned in the job - * result. The default value is false. The value set with {@link #formatOptions(FormatOptions)} - * property determines what BigQuery treats as an extra value. - * - * @see - * Ignore Unknown Values - */ - @Deprecated - public Builder ignoreUnknownValues(Boolean ignoreUnknownValues) { - return setIgnoreUnknownValues(ignoreUnknownValues); - } /** * Sets whether BigQuery should allow extra values that are not represented in the table schema. * If true, the extra values are ignored. If false, records with extra columns are treated as * bad records, and if there are too many bad records, an invalid error is returned in the job - * result. The default value is false. The value set with {@link #formatOptions(FormatOptions)} + * result. The default value is false. The value set with {@link #setFormatOptions(FormatOptions)} * property determines what BigQuery treats as an extra value. * * @see @@ -204,16 +158,6 @@ public Builder setIgnoreUnknownValues(Boolean ignoreUnknownValues) { return this; } - /** - * Sets compression type of the data source. By default no compression is assumed. - * - * @see - * Compression - */ - @Deprecated - public Builder compression(String compression) { - return setCompression(compression); - } /** * Sets compression type of the data source. By default no compression is assumed. @@ -244,16 +188,6 @@ private ExternalTableDefinition(Builder builder) { this.sourceUris = builder.sourceUris; } - /** - * Returns the compression type of the data source. - * - * @see - * Compression - */ - @Deprecated - public String compression() { - return getCompression(); - } /** * Returns the compression type of the data source. @@ -269,7 +203,7 @@ public String getCompression() { * Returns whether BigQuery should allow extra values that are not represented in the table * schema. If true, the extra values are ignored. If false, records with extra columns are treated * as bad records, and if there are too many bad records, an invalid error is returned in the job - * result. The default value is false. The value of {@link #formatOptions()} determines what + * result. The default value is false. The value of {@link #getFormatOptions()} determines what * BigQuery treats as an extra value. * * @see @@ -279,14 +213,6 @@ public Boolean ignoreUnknownValues() { return ignoreUnknownValues; } - /** - * Returns the maximum number of bad records that BigQuery can ignore when reading data. If the - * number of bad records exceeds this value, an invalid error is returned in the job result. - */ - @Deprecated - public Integer maxBadRecords() { - return getMaxBadRecords(); - } /** * Returns the maximum number of bad records that BigQuery can ignore when reading data. If the @@ -296,18 +222,6 @@ public Integer getMaxBadRecords() { return maxBadRecords; } - /** - * Returns the fully-qualified URIs that point to your data in Google Cloud Storage. Each URI can - * contain one '*' wildcard character that must come after the bucket's name. Size limits - * related to load jobs apply to external data sources, plus an additional limit of 10 GB - * maximum size across all URIs. - * - * @see Quota - */ - @Deprecated - public List sourceUris() { - return getSourceUris(); - } /** * Returns the fully-qualified URIs that point to your data in Google Cloud Storage. Each URI can @@ -321,15 +235,6 @@ public List getSourceUris() { return sourceUris; } - /** - * Returns the source format, and possibly some parsing options, of the external data. Supported - * formats are {@code CSV} and {@code NEWLINE_DELIMITED_JSON}. - */ - @SuppressWarnings("unchecked") - @Deprecated - public F formatOptions() { - return getFormatOptions(); - } /** * Returns the source format, and possibly some parsing options, of the external data. Supported @@ -406,25 +311,6 @@ com.google.api.services.bigquery.model.ExternalDataConfiguration toExternalDataC return externalConfigurationPb; } - /** - * Creates a builder for an ExternalTableDefinition object. - * - * @param sourceUris the fully-qualified URIs that point to your data in Google Cloud Storage. - * Each URI can contain one '*' wildcard character that must come after the bucket's name. - * Size limits related to load jobs apply to external data sources, plus an additional limit - * of 10 GB maximum size across all URIs. - * @param schema the schema for the external data - * @param format the source format of the external data - * @return a builder for an ExternalTableDefinition object given source URIs, schema and format - * - * @see Quota - * @see - * Source Format - */ - @Deprecated - public static Builder builder(List sourceUris, Schema schema, FormatOptions format) { - return newBuilder(sourceUris, schema, format); - } /** * Creates a builder for an ExternalTableDefinition object. @@ -445,24 +331,6 @@ public static Builder newBuilder(List sourceUris, Schema schema, FormatO return new Builder().setSourceUris(sourceUris).setSchema(schema).setFormatOptions(format); } - /** - * Creates a builder for an ExternalTableDefinition object. - * - * @param sourceUri a fully-qualified URI that points to your data in Google Cloud Storage. The - * URI can contain one '*' wildcard character that must come after the bucket's name. Size - * limits related to load jobs apply to external data sources. - * @param schema the schema for the external data - * @param format the source format of the external data - * @return a builder for an ExternalTableDefinition object given source URI, schema and format - * - * @see Quota - * @see - * Source Format - */ - @Deprecated - public static Builder builder(String sourceUri, Schema schema, FormatOptions format) { - return newBuilder(sourceUri, schema, format); - } /** * Creates a builder for an ExternalTableDefinition object. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExtractJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExtractJobConfiguration.java index a77c512a7681..48e38dc6b91f 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExtractJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExtractJobConfiguration.java @@ -76,13 +76,6 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur this.compression = extractConfigurationPb.getCompression(); } - /** - * Sets the table to export. - */ - @Deprecated - public Builder sourceTable(TableId sourceTable) { - return setSourceTable(sourceTable); - } /** * Sets the table to export. @@ -92,14 +85,6 @@ public Builder setSourceTable(TableId sourceTable) { return this; } - /** - * Sets the list of fully-qualified Google Cloud Storage URIs (e.g. gs://bucket/path) where the - * extracted table should be written. - */ - @Deprecated - public Builder destinationUris(List destinationUris) { - return setDestinationUris(destinationUris); - } /** * Sets the list of fully-qualified Google Cloud Storage URIs (e.g. gs://bucket/path) where the @@ -110,13 +95,6 @@ public Builder setDestinationUris(List destinationUris) { return this; } - /** - * Sets whether to print out a header row in the results. By default an header is printed. - */ - @Deprecated - public Builder printHeader(Boolean printHeader) { - return setPrintHeader(printHeader); - } /** * Sets whether to print out a header row in the results. By default an header is printed. @@ -126,13 +104,6 @@ public Builder setPrintHeader(Boolean printHeader) { return this; } - /** - * Sets the delimiter to use between fields in the exported data. By default "," is used. - */ - @Deprecated - public Builder fieldDelimiter(String fieldDelimiter) { - return setFieldDelimiter(fieldDelimiter); - } /** * Sets the delimiter to use between fields in the exported data. By default "," is used. @@ -142,16 +113,6 @@ public Builder setFieldDelimiter(String fieldDelimiter) { return this; } - /** - * Sets the exported file format. If not set table is exported in CSV format. - * - * - * Destination Format - */ - @Deprecated - public Builder format(String format) { - return setFormat(format); - } /** * Sets the exported file format. If not set table is exported in CSV format. @@ -164,17 +125,6 @@ public Builder setFormat(String format) { return this; } - /** - * Sets the compression value to use for exported files. If not set exported files are not - * compressed. - * - * - * Compression - */ - @Deprecated - public Builder compression(String compression) { - return setCompression(compression); - } /** * Sets the compression value to use for exported files. If not set exported files are not @@ -203,13 +153,6 @@ private ExtractJobConfiguration(Builder builder) { this.compression = builder.compression; } - /** - * Returns the table to export. - */ - @Deprecated - public TableId sourceTable() { - return getSourceTable(); - } /** * Returns the table to export. @@ -218,17 +161,6 @@ public TableId getSourceTable() { return sourceTable; } - /** - * Returns the list of fully-qualified Google Cloud Storage URIs where the extracted table should - * be written. - * - * @see - * Exporting Data Into One or More Files - */ - @Deprecated - public List destinationUris() { - return getDestinationUris(); - } /** * Returns the list of fully-qualified Google Cloud Storage URIs where the extracted table should @@ -248,13 +180,6 @@ public Boolean printHeader() { return printHeader; } - /** - * Returns the delimiter used between fields in the exported data. - */ - @Deprecated - public String fieldDelimiter() { - return getFieldDelimiter(); - } /** * Returns the delimiter used between fields in the exported data. @@ -263,13 +188,6 @@ public String getFieldDelimiter() { return fieldDelimiter; } - /** - * Returns the exported files format. - */ - @Deprecated - public String format() { - return getFormat(); - } /** * Returns the exported files format. @@ -278,13 +196,6 @@ public String getFormat() { return format; } - /** - * Returns the compression value of exported files. - */ - @Deprecated - public String compression() { - return getCompression(); - } /** * Returns the compression value of exported files. @@ -340,14 +251,6 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { .setExtract(extractConfigurationPb); } - /** - * Creates a builder for a BigQuery Extract Job configuration given source table and destination - * URI. - */ - @Deprecated - public static Builder builder(TableId sourceTable, String destinationUri) { - return newBuilder(sourceTable, destinationUri); - } /** * Creates a builder for a BigQuery Extract Job configuration given source table and destination @@ -357,14 +260,6 @@ public static Builder newBuilder(TableId sourceTable, String destinationUri) { return newBuilder(sourceTable, ImmutableList.of(checkNotNull(destinationUri))); } - /** - * Creates a builder for a BigQuery Extract Job configuration given source table and destination - * URIs. - */ - @Deprecated - public static Builder builder(TableId sourceTable, List destinationUris) { - return newBuilder(sourceTable, destinationUris); - } /** * Creates a builder for a BigQuery Extract Job configuration given source table and destination diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java index 0d0b65156eef..0cf71a899a08 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java @@ -86,16 +86,6 @@ private Type(LegacySQLTypeName value, List fields) { this.fields = fields; } - /** - * Returns the value identifier. - * - * @see - * Data Types - */ - @Deprecated - public LegacySQLTypeName value() { - return getValue(); - } /** * Returns the value identifier. @@ -107,17 +97,9 @@ public LegacySQLTypeName getValue() { return value; } - /** - * Returns the list of sub-fields if {@link #value()} is set to {@link - * LegacySQLTypeName#RECORD}. Returns {@code null} otherwise. - */ - @Deprecated - public List fields() { - return getFields(); - } /** - * Returns the list of sub-fields if {@link #value()} is set to {@link + * Returns the list of sub-fields if {@link #getValue()} is set to {@link * LegacySQLTypeName#RECORD}. Returns {@code null} otherwise. */ public List getFields() { @@ -229,15 +211,6 @@ private Builder(Field field) { this.description = field.description; } - /** - * Sets the field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or - * underscores (_), and must start with a letter or underscore. The maximum length is 128 - * characters. - */ - @Deprecated - public Builder name(String name) { - return setName(name); - } /** * Sets the field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or @@ -249,16 +222,6 @@ public Builder setName(String name) { return this; } - /** - * Sets the value of the field. - * - * @see - * Data Types - */ - @Deprecated - public Builder type(Type type) { - return setType(type); - } /** * Sets the value of the field. @@ -271,13 +234,6 @@ public Builder setType(Type type) { return this; } - /** - * Sets the mode of the field. When not specified {@link Mode#NULLABLE} is used. - */ - @Deprecated - public Builder mode(Mode mode) { - return setMode(mode); - } /** * Sets the mode of the field. When not specified {@link Mode#NULLABLE} is used. @@ -287,13 +243,6 @@ public Builder setMode(Mode mode) { return this; } - /** - * Sets the field description. The maximum length is 16K characters. - */ - @Deprecated - public Builder description(String description) { - return setDescription(description); - } /** * Sets the field description. The maximum length is 16K characters. @@ -318,13 +267,6 @@ private Field(Builder builder) { this.description = builder.description; } - /** - * Returns the field name. - */ - @Deprecated - public String name() { - return getName(); - } /** * Returns the field name. @@ -333,16 +275,6 @@ public String getName() { return name; } - /** - * Returns the field value. - * - * @see - * Data Types - */ - @Deprecated - public Type type() { - return getType(); - } /** * Returns the field value. @@ -354,13 +286,6 @@ public Type getType() { return type; } - /** - * Returns the field mode. By default {@link Mode#NULLABLE} is used. - */ - @Deprecated - public Mode mode() { - return getMode(); - } /** * Returns the field mode. By default {@link Mode#NULLABLE} is used. @@ -369,13 +294,6 @@ public Mode getMode() { return mode != null ? Mode.valueOf(mode) : null; } - /** - * Returns the field description. - */ - @Deprecated - public String description() { - return getDescription(); - } /** * Returns the field description. @@ -384,17 +302,9 @@ public String getDescription() { return Data.isNull(description) ? null : description; } - /** - * Returns the list of sub-fields if {@link #type()} is a {@link LegacySQLTypeName#RECORD}. - * Returns {@code null} otherwise. - */ - @Deprecated - public List fields() { - return getFields(); - } /** - * Returns the list of sub-fields if {@link #type()} is a {@link LegacySQLTypeName#RECORD}. + * Returns the list of sub-fields if {@link #getType()} is a {@link LegacySQLTypeName#RECORD}. * Returns {@code null} otherwise. */ public List getFields() { @@ -452,13 +362,6 @@ public static Field of(String name, Type type) { return newBuilder(name, type).build(); } - /** - * Returns a builder for a Field object with given name and value. - */ - @Deprecated - public static Builder builder(String name, Type type) { - return newBuilder(name, type); - } /** * Returns a builder for a Field object with given name and value. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java index 1e5c00b0b753..5677a4933320 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java @@ -77,21 +77,6 @@ public enum Attribute { this.value = value; } - /** - * Returns the attribute of this Field Value. - * - * @return {@link Attribute#PRIMITIVE} if the field is a primitive type - * ({@link Field.Type#bytes()}, {@link Field.Type#bool()}, {@link Field.Type#string()}, - * {@link Field.Type#floatingPoint()}, {@link Field.Type#integer()}, - * {@link Field.Type#timestamp()}) or is {@code null}. Returns {@link Attribute#REPEATED} if - * the corresponding field has ({@link Field.Mode#REPEATED}) mode. Returns - * {@link Attribute#RECORD} if the corresponding field is a - * {@link Field.Type#record(Field...)} type. - */ - @Deprecated - public Attribute attribute() { - return getAttribute(); - } /** * Returns the attribute of this Field Value. @@ -115,14 +100,6 @@ public boolean isNull() { return value == null; } - /** - * Returns this field's value as an {@link Object}. If {@link #isNull()} is {@code true} this - * method returns {@code null}. - */ - @Deprecated - public Object value() { - return getValue(); - } /** * Returns this field's value as an {@link Object}. If {@link #isNull()} is {@code true} this @@ -132,20 +109,6 @@ public Object getValue() { return value; } - /** - * Returns this field's value as a {@link String}. This method should only be used if the - * corresponding field has primitive type ({@link Field.Type#bytes()}, {@link Field.Type#bool()}, - * {@link Field.Type#string()}, {@link Field.Type#floatingPoint()}, {@link Field.Type#integer()}, - * {@link Field.Type#timestamp()}). - * - * @throws ClassCastException if the field is not a primitive type - * @throws NullPointerException if {@link #isNull()} returns {@code true} - */ - @SuppressWarnings("unchecked") - @Deprecated - public String stringValue() { - return getStringValue(); - } /** * Returns this field's value as a {@link String}. This method should only be used if the @@ -162,18 +125,6 @@ public String getStringValue() { return (String) value; } - /** - * Returns this field's value as a byte array. This method should only be used if the - * corresponding field has primitive type ({@link Field.Type#bytes()}. - * - * @throws ClassCastException if the field is not a primitive type - * @throws NullPointerException if {@link #isNull()} returns {@code true} - * @throws IllegalStateException if the field value is not encoded in base64 - */ - @Deprecated - public byte[] bytesValue() { - return getBytesValue(); - } /** * Returns this field's value as a byte array. This method should only be used if the @@ -191,19 +142,6 @@ public byte[] getBytesValue() { } } - /** - * Returns this field's value as a {@code long}. This method should only be used if the - * corresponding field has {@link Field.Type#integer()} type. - * - * @throws ClassCastException if the field is not a primitive type - * @throws NumberFormatException if the field's value could not be converted to {@link Integer} - * @throws NullPointerException if {@link #isNull()} returns {@code true} - */ - @SuppressWarnings("unchecked") - @Deprecated - public long longValue() { - return getLongValue(); - } /** * Returns this field's value as a {@code long}. This method should only be used if the @@ -218,19 +156,6 @@ public long getLongValue() { return Long.parseLong(getStringValue()); } - /** - * Returns this field's value as a {@link Double}. This method should only be used if the - * corresponding field has {@link Field.Type#floatingPoint()} type. - * - * @throws ClassCastException if the field is not a primitive type - * @throws NumberFormatException if the field's value could not be converted to {@link Double} - * @throws NullPointerException if {@link #isNull()} returns {@code true} - */ - @SuppressWarnings("unchecked") - @Deprecated - public double doubleValue() { - return getDoubleValue(); - } /** * Returns this field's value as a {@link Double}. This method should only be used if the @@ -245,19 +170,6 @@ public double getDoubleValue() { return Double.parseDouble(getStringValue()); } - /** - * Returns this field's value as a {@link Boolean}. This method should only be used if the - * corresponding field has {@link Field.Type#bool()} type. - * - * @throws ClassCastException if the field is not a primitive type - * @throws IllegalStateException if the field's value could not be converted to {@link Boolean} - * @throws NullPointerException if {@link #isNull()} returns {@code true} - */ - @SuppressWarnings("unchecked") - @Deprecated - public boolean booleanValue() { - return getBooleanValue(); - } /** * Returns this field's value as a {@link Boolean}. This method should only be used if the @@ -275,20 +187,6 @@ public boolean getBooleanValue() { return Boolean.parseBoolean(stringValue); } - /** - * Returns this field's value as a {@code long}, representing a timestamp in microseconds since - * epoch (UNIX time). This method should only be used if the corresponding field has - * {@link Field.Type#timestamp()} type. - * - * @throws ClassCastException if the field is not a primitive type - * @throws NumberFormatException if the field's value could not be converted to {@link Long} - * @throws NullPointerException if {@link #isNull()} returns {@code true} - */ - @SuppressWarnings("unchecked") - @Deprecated - public long timestampValue() { - return getTimestampValue(); - } /** * Returns this field's value as a {@code long}, representing a timestamp in microseconds since @@ -306,23 +204,10 @@ public long getTimestampValue() { return new Double(Double.valueOf(getStringValue()) * MICROSECONDS).longValue(); } - /** - * Returns this field's value as a list of {@link FieldValue}. This method should only be used if - * the corresponding field has {@link Field.Mode#REPEATED} mode (i.e. {@link #attribute()} is - * {@link Attribute#REPEATED}). - * - * @throws ClassCastException if the field has not {@link Field.Mode#REPEATED} mode - * @throws NullPointerException if {@link #isNull()} returns {@code true} - */ - @SuppressWarnings("unchecked") - @Deprecated - public List repeatedValue() { - return getRepeatedValue(); - } /** * Returns this field's value as a list of {@link FieldValue}. This method should only be used if - * the corresponding field has {@link Field.Mode#REPEATED} mode (i.e. {@link #attribute()} is + * the corresponding field has {@link Field.Mode#REPEATED} mode (i.e. {@link #getAttribute()} is * {@link Attribute#REPEATED}). * * @throws ClassCastException if the field has not {@link Field.Mode#REPEATED} mode @@ -334,24 +219,11 @@ public List getRepeatedValue() { return (List) value; } - /** - * Returns this field's value as a list of {@link FieldValue}. This method should only be used if - * the corresponding field has {@link Field.Type#record(Field...)} type (i.e. {@link #attribute()} - * is {@link Attribute#RECORD}). - * - * @throws ClassCastException if the field is not a {@link Field.Type#record(Field...)} type - * @throws NullPointerException if {@link #isNull()} returns {@code true} - */ - @SuppressWarnings("unchecked") - @Deprecated - public List recordValue() { - return getRecordValue(); - } /** * Returns this field's value as a list of {@link FieldValue}. This method should only be used if - * the corresponding field has {@link Field.Type#record(Field...)} type (i.e. {@link #attribute()} - * is {@link Attribute#RECORD}). + * the corresponding field has {@link Field.Type#record(Field...)} type (i.e. + * {@link #getAttribute()} is {@link Attribute#RECORD}). * * @throws ClassCastException if the field is not a {@link Field.Type#record(Field...)} type * @throws NullPointerException if {@link #isNull()} returns {@code true} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java index 40ec11ebf6b9..9a7cf15ae87a 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java @@ -41,13 +41,6 @@ public class FormatOptions implements Serializable { this.type = type; } - /** - * Returns the external data format, as a string. - */ - @Deprecated - public String type() { - return getType(); - } /** * Returns the external data format, as a string. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java index 0c46fd09bcf7..a67673552abd 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java @@ -81,13 +81,6 @@ public static class RowToInsert implements Serializable { this.content = ImmutableMap.copyOf(content); } - /** - * Returns the id associated with the row. Returns {@code null} if not set. - */ - @Deprecated - public String id() { - return getId(); - } /** * Returns the id associated with the row. Returns {@code null} if not set. @@ -96,13 +89,6 @@ public String getId() { return id; } - /** - * Returns the actual content of the row, as a map. - */ - @Deprecated - public Map content() { - return getContent(); - } /** * Returns the actual content of the row, as a map. @@ -166,13 +152,6 @@ public static final class Builder { private Builder() {} - /** - * Sets the destination table for rows insert request. - */ - @Deprecated - public Builder table(TableId table) { - return setTable(table); - } /** * Sets the destination table for rows insert request. @@ -182,13 +161,6 @@ public Builder setTable(TableId table) { return this; } - /** - * Sets the rows to insert as a list of {@link RowToInsert} objects. - */ - @Deprecated - public Builder rows(Iterable rows) { - return setRows(rows); - } /** * Sets the rows to insert as a list of {@link RowToInsert} objects. @@ -256,14 +228,6 @@ public Builder addRow(Map content) { return this; } - /** - * Sets whether to insert all valid rows of a request, even if invalid rows exist. If not set - * the entire insert request will fail if it contains an invalid row. - */ - @Deprecated - public Builder skipInvalidRows(boolean skipInvalidRows) { - return setSkipInvalidRows(skipInvalidRows); - } /** * Sets whether to insert all valid rows of a request, even if invalid rows exist. If not set @@ -274,14 +238,6 @@ public Builder setSkipInvalidRows(boolean skipInvalidRows) { return this; } - /** - * Sets whether to accept rows that contain values that do not match the schema. The unknown - * values are ignored. If not set, rows with unknown values are considered to be invalid. - */ - @Deprecated - public Builder ignoreUnknownValues(boolean ignoreUnknownValues) { - return setIgnoreUnknownValues(ignoreUnknownValues); - } /** * Sets whether to accept rows that contain values that do not match the schema. The unknown @@ -292,28 +248,6 @@ public Builder setIgnoreUnknownValues(boolean ignoreUnknownValues) { return this; } - /** - * If specified, the destination table is treated as a base template. Rows are inserted into an - * instance table named "{destination}{templateSuffix}". BigQuery will manage the creation of - * the instance table, using the schema of the base template table. Table creation might take - * some time. To obtain table's information after {@link BigQuery#insertAll(InsertAllRequest)} - * is called use: - *
 {@code
-     * String suffixTableId = ...;
-     * TableInfo suffixTable = bigquery.getTable(DATASET, suffixTableId);
-     * while (suffixTable == null) {
-     *   Thread.sleep(1000L);
-     *   suffixTable = bigquery.getTable(DATASET, suffixTableId);
-     * }}
- * - * @see - * Template Tables - */ - @Deprecated - public Builder templateSuffix(String templateSuffix) { - return setTemplateSuffix(templateSuffix); - } /** * If specified, the destination table is treated as a base template. Rows are inserted into an @@ -354,13 +288,6 @@ private InsertAllRequest(Builder builder) { this.templateSuffix = builder.templateSuffix; } - /** - * Returns the destination table for rows insert request. - */ - @Deprecated - public TableId table() { - return getTable(); - } /** * Returns the destination table for rows insert request. @@ -369,13 +296,6 @@ public TableId getTable() { return table; } - /** - * Returns the rows to be inserted. - */ - @Deprecated - public List rows() { - return getRows(); - } /** * Returns the rows to be inserted. @@ -400,28 +320,6 @@ public Boolean skipInvalidRows() { return skipInvalidRows; } - /** - * If specified, the destination table is treated as a base template. Rows are inserted into an - * instance table named "{destination}{templateSuffix}". BigQuery will manage the creation of the - * instance table, using the schema of the base template table. Table creation might take some - * time. To obtain table's information after {@link BigQuery#insertAll(InsertAllRequest)} is - * called use: - *
 {@code
-   * String suffixTableId = ...;
-   * TableInfo suffixTable = bigquery.getTable(DATASET, suffixTableId);
-   * while (suffixTable == null) {
-   *   Thread.sleep(1000L);
-   *   suffixTable = bigquery.getTable(DATASET, suffixTableId);
-   * }}
- * - * @see - * Template Tables - */ - @Deprecated - public String templateSuffix() { - return getTemplateSuffix(); - } /** * If specified, the destination table is treated as a base template. Rows are inserted into an @@ -445,13 +343,6 @@ public String getTemplateSuffix() { return templateSuffix; } - /** - * Returns a builder for an {@code InsertAllRequest} object given the destination table. - */ - @Deprecated - public static Builder builder(TableId table) { - return newBuilder(table); - } /** * Returns a builder for an {@code InsertAllRequest} object given the destination table. @@ -460,14 +351,6 @@ public static Builder newBuilder(TableId table) { return new Builder().setTable(table); } - /** - * Returns a builder for an {@code InsertAllRequest} object given the destination table and the - * rows to insert. - */ - @Deprecated - public static Builder builder(TableId table, Iterable rows) { - return newBuilder(table, rows); - } /** * Returns a builder for an {@code InsertAllRequest} object given the destination table and the @@ -477,14 +360,6 @@ public static Builder newBuilder(TableId table, Iterable rows) { return newBuilder(table).setRows(rows); } - /** - * Returns a builder for an {@code InsertAllRequest} object given the destination table and the - * rows to insert. - */ - @Deprecated - public static Builder builder(TableId table, RowToInsert... rows) { - return newBuilder(table, rows); - } /** * Returns a builder for an {@code InsertAllRequest} object given the destination table and the @@ -494,13 +369,6 @@ public static Builder newBuilder(TableId table, RowToInsert... rows) { return newBuilder(table, ImmutableList.copyOf(rows)); } - /** - * Returns a builder for an {@code InsertAllRequest} object given the destination table. - */ - @Deprecated - public static Builder builder(String datasetId, String tableId) { - return newBuilder(datasetId, tableId); - } /** * Returns a builder for an {@code InsertAllRequest} object given the destination table. @@ -509,14 +377,6 @@ public static Builder newBuilder(String datasetId, String tableId) { return new Builder().setTable(TableId.of(datasetId, tableId)); } - /** - * Returns a builder for an {@code InsertAllRequest} object given the destination table and the - * rows to insert. - */ - @Deprecated - public static Builder builder(String datasetId, String tableId, Iterable rows) { - return newBuilder(datasetId, tableId, rows); - } /** * Returns a builder for an {@code InsertAllRequest} object given the destination table and the @@ -526,14 +386,6 @@ public static Builder newBuilder(String datasetId, String tableId, Iterable rows) { - return newBuilder(tableInfo, rows); - } /** * Returns a builder for an {@code InsertAllRequest} object given the destination table and the @@ -560,14 +404,6 @@ public static Builder newBuilder(TableInfo tableInfo, Iterable rows return newBuilder(tableInfo.getTableId(), rows); } - /** - * Returns a builder for an {@code InsertAllRequest} object given the destination table and the - * rows to insert. - */ - @Deprecated - public static Builder builder(TableInfo tableInfo, RowToInsert... rows) { - return newBuilder(tableInfo, rows); - } /** * Returns a builder for an {@code InsertAllRequest} object given the destination table and the diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllResponse.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllResponse.java index c74893bb4c08..8ff2937cf892 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllResponse.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllResponse.java @@ -50,14 +50,6 @@ public class InsertAllResponse implements Serializable { : ImmutableMap.>of(); } - /** - * Returns all insertion errors as a map whose keys are indexes of rows that failed to insert. - * Each failed row index is associated with a non-empty list of {@link BigQueryError}. - */ - @Deprecated - public Map> insertErrors() { - return getInsertErrors(); - } /** * Returns all insertion errors as a map whose keys are indexes of rows that failed to insert. @@ -67,13 +59,6 @@ public Map> getInsertErrors() { return insertErrors; } - /** - * Returns errors for the provided row index. If no error exists returns {@code null}. - */ - @Deprecated - public List errorsFor(long index) { - return getErrorsFor(index); - } /** * Returns errors for the provided row index. If no error exists returns {@code null}. @@ -84,7 +69,7 @@ public List getErrorsFor(long index) { /** * Returns {@code true} if no row insertion failed, {@code false} otherwise. If {@code false} - * {@link #insertErrors()} returns an empty map. + * {@link #getInsertErrors()} returns an empty map. */ public boolean hasErrors() { return !insertErrors.isEmpty(); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java index 63e6c725be7c..0b4d7ee51f46 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java @@ -76,11 +76,6 @@ Builder setGeneratedId(String generatedId) { return this; } - @Override - @Deprecated - public Builder jobId(JobId jobId) { - return setJobId(jobId); - } @Override public Builder setJobId(JobId jobId) { @@ -112,11 +107,6 @@ Builder setUserEmail(String userEmail) { return this; } - @Override - @Deprecated - public Builder configuration(JobConfiguration configuration) { - return setConfiguration(configuration); - } @Override public Builder setConfiguration(JobConfiguration configuration) { @@ -277,13 +267,6 @@ public boolean cancel() { return bigquery.cancel(getJobId()); } - /** - * Returns the job's {@code BigQuery} object used to issue requests. - */ - @Deprecated - public BigQuery bigquery() { - return getBigquery(); - } /** * Returns the job's {@code BigQuery} object used to issue requests. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobConfiguration.java index 0328369290c8..161b54d905dd 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobConfiguration.java @@ -93,13 +93,6 @@ B setType(Type type) { this.type = builder.type; } - /** - * Returns the type of the job configuration. - */ - @Deprecated - public Type type() { - return getType(); - } /** * Returns the type of the job configuration. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobId.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobId.java index b4cd928ec3a9..b11a3e05ebf5 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobId.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobId.java @@ -33,13 +33,6 @@ public final class JobId implements Serializable { private final String project; private final String job; - /** - * Returns project's user-defined id. - */ - @Deprecated - public String project() { - return getProject(); - } /** * Returns project's user-defined id. @@ -48,13 +41,6 @@ public String getProject() { return project; } - /** - * Returns the job's user-defined id. - */ - @Deprecated - public String job() { - return getJob(); - } /** * Returns the job's user-defined id. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobInfo.java index 3661955ce970..0fd0ec36090c 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobInfo.java @@ -97,11 +97,6 @@ public abstract static class Builder { abstract Builder setGeneratedId(String generatedId); - /** - * Sets the job identity. - */ - @Deprecated - public abstract Builder jobId(JobId jobId); /** * Sets the job identity. @@ -116,15 +111,6 @@ public abstract static class Builder { abstract Builder setUserEmail(String userEmail); - /** - * Sets a configuration for the {@code JobInfo} object. Use {@link CopyJobConfiguration} for a - * job that copies an existing table. Use {@link ExtractJobConfiguration} for a job that exports - * a table to Google Cloud Storage. Use {@link LoadJobConfiguration} for a job that loads data - * from Google Cloud Storage into a table. Use {@link QueryJobConfiguration} for a job that runs - * a query. - */ - @Deprecated - public abstract Builder configuration(JobConfiguration configuration); /** * Sets a configuration for the {@code JobInfo} object. Use {@link CopyJobConfiguration} for a @@ -194,11 +180,6 @@ Builder setGeneratedId(String generatedId) { return this; } - @Override - @Deprecated - public Builder jobId(JobId jobId) { - return setJobId(jobId); - } @Override public Builder setJobId(JobId jobId) { @@ -230,11 +211,6 @@ Builder setUserEmail(String userEmail) { return this; } - @Override - @Deprecated - public Builder configuration(JobConfiguration configuration) { - return setConfiguration(configuration); - } @Override public Builder setConfiguration(JobConfiguration configuration) { @@ -259,13 +235,6 @@ public JobInfo build() { this.configuration = builder.configuration; } - /** - * Returns the hash of the job resource. - */ - @Deprecated - public String etag() { - return getEtag(); - } /** * Returns the hash of the job resource. @@ -274,13 +243,6 @@ public String getEtag() { return etag; } - /** - * Returns the service-generated id for the job. - */ - @Deprecated - public String generatedId() { - return getGeneratedId(); - } /** * Returns the service-generated id for the job. @@ -289,13 +251,6 @@ public String getGeneratedId() { return generatedId; } - /** - * Returns the job identity. - */ - @Deprecated - public JobId jobId() { - return getJobId(); - } /** * Returns the job identity. @@ -304,14 +259,6 @@ public JobId getJobId() { return jobId; } - /** - * Returns an URL that can be used to access the resource again. The returned URL can be used for - * GET requests. - */ - @Deprecated - public String selfLink() { - return getSelfLink(); - } /** * Returns an URL that can be used to access the resource again. The returned URL can be used for @@ -321,14 +268,6 @@ public String getSelfLink() { return selfLink; } - /** - * Returns the status of this job. Examine this value when polling an asynchronous job to see if - * the job is complete. - */ - @Deprecated - public JobStatus status() { - return getStatus(); - } /** * Returns the status of this job. Examine this value when polling an asynchronous job to see if @@ -338,14 +277,6 @@ public JobStatus getStatus() { return status; } - /** - * Returns information about the job, including starting time and ending time of the job. - */ - @SuppressWarnings("unchecked") - @Deprecated - public S statistics() { - return getStatistics(); - } /** * Returns information about the job, including starting time and ending time of the job. @@ -355,13 +286,6 @@ public S getStatistics() { return (S) statistics; } - /** - * Returns the email address of the user who ran the job. - */ - @Deprecated - public String userEmail() { - return getUserEmail(); - } /** * Returns the email address of the user who ran the job. @@ -370,14 +294,6 @@ public String getUserEmail() { return userEmail; } - /** - * Returns the job's configuration. - */ - @SuppressWarnings("unchecked") - @Deprecated - public C configuration() { - return getConfiguration(); - } /** * Returns the job's configuration. @@ -448,17 +364,6 @@ Job toPb() { return jobPb; } - /** - * Returns a builder for a {@code JobInfo} object given the job configuration. Use - * {@link CopyJobConfiguration} for a job that copies an existing table. Use - * {@link ExtractJobConfiguration} for a job that exports a table to Google Cloud Storage. Use - * {@link LoadJobConfiguration} for a job that loads data from Google Cloud Storage into a table. - * Use {@link QueryJobConfiguration} for a job that runs a query. - */ - @Deprecated - public static Builder builder(JobConfiguration configuration) { - return newBuilder(configuration); - } /** * Returns a builder for a {@code JobInfo} object given the job configuration. Use diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java index 8d4af771e216..b2ab582b0fdc 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java @@ -123,20 +123,11 @@ private ExtractStatistics(Builder builder) { this.destinationUriFileCounts = builder.destinationUriFileCounts; } - /** - * Returns the number of files per destination URI or URI pattern specified in the extract job. - * These values will be in the same order as the URIs specified by - * {@link ExtractJobConfiguration#destinationUris()}. - */ - @Deprecated - public List destinationUriFileCounts() { - return getDestinationUriFileCounts(); - } /** * Returns the number of files per destination URI or URI pattern specified in the extract job. * These values will be in the same order as the URIs specified by - * {@link ExtractJobConfiguration#destinationUris()}. + * {@link ExtractJobConfiguration#getDestinationUris()}. */ public List getDestinationUriFileCounts() { return destinationUriFileCounts; @@ -242,13 +233,6 @@ private LoadStatistics(Builder builder) { } - /** - * Returns the number of bytes of source data in a load job. - */ - @Deprecated - public Long inputBytes() { - return getInputBytes(); - } /** * Returns the number of bytes of source data in a load job. @@ -257,13 +241,6 @@ public Long getInputBytes() { return inputBytes; } - /** - * Returns the number of source files in a load job. - */ - @Deprecated - public Long inputFiles() { - return getInputFiles(); - } /** * Returns the number of source files in a load job. @@ -272,13 +249,6 @@ public Long getInputFiles() { return inputFiles; } - /** - * Returns the size of the data loaded by a load job so far, in bytes. - */ - @Deprecated - public Long outputBytes() { - return getOutputBytes(); - } /** * Returns the size of the data loaded by a load job so far, in bytes. @@ -287,13 +257,6 @@ public Long getOutputBytes() { return outputBytes; } - /** - * Returns the number of rows loaded by a load job so far. - */ - @Deprecated - public Long outputRows() { - return getOutputRows(); - } /** * Returns the number of rows loaded by a load job so far. @@ -419,13 +382,6 @@ private QueryStatistics(Builder builder) { this.queryPlan = builder.queryPlan; } - /** - * Returns the billing tier for the job. - */ - @Deprecated - public Integer billingTier() { - return getBillingTier(); - } /** * Returns the billing tier for the job. @@ -434,16 +390,6 @@ public Integer getBillingTier() { return billingTier; } - /** - * Returns whether the query result was fetched from the query cache. - * - * @see - * Query Caching - */ - @Deprecated - public Boolean cacheHit() { - return getCacheHit(); - } /** * Returns whether the query result was fetched from the query cache. @@ -455,13 +401,6 @@ public Boolean getCacheHit() { return cacheHit; } - /** - * Returns the total number of bytes billed for the job. - */ - @Deprecated - public Long totalBytesBilled() { - return getTotalBytesBilled(); - } /** * Returns the total number of bytes billed for the job. @@ -470,13 +409,6 @@ public Long getTotalBytesBilled() { return totalBytesBilled; } - /** - * Returns the total number of bytes processed by the job. - */ - @Deprecated - public Long totalBytesProcessed() { - return getTotalBytesProcessed(); - } /** * Returns the total number of bytes processed by the job. @@ -485,18 +417,6 @@ public Long getTotalBytesProcessed() { return totalBytesProcessed; } - /** - * Returns the query plan as a list of stages or {@code null} if a query plan is not available. - * Each stage involves a number of steps that read from data sources, perform a series of - * transformations on the input, and emit an output to a future stage (or the final result). The - * query plan is available for a completed query job and is retained for 7 days. - * - * @see Query Plan - */ - @Deprecated - public List queryPlan() { - return getQueryPlan(); - } /** * Returns the query plan as a list of stages or {@code null} if a query plan is not available. @@ -601,13 +521,6 @@ protected JobStatistics(Builder builder) { this.startTime = builder.startTime; } - /** - * Returns the creation time of the job in milliseconds since epoch. - */ - @Deprecated - public Long creationTime() { - return getCreationTime(); - } /** * Returns the creation time of the job in milliseconds since epoch. @@ -616,14 +529,6 @@ public Long getCreationTime() { return creationTime; } - /** - * Returns the end time of the job in milliseconds since epoch. Returns {@code null} if the - * job has not finished yet. - */ - @Deprecated - public Long endTime() { - return getEndTime(); - } /** * Returns the end time of the job in milliseconds since epoch. Returns {@code null} if the @@ -633,14 +538,6 @@ public Long getEndTime() { return endTime; } - /** - * Returns the start time of the job in milliseconds since epoch. Returns {@code null} if the - * job has not started yet. - */ - @Deprecated - public Long startTime() { - return getStartTime(); - } /** * Returns the start time of the job in milliseconds since epoch. Returns {@code null} if the diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatus.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatus.java index f149959839f5..4be8a3843414 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatus.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatus.java @@ -47,8 +47,8 @@ public enum State { RUNNING, /** - * The BigQuery Job has completed either succeeding or failing. If failed {@link #error()} will - * be non-null. + * The BigQuery Job has completed either succeeding or failing. If failed {@link #getError()} + * will be non-null. */ DONE } @@ -69,36 +69,16 @@ public enum State { this.executionErrors = executionErrors != null ? ImmutableList.copyOf(executionErrors) : null; } - /** - * Returns the state of the job. A {@link State#PENDING} job is waiting to be executed. A - * {@link State#RUNNING} is being executed. A {@link State#DONE} job has completed either - * succeeding or failing. If failed {@link #error()} will be non-null. - */ - @Deprecated - public State state() { - return getState(); - } /** * Returns the state of the job. A {@link State#PENDING} job is waiting to be executed. A * {@link State#RUNNING} is being executed. A {@link State#DONE} job has completed either - * succeeding or failing. If failed {@link #error()} will be non-null. + * succeeding or failing. If failed {@link #getError()} will be non-null. */ public State getState() { return state; } - /** - * Returns the final error result of the job. If present, indicates that the job has completed - * and was unsuccessful. - * - * @see - * Troubleshooting Errors - */ - @Deprecated - public BigQueryError error() { - return getError(); - } /** * Returns the final error result of the job. If present, indicates that the job has completed @@ -111,17 +91,6 @@ public BigQueryError getError() { return error; } - /** - * Returns all errors encountered during the running of the job. Errors here do not necessarily - * mean that the job has completed or was unsuccessful. - * - * @see - * Troubleshooting Errors - */ - @Deprecated - public List executionErrors() { - return getExecutionErrors(); - } /** * Returns all errors encountered during the running of the job. Errors here do not necessarily diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadConfiguration.java index 3ec80c4097a5..4fc3bfdd41e1 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadConfiguration.java @@ -32,25 +32,12 @@ public interface LoadConfiguration { interface Builder { - /** - * Sets the destination table to load the data into. - */ - @Deprecated - Builder destinationTable(TableId destinationTable); /** * Sets the destination table to load the data into. */ Builder setDestinationTable(TableId destinationTable); - /** - * Sets whether the job is allowed to create new tables. - * - * @see - * Create Disposition - */ - @Deprecated - Builder createDisposition(CreateDisposition createDisposition); /** * Sets whether the job is allowed to create new tables. @@ -60,14 +47,6 @@ interface Builder { */ Builder setCreateDisposition(CreateDisposition createDisposition); - /** - * Sets the action that should occur if the destination table already exists. - * - * @see - * Write Disposition - */ - @Deprecated - Builder writeDisposition(WriteDisposition writeDisposition); /** * Sets the action that should occur if the destination table already exists. @@ -77,16 +56,6 @@ interface Builder { */ Builder setWriteDisposition(WriteDisposition writeDisposition); - /** - * Sets the source format, and possibly some parsing options, of the external data. Supported - * formats are {@code CSV}, {@code NEWLINE_DELIMITED_JSON} and {@code DATASTORE_BACKUP}. If not - * specified, {@code CSV} format is assumed. - * - * - * Source Format - */ - @Deprecated - Builder formatOptions(FormatOptions formatOptions); /** * Sets the source format, and possibly some parsing options, of the external data. Supported @@ -98,13 +67,6 @@ interface Builder { */ Builder setFormatOptions(FormatOptions formatOptions); - /** - * Sets the maximum number of bad records that BigQuery can ignore when running the job. If the - * number of bad records exceeds this value, an invalid error is returned in the job result. - * By default no bad record is ignored. - */ - @Deprecated - Builder maxBadRecords(Integer maxBadRecords); /** * Sets the maximum number of bad records that BigQuery can ignore when running the job. If the @@ -113,13 +75,6 @@ interface Builder { */ Builder setMaxBadRecords(Integer maxBadRecords); - /** - * Sets the schema for the destination table. The schema can be omitted if the destination table - * already exists, or if you're loading data from a Google Cloud Datastore backup (i.e. - * {@code DATASTORE_BACKUP} format option). - */ - @Deprecated - Builder schema(Schema schema); /** * Sets the schema for the destination table. The schema can be omitted if the destination table @@ -128,14 +83,6 @@ interface Builder { */ Builder setSchema(Schema schema); - /** - * Sets whether BigQuery should allow extra values that are not represented in the table schema. - * If {@code true}, the extra values are ignored. If {@code false}, records with extra columns - * are treated as bad records, and if there are too many bad records, an invalid error is - * returned in the job result. By default unknown values are not allowed. - */ - @Deprecated - Builder ignoreUnknownValues(Boolean ignoreUnknownValues); /** * Sets whether BigQuery should allow extra values that are not represented in the table schema. @@ -145,15 +92,6 @@ interface Builder { */ Builder setIgnoreUnknownValues(Boolean ignoreUnknownValues); - /** - * Sets which entity properties to load into BigQuery from a Cloud Datastore backup. This field - * is only used if the source format is set to {@code DATASTORE_BACKUP}. Property names are case - * sensitive and must be top-level properties. If no properties are specified, BigQuery loads - * all properties. If any named property isn't found in the Cloud Datastore backup, an invalid - * error is returned in the job result. - */ - @Deprecated - Builder projectionFields(List projectionFields); /** * Sets which entity properties to load into BigQuery from a Cloud Datastore backup. This field @@ -167,25 +105,12 @@ interface Builder { LoadConfiguration build(); } - /** - * Returns the destination table to load the data into. - */ - @Deprecated - TableId destinationTable(); /** * Returns the destination table to load the data into. */ TableId getDestinationTable(); - /** - * Returns whether the job is allowed to create new tables. - * - * @see - * Create Disposition - */ - @Deprecated - CreateDisposition createDisposition(); /** * Returns whether the job is allowed to create new tables. @@ -195,14 +120,6 @@ interface Builder { */ CreateDisposition getCreateDisposition(); - /** - * Returns the action that should occur if the destination table already exists. - * - * @see - * Write Disposition - */ - @Deprecated - WriteDisposition writeDisposition(); /** * Returns the action that should occur if the destination table already exists. @@ -212,26 +129,13 @@ interface Builder { */ WriteDisposition getWriteDisposition(); - /** - * Returns additional properties used to parse CSV data (used when {@link #format()} is set - * to CSV). Returns {@code null} if not set. - */ - @Deprecated - CsvOptions csvOptions(); /** - * Returns additional properties used to parse CSV data (used when {@link #format()} is set + * Returns additional properties used to parse CSV data (used when {@link #getFormat()} is set * to CSV). Returns {@code null} if not set. */ CsvOptions getCsvOptions(); - /** - * Returns the maximum number of bad records that BigQuery can ignore when running the job. If the - * number of bad records exceeds this value, an invalid error is returned in the job result. - * By default no bad record is ignored. - */ - @Deprecated - Integer maxBadRecords(); /** * Returns the maximum number of bad records that BigQuery can ignore when running the job. If the @@ -240,22 +144,12 @@ interface Builder { */ Integer getMaxBadRecords(); - /** - * Returns the schema for the destination table, if set. Returns {@code null} otherwise. - */ - @Deprecated - Schema schema(); /** * Returns the schema for the destination table, if set. Returns {@code null} otherwise. */ Schema getSchema(); - /** - * Returns the format of the data files. - */ - @Deprecated - String format(); /** * Returns the format of the data files. @@ -270,15 +164,6 @@ interface Builder { */ Boolean ignoreUnknownValues(); - /** - * Returns which entity properties to load into BigQuery from a Cloud Datastore backup. This field - * is only used if the source format is set to {@code DATASTORE_BACKUP}. Property names are case - * sensitive and must be top-level properties. If no properties are specified, BigQuery loads - * all properties. If any named property isn't found in the Cloud Datastore backup, an invalid - * error is returned in the job result. - */ - @Deprecated - List projectionFields(); /** * Returns which entity properties to load into BigQuery from a Cloud Datastore backup. This field diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java index bdff1756586a..39873d4f1b44 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java @@ -123,11 +123,6 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur } } - @Override - @Deprecated - public Builder destinationTable(TableId destinationTable) { - return setDestinationTable(destinationTable); - } @Override public Builder setDestinationTable(TableId destinationTable) { @@ -135,11 +130,6 @@ public Builder setDestinationTable(TableId destinationTable) { return this; } - @Override - @Deprecated - public Builder createDisposition(JobInfo.CreateDisposition createDisposition) { - return setCreateDisposition(createDisposition); - } @Override public Builder setCreateDisposition(JobInfo.CreateDisposition createDisposition) { @@ -147,11 +137,6 @@ public Builder setCreateDisposition(JobInfo.CreateDisposition createDisposition) return this; } - @Override - @Deprecated - public Builder writeDisposition(JobInfo.WriteDisposition writeDisposition) { - return setWriteDisposition(writeDisposition); - } @Override public Builder setWriteDisposition(JobInfo.WriteDisposition writeDisposition) { @@ -159,11 +144,6 @@ public Builder setWriteDisposition(JobInfo.WriteDisposition writeDisposition) { return this; } - @Override - @Deprecated - public Builder formatOptions(FormatOptions formatOptions) { - return setFormatOptions(formatOptions); - } @Override public Builder setFormatOptions(FormatOptions formatOptions) { @@ -171,11 +151,6 @@ public Builder setFormatOptions(FormatOptions formatOptions) { return this; } - @Override - @Deprecated - public Builder maxBadRecords(Integer maxBadRecords) { - return setMaxBadRecords(maxBadRecords); - } @Override public Builder setMaxBadRecords(Integer maxBadRecords) { @@ -183,11 +158,6 @@ public Builder setMaxBadRecords(Integer maxBadRecords) { return this; } - @Override - @Deprecated - public Builder schema(Schema schema) { - return setSchema(schema); - } @Override public Builder setSchema(Schema schema) { @@ -195,11 +165,6 @@ public Builder setSchema(Schema schema) { return this; } - @Override - @Deprecated - public Builder ignoreUnknownValues(Boolean ignoreUnknownValues) { - return setIgnoreUnknownValues(ignoreUnknownValues); - } @Override public Builder setIgnoreUnknownValues(Boolean ignoreUnknownValues) { @@ -207,11 +172,6 @@ public Builder setIgnoreUnknownValues(Boolean ignoreUnknownValues) { return this; } - @Override - @Deprecated - public Builder projectionFields(List projectionFields) { - return setProjectionFields(projectionFields); - } @Override public Builder setProjectionFields(List projectionFields) { @@ -220,15 +180,6 @@ public Builder setProjectionFields(List projectionFields) { return this; } - /** - * Sets the fully-qualified URIs that point to source data in Google Cloud Storage (e.g. - * gs://bucket/path). Each URI can contain one '*' wildcard character and it must come after the - * 'bucket' name. - */ - @Deprecated - public Builder sourceUris(List sourceUris) { - return setSourceUris(sourceUris); - } /** * Sets the fully-qualified URIs that point to source data in Google Cloud Storage (e.g. @@ -259,77 +210,42 @@ private LoadJobConfiguration(Builder builder) { this.projectionFields = builder.projectionFields; } - @Override - @Deprecated - public TableId destinationTable() { - return getDestinationTable(); - } @Override public TableId getDestinationTable() { return destinationTable; } - @Override - @Deprecated - public JobInfo.CreateDisposition createDisposition() { - return this.getCreateDisposition(); - } @Override public JobInfo.CreateDisposition getCreateDisposition() { return this.createDisposition; } - @Override - @Deprecated - public JobInfo.WriteDisposition writeDisposition() { - return getWriteDisposition(); - } @Override public JobInfo.WriteDisposition getWriteDisposition() { return writeDisposition; } - @Override - @Deprecated - public CsvOptions csvOptions() { - return getCsvOptions(); - } @Override public CsvOptions getCsvOptions() { return formatOptions instanceof CsvOptions ? (CsvOptions) formatOptions : null; } - @Override - @Deprecated - public String format() { - return getFormat(); - } @Override public String getFormat() { return formatOptions != null ? formatOptions.getType() : null; } - @Override - @Deprecated - public Integer maxBadRecords() { - return getMaxBadRecords(); - } @Override public Integer getMaxBadRecords() { return maxBadRecords; } - @Override - @Deprecated - public Schema schema() { - return getSchema(); - } @Override public Schema getSchema() { @@ -341,26 +257,12 @@ public Boolean ignoreUnknownValues() { return ignoreUnknownValues; } - @Override - @Deprecated - public List projectionFields() { - return getProjectionFields(); - } @Override public List getProjectionFields() { return projectionFields; } - /** - * Returns the fully-qualified URIs that point to source data in Google Cloud Storage (e.g. - * gs://bucket/path). Each URI can contain one '*' wildcard character and it must come after the - * 'bucket' name. - */ - @Deprecated - public List sourceUris() { - return getSourceUris(); - } /** * Returns the fully-qualified URIs that point to source data in Google Cloud Storage (e.g. @@ -445,14 +347,6 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { .setLoad(loadConfigurationPb); } - /** - * Creates a builder for a BigQuery Load Job configuration given the destination table and source - * URIs. - */ - @Deprecated - public static Builder builder(TableId destinationTable, List sourceUris) { - return newBuilder(destinationTable, sourceUris); - } /** * Creates a builder for a BigQuery Load Job configuration given the destination table and source @@ -478,15 +372,6 @@ public static Builder newBuilder(TableId destinationTable, String sourceUri) { return newBuilder(destinationTable, ImmutableList.of(sourceUri)); } - /** - * Creates a builder for a BigQuery Load Job configuration given the destination table, format and - * source URIs. - */ - @Deprecated - public static Builder builder(TableId destinationTable, List sourceUris, - FormatOptions format) { - return newBuilder(destinationTable, sourceUris, format); - } /** * Creates a builder for a BigQuery Load Job configuration given the destination table, format and @@ -497,14 +382,6 @@ public static Builder newBuilder(TableId destinationTable, List sourceUr return newBuilder(destinationTable, sourceUris).setFormatOptions(format); } - /** - * Creates a builder for a BigQuery Load Job configuration given the destination table, format and - * source URI. - */ - @Deprecated - public static Builder builder(TableId destinationTable, String sourceUri, FormatOptions format) { - return newBuilder(destinationTable, sourceUri, format); - } /** * Creates a builder for a BigQuery Load Job configuration given the destination table, format and diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java index 99c158baf23e..961183025c97 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java @@ -148,13 +148,6 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur } } - /** - * Sets the BigQuery SQL query to execute. - */ - @Deprecated - public Builder query(String query) { - return setQuery(query); - } /** * Sets the BigQuery SQL query to execute. @@ -164,34 +157,16 @@ public Builder setQuery(String query) { return this; } - /** - * Sets the table where to put query results. If not provided a new table is created. This value - * is required if {@link Builder#allowLargeResults(Boolean)} is set to {@code true}. - */ - @Deprecated - public Builder destinationTable(TableId destinationTable) { - return setDestinationTable(destinationTable); - } /** * Sets the table where to put query results. If not provided a new table is created. This value - * is required if {@link Builder#allowLargeResults(Boolean)} is set to {@code true}. + * is required if {@link Builder#setAllowLargeResults(Boolean)} is set to {@code true}. */ public Builder setDestinationTable(TableId destinationTable) { this.destinationTable = destinationTable; return this; } - /** - * Sets the external tables definitions. If querying external data sources outside of BigQuery, - * this value describes the data format, location and other properties of the data - * sources. By defining these properties, the data sources can be queried as if they were - * standard BigQuery tables. - */ - @Deprecated - public Builder tableDefinitions(Map tableDefinitions) { - return setTableDefinitions(tableDefinitions); - } /** * Sets the external tables definitions. If querying external data sources outside of BigQuery, @@ -219,15 +194,6 @@ public Builder addTableDefinition(String tableName, ExternalTableDefinition tabl return this; } - /** - * Sets user defined function resources that can be used by this query. Function resources - * can either be defined inline ({@link UserDefinedFunction#inline(String)}) or loaded from - * a Google Cloud Storage URI ({@link UserDefinedFunction#fromUri(String)}. - */ - @Deprecated - public Builder userDefinedFunctions(List userDefinedFunctions) { - return setUserDefinedFunctions(userDefinedFunctions); - } /** * Sets user defined function resources that can be used by this query. Function resources @@ -240,16 +206,6 @@ public Builder setUserDefinedFunctions(List userDefinedFunc return this; } - /** - * Sets whether the job is allowed to create tables. - * - * @see - * Create Disposition - */ - @Deprecated - public Builder createDisposition(CreateDisposition createDisposition) { - return setCreateDisposition(createDisposition); - } /** * Sets whether the job is allowed to create tables. @@ -262,16 +218,6 @@ public Builder setCreateDisposition(CreateDisposition createDisposition) { return this; } - /** - * Sets the action that should occur if the destination table already exists. - * - * @see - * Write Disposition - */ - @Deprecated - public Builder writeDisposition(WriteDisposition writeDisposition) { - return setWriteDisposition(writeDisposition); - } /** * Sets the action that should occur if the destination table already exists. @@ -284,14 +230,6 @@ public Builder setWriteDisposition(WriteDisposition writeDisposition) { return this; } - /** - * Sets the default dataset. This dataset is used for all unqualified table names used in the - * query. - */ - @Deprecated - public Builder defaultDataset(DatasetId defaultDataset) { - return setDefaultDataset(defaultDataset); - } /** * Sets the default dataset. This dataset is used for all unqualified table names used in the @@ -302,14 +240,6 @@ public Builder setDefaultDataset(DatasetId defaultDataset) { return this; } - /** - * Sets the default dataset. This dataset is used for all unqualified table names used in the - * query. - */ - @Deprecated - public Builder defaultDataset(String defaultDataset) { - return setDefaultDataset(DatasetId.of(defaultDataset)); - } /** * Sets the default dataset. This dataset is used for all unqualified table names used in the @@ -319,14 +249,6 @@ public Builder setDefaultDataset(String defaultDataset) { return setDefaultDataset(DatasetId.of(defaultDataset)); } - /** - * Sets a priority for the query. If not specified the priority is assumed to be - * {@link Priority#INTERACTIVE}. - */ - @Deprecated - public Builder priority(Priority priority) { - return setPriority(priority); - } /** * Sets a priority for the query. If not specified the priority is assumed to be @@ -337,23 +259,11 @@ public Builder setPriority(Priority priority) { return this; } - /** - * Sets whether the job is enabled to create arbitrarily large results. If {@code true} - * the query is allowed to create large results at a slight cost in performance. If {@code true} - * {@link Builder#destinationTable(TableId)} must be provided. - * - * @see - * Returning Large Query Results - */ - @Deprecated - public Builder allowLargeResults(Boolean allowLargeResults) { - return setAllowLargeResults(allowLargeResults); - } /** * Sets whether the job is enabled to create arbitrarily large results. If {@code true} * the query is allowed to create large results at a slight cost in performance. If {@code true} - * {@link Builder#destinationTable(TableId)} must be provided. + * {@link Builder#setDestinationTable(TableId)} must be provided. * * @see * Returning Large Query Results @@ -363,22 +273,11 @@ public Builder setAllowLargeResults(Boolean allowLargeResults) { return this; } - /** - * Sets whether to look for the result in the query cache. The query cache is a best-effort - * cache that will be flushed whenever tables in the query are modified. Moreover, the query - * cache is only available when {@link Builder#destinationTable(TableId)} is not set. - * - * @see Query Caching - */ - @Deprecated - public Builder useQueryCache(Boolean useQueryCache) { - return setUseQueryCache(useQueryCache); - } /** * Sets whether to look for the result in the query cache. The query cache is a best-effort * cache that will be flushed whenever tables in the query are modified. Moreover, the query - * cache is only available when {@link Builder#destinationTable(TableId)} is not set. + * cache is only available when {@link Builder#setDestinationTable(TableId)} is not set. * * @see Query Caching */ @@ -387,21 +286,10 @@ public Builder setUseQueryCache(Boolean useQueryCache) { return this; } - /** - * Sets whether nested and repeated fields should be flattened. If set to {@code false} - * {@link Builder#allowLargeResults(Boolean)} must be {@code true}. By default results are - * flattened. - * - * @see Flatten - */ - @Deprecated - public Builder flattenResults(Boolean flattenResults) { - return setFlattenResults(flattenResults); - } /** * Sets whether nested and repeated fields should be flattened. If set to {@code false} - * {@link Builder#allowLargeResults(Boolean)} must be {@code true}. By default results are + * {@link Builder#setAllowLargeResults(Boolean)} must be {@code true}. By default results are * flattened. * * @see Flatten @@ -411,15 +299,6 @@ public Builder setFlattenResults(Boolean flattenResults) { return this; } - /** - * Sets whether the job has to be dry run or not. If set, the job is not executed. A valid query - * will return a mostly empty response with some processing statistics, while an invalid query - * will return the same error it would if it wasn't a dry run. - */ - @Deprecated - public Builder dryRun(Boolean dryRun) { - return setDryRun(dryRun); - } /** * Sets whether the job has to be dry run or not. If set, the job is not executed. A valid query @@ -431,27 +310,14 @@ public Builder setDryRun(Boolean dryRun) { return this; } - /** - * Sets whether to use BigQuery's legacy SQL dialect for this query. If set to {@code false}, - * the query will use BigQuery's - * Standard SQL. When set to {@code false}, the values of - * {@link #allowLargeResults(Boolean)} and {@link #flattenResults(Boolean)} are ignored; query - * will be run as if {@link #allowLargeResults(Boolean)} is {@code true} and - * {@link #flattenResults(Boolean)} is {@code false}. If not set, legacy SQL dialect is used. - * This property is experimental and might be subject to change. - */ - @Deprecated - public Builder useLegacySql(Boolean useLegacySql) { - return setUseLegacySql(useLegacySql); - } /** * Sets whether to use BigQuery's legacy SQL dialect for this query. If set to {@code false}, * the query will use BigQuery's * Standard SQL. When set to {@code false}, the values of - * {@link #allowLargeResults(Boolean)} and {@link #flattenResults(Boolean)} are ignored; query - * will be run as if {@link #allowLargeResults(Boolean)} is {@code true} and - * {@link #flattenResults(Boolean)} is {@code false}. If not set, legacy SQL dialect is used. + * {@link #setAllowLargeResults(Boolean)} and {@link #setFlattenResults(Boolean)} are ignored; query + * will be run as if {@link #setAllowLargeResults(Boolean)} is {@code true} and + * {@link #setFlattenResults(Boolean)} is {@code false}. If not set, legacy SQL dialect is used. * This property is experimental and might be subject to change. */ public Builder setUseLegacySql(Boolean useLegacySql) { @@ -494,16 +360,6 @@ public Boolean allowLargeResults() { return allowLargeResults; } - /** - * Returns whether the job is allowed to create new tables. - * - * @see - * Create Disposition - */ - @Deprecated - public CreateDisposition createDisposition() { - return getCreateDisposition(); - } /** * Returns whether the job is allowed to create new tables. @@ -515,14 +371,6 @@ public CreateDisposition getCreateDisposition() { return createDisposition; } - /** - * Returns the default dataset. This dataset is used for all unqualified table names used in the - * query. - */ - @Deprecated - public DatasetId defaultDataset() { - return getDefaultDataset(); - } /** * Returns the default dataset. This dataset is used for all unqualified table names used in the @@ -532,14 +380,6 @@ public DatasetId getDefaultDataset() { return defaultDataset; } - /** - * Returns the table where to put query results. If not provided a new table is created. This - * value is required if {@link #allowLargeResults()} is {@code true}. - */ - @Deprecated - public TableId destinationTable() { - return getDestinationTable(); - } /** * Returns the table where to put query results. If not provided a new table is created. This @@ -551,7 +391,7 @@ public TableId getDestinationTable() { /** * Returns whether nested and repeated fields should be flattened. If set to {@code false} - * {@link Builder#allowLargeResults(Boolean)} must be {@code true}. + * {@link Builder#setAllowLargeResults(Boolean)} must be {@code true}. * * @see Flatten */ @@ -559,13 +399,6 @@ public Boolean flattenResults() { return flattenResults; } - /** - * Returns the query priority. - */ - @Deprecated - public Priority priority() { - return getPriority(); - } /** * Returns the query priority. @@ -574,13 +407,6 @@ public Priority getPriority() { return priority; } - /** - * Returns the Google BigQuery SQL query. - */ - @Deprecated - public String query() { - return getQuery(); - } /** * Returns the Google BigQuery SQL query. @@ -589,16 +415,6 @@ public String getQuery() { return query; } - /** - * Returns the external tables definitions. If querying external data sources outside of BigQuery, - * this value describes the data format, location and other properties of the data - * sources. By defining these properties, the data sources can be queried as if they were - * standard BigQuery tables. - */ - @Deprecated - public Map tableDefinitions() { - return getTableDefinitions(); - } /** * Returns the external tables definitions. If querying external data sources outside of BigQuery, @@ -613,7 +429,7 @@ public Map getTableDefinitions() { /** * Returns whether to look for the result in the query cache. The query cache is a best-effort * cache that will be flushed whenever tables in the query are modified. Moreover, the query - * cache is only available when {@link Builder#destinationTable(TableId)} is not set. + * cache is only available when {@link Builder#setDestinationTable(TableId)} is not set. * * @see Query Caching */ @@ -621,15 +437,6 @@ public Boolean useQueryCache() { return useQueryCache; } - /** - * Returns user defined function resources that can be used by this query. Function resources - * can either be defined inline ({@link UserDefinedFunction.Type#INLINE}) or loaded from - * a Google Cloud Storage URI ({@link UserDefinedFunction.Type#FROM_URI}. - */ - @Deprecated - public List userDefinedFunctions() { - return getUserDefinedFunctions(); - } /** * Returns user defined function resources that can be used by this query. Function resources @@ -640,16 +447,6 @@ public List getUserDefinedFunctions() { return userDefinedFunctions; } - /** - * Returns the action that should occur if the destination table already exists. - * - * @see - * Write Disposition - */ - @Deprecated - public WriteDisposition writeDisposition() { - return getWriteDisposition(); - } /** * Returns the action that should occur if the destination table already exists. @@ -776,13 +573,6 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { return configurationPb.setQuery(queryConfigurationPb); } - /** - * Creates a builder for a BigQuery Query Job given the query to be run. - */ - @Deprecated - public static Builder builder(String query) { - return newBuilder(query); - } /** * Creates a builder for a BigQuery Query Job given the query to be run. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequest.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequest.java index d0197e484532..8848b593afc4 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequest.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequest.java @@ -98,13 +98,6 @@ public static final class Builder { private Builder() {} - /** - * Sets the BigQuery query to be executed. - */ - @Deprecated - public Builder query(String query) { - return setQuery(query); - } /** * Sets the BigQuery query to be executed. @@ -196,16 +189,6 @@ public Builder setNamedParameters(Map values) { return this; } - /** - * Sets the maximum number of rows of data to return per page of results. Setting this flag to a - * small value such as 1000 and then paging through results might improve reliability when the - * query result set is large. In addition to this limit, responses are also limited to 10 MB. - * By default, there is no maximum row count, and only the byte limit applies. - */ - @Deprecated - public Builder pageSize(Long pageSize) { - return setPageSize(pageSize); - } /** * Sets the maximum number of rows of data to return per page of results. Setting this flag to a @@ -218,13 +201,6 @@ public Builder setPageSize(Long pageSize) { return this; } - /** - * Sets the default dataset to assume for any unqualified table names in the query. - */ - @Deprecated - public Builder defaultDataset(DatasetId defaultDataset) { - return setDefaultDataset(defaultDataset); - } /** * Sets the default dataset to assume for any unqualified table names in the query. @@ -234,13 +210,6 @@ public Builder setDefaultDataset(DatasetId defaultDataset) { return this; } - /** - * Sets the default dataset to assume for any unqualified table names in the query. - */ - @Deprecated - public Builder defaultDataset(String defaultDataset) { - return setDefaultDataset(DatasetId.of(defaultDataset)); - } /** * Sets the default dataset to assume for any unqualified table names in the query. @@ -249,17 +218,6 @@ public Builder setDefaultDataset(String defaultDataset) { return setDefaultDataset(DatasetId.of(defaultDataset)); } - /** - * Sets how long to wait for the query to complete, in milliseconds, before the request times - * out and returns. Note that this is only a timeout for the request, not the query. If the - * query takes longer to run than the timeout value, the call returns without any results and - * with the {@link QueryResponse#jobCompleted()} set to {@code false}. If not set, a wait time - * of 10000 milliseconds (10 seconds) is used. - */ - @Deprecated - public Builder maxWaitTime(Long maxWaitTime) { - return setMaxWaitTime(maxWaitTime); - } /** * Sets how long to wait for the query to complete, in milliseconds, before the request times @@ -273,15 +231,6 @@ public Builder setMaxWaitTime(Long maxWaitTime) { return this; } - /** - * Sets whether the query has to be dry run or not. If set, the query is not executed. If the - * query is valid statistics are returned on how many bytes would be processed. If the query is - * invalid an error is returned. If not set the query is executed. - */ - @Deprecated - public Builder dryRun(Boolean dryRun) { - return setDryRun(dryRun); - } /** * Sets whether the query has to be dry run or not. If set, the query is not executed. If the @@ -293,17 +242,6 @@ public Builder setDryRun(Boolean dryRun) { return this; } - /** - * Sets whether to look for the result in the query cache. The query cache is a best-effort - * cache that will be flushed whenever tables in the query are modified. If not specified the - * query cache is used. - * - * @see Query Caching - */ - @Deprecated - public Builder useQueryCache(Boolean useQueryCache) { - return setUseQueryCache(useQueryCache); - } /** * Sets whether to look for the result in the query cache. The query cache is a best-effort @@ -317,16 +255,6 @@ public Builder setUseQueryCache(Boolean useQueryCache) { return this; } - /** - * Sets whether to use BigQuery's legacy SQL dialect for this query. If set to {@code false}, - * the query will use BigQuery's - * Standard SQL. If not set, legacy SQL dialect is used. This property is experimental and - * might be subject to change. - */ - @Deprecated - public Builder useLegacySql(Boolean useLegacySql) { - return setUseLegacySql(useLegacySql); - } /** * Sets whether to use BigQuery's legacy SQL dialect for this query. If set to {@code false}, @@ -364,13 +292,6 @@ private QueryRequest(Builder builder) { useLegacySql = builder.useLegacySql; } - /** - * Sets the BigQuery query to be executed. - */ - @Deprecated - public String query() { - return getQuery(); - } /** * Sets the BigQuery query to be executed. @@ -393,13 +314,6 @@ public Map getNamedParameters() { return namedParameters; } - /** - * Returns the maximum number of rows of data to return per page of results. - */ - @Deprecated - public Long pageSize() { - return getPageSize(); - } /** * Returns the maximum number of rows of data to return per page of results. @@ -408,13 +322,6 @@ public Long getPageSize() { return pageSize; } - /** - * Returns the default dataset to assume for any unqualified table names in the query. - */ - @Deprecated - public DatasetId defaultDataset() { - return getDefaultDataset(); - } /** * Returns the default dataset to assume for any unqualified table names in the query. @@ -423,19 +330,6 @@ public DatasetId getDefaultDataset() { return defaultDataset; } - /** - * Returns how long to wait for the query to complete, in milliseconds, before the request times - * out and returns. Note that this is only a timeout for the request, not the query. If the - * query takes longer to run than the timeout value, the call returns without any results and - * with the {@link QueryResponse#jobCompleted()} set to {@code false}. You can call - * {@link BigQuery#getQueryResults(JobId, BigQuery.QueryResultsOption...)} to wait for the query - * to complete and read the results. If not set, a wait time of 10000 milliseconds (10 seconds) - * is used. - */ - @Deprecated - public Long maxWaitTime() { - return getMaxWaitTime(); - } /** * Returns how long to wait for the query to complete, in milliseconds, before the request times @@ -573,13 +467,6 @@ com.google.api.services.bigquery.model.QueryRequest toPb() { return queryRequestPb; } - /** - * Creates a builder for a {@code QueryRequest} given the BigQuery SQL query to be executed. - */ - @Deprecated - public static Builder builder(String query) { - return newBuilder(query); - } /** * Creates a builder for a {@code QueryRequest} given the BigQuery SQL query to be executed. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryResponse.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryResponse.java index 2ae44d8cef56..fce8a34ad79e 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryResponse.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryResponse.java @@ -108,14 +108,6 @@ private QueryResponse(Builder builder) { : ImmutableList.of(); } - /** - * Returns the result of the query. Returns {@code null} if {@link #jobCompleted()} is {@code - * false}. - */ - @Deprecated - public QueryResult result() { - return getResult(); - } /** * Returns the result of the query. Returns {@code null} if {@link #jobCompleted()} is {@code @@ -125,13 +117,6 @@ public QueryResult getResult() { return result; } - /** - * Returns the hash of the {@code QueryResponse} resource or {@code null} if not set. - */ - @Deprecated - public String etag() { - return getEtag(); - } /** * Returns the hash of the {@code QueryResponse} resource or {@code null} if not set. @@ -140,14 +125,6 @@ public String getEtag() { return etag; } - /** - * Returns the identity of the BigQuery Job that was created to run the query. This field will be - * present even if the original request timed out. - */ - @Deprecated - public JobId jobId() { - return getJobId(); - } /** * Returns the identity of the BigQuery Job that was created to run the query. This field will be @@ -158,9 +135,9 @@ public JobId getJobId() { } /** - * Returns whether the job running the query has completed or not. If {@link #result()} is not + * Returns whether the job running the query has completed or not. If {@link #getResult()} is not * {@code null}, this method will always return {@code true}. If this method returns {@code false} - * {@link #result()} returns {@code null}. This method can be used to check if query execution + * {@link #getResult()} returns {@code null}. This method can be used to check if query execution * completed and results are available. */ public boolean jobCompleted() { @@ -176,14 +153,6 @@ public boolean hasErrors() { return !executionErrors.isEmpty(); } - /** - * Returns errors and warnings encountered during the running of the job, if any. Errors here do - * not necessarily mean that the job has completed or was unsuccessful. - */ - @Deprecated - public List executionErrors() { - return getExecutionErrors(); - } /** * Returns errors and warnings encountered during the running of the job, if any. Errors here do diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryResult.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryResult.java index d01b2afb24d5..58efecf5a7c4 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryResult.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryResult.java @@ -33,9 +33,6 @@ public class QueryResult extends PageImpl> { private final long totalBytesProcessed; interface QueryResultsPageFetcher extends PageImpl.NextPageFetcher> { - @Override - @Deprecated - QueryResult nextPage(); @Override QueryResult getNextPage(); @@ -111,13 +108,6 @@ public boolean cacheHit() { return cacheHit; } - /** - * Returns the schema of the results. This is present only when the query completes successfully. - */ - @Deprecated - public Schema schema() { - return getSchema(); - } /** * Returns the schema of the results. This is present only when the query completes successfully. @@ -126,14 +116,6 @@ public Schema getSchema() { return schema; } - /** - * Returns the total number of bytes processed for the query. If this query was a dry run, this is - * the number of bytes that would be processed if the query were run. - */ - @Deprecated - public long totalBytesProcessed() { - return getTotalBytesProcessed(); - } /** * Returns the total number of bytes processed for the query. If this query was a dry run, this is @@ -143,30 +125,16 @@ public long getTotalBytesProcessed() { return totalBytesProcessed; } - /** - * Returns the total number of rows in the complete query result set, which can be more than the - * number of rows in the first page of results returned by {@link #values()}. Returns {@code 0} - * if the query was a dry run. - */ - @Deprecated - public long totalRows() { - return getTotalRows(); - } /** * Returns the total number of rows in the complete query result set, which can be more than the - * number of rows in the first page of results returned by {@link #values()}. Returns {@code 0} + * number of rows in the first page of results returned by {@link #getValues()}. Returns {@code 0} * if the query was a dry run. */ public long getTotalRows() { return totalRows; } - @Override - @Deprecated - public QueryResult nextPage() { - return getNextPage(); - } @Override public QueryResult getNextPage() { diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryStage.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryStage.java index 258a6efd034e..937781521316 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryStage.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryStage.java @@ -86,16 +86,6 @@ public ExplainQueryStep apply(QueryStep stage) { this.substeps = substeps; } - /** - * Returns a machine-readable name for the operation. - * - * @see Steps - * Metadata - */ - @Deprecated - public String name() { - return getName(); - } /** * Returns a machine-readable name for the operation. @@ -107,13 +97,6 @@ public String getName() { return name; } - /** - * Returns a list of human-readable stage descriptions. - */ - @Deprecated - public List substeps() { - return getSubsteps(); - } /** * Returns a list of human-readable stage descriptions. @@ -272,14 +255,6 @@ QueryStage build() { writeRatioMax = builder.writeRatioMax; } - /** - * Returns the time the average worker spent CPU-bound, divided by the longest time spent by any - * worker in any segment. - */ - @Deprecated - public double computeRatioAvg() { - return getComputeRatioAvg(); - } /** * Returns the time the average worker spent CPU-bound, divided by the longest time spent by any @@ -289,14 +264,6 @@ public double getComputeRatioAvg() { return computeRatioAvg; } - /** - * Returns the time the slowest worker spent CPU-bound, divided by the longest time spent by any - * worker in any segment. - */ - @Deprecated - public double computeRatioMax() { - return getComputeRatioMax(); - } /** * Returns the time the slowest worker spent CPU-bound, divided by the longest time spent by any @@ -306,13 +273,6 @@ public double getComputeRatioMax() { return computeRatioMax; } - /** - * Returns a unique, server-generated ID for the stage within its plan. - */ - @Deprecated - public long generatedId() { - return getGeneratedId(); - } /** * Returns a unique, server-generated ID for the stage within its plan. @@ -321,13 +281,6 @@ public long getGeneratedId() { return generatedId; } - /** - * Returns a human-readable name for the stage. - */ - @Deprecated - public String name() { - return getName(); - } /** * Returns a human-readable name for the stage. @@ -336,14 +289,6 @@ public String getName() { return name; } - /** - * Returns the time the average worker spent reading input data, divided by the longest time spent - * by any worker in any segment. - */ - @Deprecated - public double readRatioAvg() { - return getReadRatioAvg(); - } /** * Returns the time the average worker spent reading input data, divided by the longest time spent @@ -353,14 +298,6 @@ public double getReadRatioAvg() { return readRatioAvg; } - /** - * Returns the time the slowest worker spent reading input data, divided by the longest time spent - * by any worker in any segment. - */ - @Deprecated - public double readRatioMax() { - return getReadRatioMax(); - } /** * Returns the time the slowest worker spent reading input data, divided by the longest time spent @@ -370,13 +307,6 @@ public double getReadRatioMax() { return readRatioMax; } - /** - * Returns the number of rows (top-level records) read by the stage. - */ - @Deprecated - public long recordsRead() { - return getRecordsRead(); - } /** * Returns the number of rows (top-level records) read by the stage. @@ -385,13 +315,6 @@ public long getRecordsRead() { return recordsRead; } - /** - * Returns the number of rows (top-level records) written by the stage. - */ - @Deprecated - public long recordsWritten() { - return getRecordsWritten(); - } /** * Returns the number of rows (top-level records) written by the stage. @@ -400,13 +323,6 @@ public long getRecordsWritten() { return recordsWritten; } - /** - * Returns the list of steps within the stage in dependency order (approximately chronological). - */ - @Deprecated - public List steps() { - return getSteps(); - } /** * Returns the list of steps within the stage in dependency order (approximately chronological). @@ -415,14 +331,6 @@ public List getSteps() { return steps; } - /** - * Returns the time the average worker spent waiting to be scheduled, divided by the longest time - * spent by any worker in any segment. - */ - @Deprecated - public double waitRatioAvg() { - return getWaitRatioAvg(); - } /** * Returns the time the average worker spent waiting to be scheduled, divided by the longest time @@ -432,14 +340,6 @@ public double getWaitRatioAvg() { return waitRatioAvg; } - /** - * Returns the time the slowest worker spent waiting to be scheduled, divided by the longest time - * spent by any worker in any segment. - */ - @Deprecated - public double waitRatioMax() { - return getWaitRatioMax(); - } /** * Returns the time the slowest worker spent waiting to be scheduled, divided by the longest time @@ -449,14 +349,6 @@ public double getWaitRatioMax() { return waitRatioMax; } - /** - * Returns the time the average worker spent writing output data, divided by the longest time - * spent by any worker in any segment. - */ - @Deprecated - public double writeRatioAvg() { - return getWriteRatioAvg(); - } /** * Returns the time the average worker spent writing output data, divided by the longest time @@ -466,14 +358,6 @@ public double getWriteRatioAvg() { return writeRatioAvg; } - /** - * Returns the time the slowest worker spent writing output data, divided by the longest time - * spent by any worker in any segment. - */ - @Deprecated - public double writeRatioMax() { - return getWriteRatioMax(); - } /** * Returns the time the slowest worker spent writing output data, divided by the longest time diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Schema.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Schema.java index 5ca667af63b9..34e2936d782e 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Schema.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Schema.java @@ -71,13 +71,6 @@ public Builder addField(Field field) { return this; } - /** - * Sets table's schema fields. - */ - @Deprecated - public Builder fields(Iterable fields) { - return setFields(fields); - } /** * Sets table's schema fields. @@ -87,13 +80,6 @@ public Builder setFields(Iterable fields) { return this; } - /** - * Sets table's schema fields. - */ - @Deprecated - public Builder fields(Field... fields) { - return setFields(fields); - } /** * Sets table's schema fields. @@ -116,13 +102,6 @@ private Schema(Builder builder) { : ImmutableList.of(); } - /** - * Returns the fields in the current table schema. - */ - @Deprecated - public List fields() { - return getFields(); - } /** * Returns the fields in the current table schema. @@ -167,13 +146,6 @@ com.google.api.services.bigquery.model.TableSchema toPb() { return tableSchemaPb; } - /** - * Creates a builder for a {@code Schema} object. - */ - @Deprecated - public static Builder builder() { - return newBuilder(); - } /** * Creates a builder for a {@code Schema} object. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java index 871d84f962fe..f621b5db178e 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java @@ -61,13 +61,6 @@ public static class StreamingBuffer implements Serializable { this.oldestEntryTime = oldestEntryTime; } - /** - * Returns a lower-bound estimate of the number of rows currently in the streaming buffer. - */ - @Deprecated - public long estimatedRows() { - return getEstimatedRows(); - } /** * Returns a lower-bound estimate of the number of rows currently in the streaming buffer. @@ -76,13 +69,6 @@ public long getEstimatedRows() { return estimatedRows; } - /** - * Returns a lower-bound estimate of the number of bytes currently in the streaming buffer. - */ - @Deprecated - public long estimatedBytes() { - return getEstimatedBytes(); - } /** * Returns a lower-bound estimate of the number of bytes currently in the streaming buffer. @@ -91,14 +77,6 @@ public long getEstimatedBytes() { return estimatedBytes; } - /** - * Returns the timestamp of the oldest entry in the streaming buffer, in milliseconds since - * epoch. Returns {@code null} if the streaming buffer is empty. - */ - @Deprecated - public Long oldestEntryTime() { - return getOldestEntryTime(); - } /** * Returns the timestamp of the oldest entry in the streaming buffer, in milliseconds since @@ -203,14 +181,6 @@ Builder setStreamingBuffer(StreamingBuffer streamingBuffer) { return self(); } - /** - * Sets the time partitioning configuration for the table. If not set, the table is not - * time-partitioned. - */ - @Deprecated - public Builder timePartitioning(TimePartitioning timePartitioning) { - return setTimePartitioning(timePartitioning); - } /** * Sets the time partitioning configuration for the table. If not set, the table is not @@ -239,13 +209,6 @@ private StandardTableDefinition(Builder builder) { this.timePartitioning = builder.timePartitioning; } - /** - * Returns the size of this table in bytes, excluding any data in the streaming buffer. - */ - @Deprecated - public Long numBytes() { - return getNumBytes(); - } /** * Returns the size of this table in bytes, excluding any data in the streaming buffer. @@ -254,13 +217,6 @@ public Long getNumBytes() { return numBytes; } - /** - * Returns the number of rows in this table, excluding any data in the streaming buffer. - */ - @Deprecated - public Long numRows() { - return getNumRows(); - } /** * Returns the number of rows in this table, excluding any data in the streaming buffer. @@ -269,17 +225,6 @@ public Long getNumRows() { return numRows; } - /** - * Returns the geographic location where the table should reside. This value is inherited from the - * dataset. - * - * @see - * Dataset Location - */ - @Deprecated - public String location() { - return getLocation(); - } /** * Returns the geographic location where the table should reside. This value is inherited from the @@ -292,14 +237,6 @@ public String getLocation() { return location; } - /** - * Returns information on the table's streaming buffer if any exists. Returns {@code null} if no - * streaming buffer exists. - */ - @Deprecated - public StreamingBuffer streamingBuffer() { - return getStreamingBuffer(); - } /** * Returns information on the table's streaming buffer if any exists. Returns {@code null} if no @@ -309,14 +246,6 @@ public StreamingBuffer getStreamingBuffer() { return streamingBuffer; } - /** - * Returns the time partitioning configuration for this table. If {@code null}, the table is not - * time-partitioned. - */ - @Deprecated - public TimePartitioning timePartitioning() { - return getTimePartitioning(); - } /** * Returns the time partitioning configuration for this table. If {@code null}, the table is not @@ -326,13 +255,6 @@ public TimePartitioning getTimePartitioning() { return timePartitioning; } - /** - * Returns a builder for a BigQuery standard table definition. - */ - @Deprecated - public static Builder builder() { - return newBuilder(); - } /** * Returns a builder for a BigQuery standard table definition. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java index 154f853a363c..27a99c0deb36 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java @@ -70,11 +70,6 @@ Builder setCreationTime(Long creationTime) { return this; } - @Override - @Deprecated - public Builder description(String description) { - return setDescription(description); - } @Override public Builder setDescription(String description) { @@ -88,11 +83,6 @@ Builder setEtag(String etag) { return this; } - @Override - @Deprecated - public Builder expirationTime(Long expirationTime) { - return setExpirationTime(expirationTime); - } @Override public Builder setExpirationTime(Long expirationTime) { @@ -100,11 +90,6 @@ public Builder setExpirationTime(Long expirationTime) { return this; } - @Override - @Deprecated - public Builder friendlyName(String friendlyName) { - return setFriendlyName(friendlyName); - } @Override public Builder setFriendlyName(String friendlyName) { @@ -130,11 +115,6 @@ Builder setSelfLink(String selfLink) { return this; } - @Override - @Deprecated - public Builder tableId(TableId tableId) { - return setTableId(tableId); - } @Override public Builder setTableId(TableId tableId) { @@ -142,11 +122,6 @@ public Builder setTableId(TableId tableId) { return this; } - @Override - @Deprecated - public Builder definition(TableDefinition definition) { - return setDefinition(definition); - } @Override public Builder setDefinition(TableDefinition definition) { @@ -544,13 +519,6 @@ public Job load(FormatOptions format, List sourceUris, JobOption... opti return bigquery.create(JobInfo.of(loadConfig), options); } - /** - * Returns the table's {@code BigQuery} object used to issue requests. - */ - @Deprecated - public BigQuery bigquery() { - return getBigquery(); - } /** * Returns the table's {@code BigQuery} object used to issue requests. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDefinition.java index ec947bfe9c79..324e527e0e64 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDefinition.java @@ -99,13 +99,6 @@ B setType(Type type) { return self(); } - /** - * Sets the table schema. - */ - @Deprecated - public B schema(Schema schema) { - return setSchema(schema); - } /** * Sets the table schema. @@ -126,15 +119,6 @@ public B setSchema(Schema schema) { this.schema = builder.schema; } - /** - * Returns the table's type. If this table is simple table the method returns {@link Type#TABLE}. - * If this table is an external table this method returns {@link Type#EXTERNAL}. If this table is - * a view table this method returns {@link Type#VIEW}. - */ - @Deprecated - public Type type() { - return getType(); - } /** * Returns the table's type. If this table is simple table the method returns {@link Type#TABLE}. @@ -145,13 +129,6 @@ public Type getType() { return type; } - /** - * Returns the table's schema. - */ - @Deprecated - public Schema schema() { - return getSchema(); - } /** * Returns the table's schema. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableId.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableId.java index d2d3506394b5..eb5bf6eacdeb 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableId.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableId.java @@ -49,13 +49,6 @@ public TableReference apply(TableId tableId) { private final String dataset; private final String table; - /** - * Returns project's user-defined id. - */ - @Deprecated - public String project() { - return getProject(); - } /** * Returns project's user-defined id. @@ -64,13 +57,6 @@ public String getProject() { return project; } - /** - * Returns dataset's user-defined id. - */ - @Deprecated - public String dataset() { - return getDataset(); - } /** * Returns dataset's user-defined id. @@ -79,13 +65,6 @@ public String getDataset() { return dataset; } - /** - * Returns table's user-defined id. - */ - @Deprecated - public String table() { - return getTable(); - } /** * Returns table's user-defined id. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java index 80e7f465c8fb..97a8f90b4984 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java @@ -72,11 +72,6 @@ public abstract static class Builder { abstract Builder setCreationTime(Long creationTime); - /** - * Sets a user-friendly description for the table. - */ - @Deprecated - public abstract Builder description(String description); /** * Sets a user-friendly description for the table. @@ -85,12 +80,6 @@ public abstract static class Builder { abstract Builder setEtag(String etag); - /** - * Sets the time when this table expires, in milliseconds since the epoch. If not present, the - * table will persist indefinitely. Expired tables will be deleted and their storage reclaimed. - */ - @Deprecated - public abstract Builder expirationTime(Long expirationTime); /** * Sets the time when this table expires, in milliseconds since the epoch. If not present, the @@ -98,11 +87,6 @@ public abstract static class Builder { */ public abstract Builder setExpirationTime(Long expirationTime); - /** - * Sets a user-friendly name for the table. - */ - @Deprecated - public abstract Builder friendlyName(String friendlyName); /** * Sets a user-friendly name for the table. @@ -115,24 +99,12 @@ public abstract static class Builder { abstract Builder setSelfLink(String selfLink); - /** - * Sets the table identity. - */ - @Deprecated - public abstract Builder tableId(TableId tableId); /** * Sets the table identity. */ public abstract Builder setTableId(TableId tableId); - /** - * Sets the table definition. Use {@link StandardTableDefinition} to create simple BigQuery - * table. Use {@link ViewDefinition} to create a BigQuery view. Use - * {@link ExternalTableDefinition} to create a BigQuery a table backed by external data. - */ - @Deprecated - public abstract Builder definition(TableDefinition definition); /** * Sets the table definition. Use {@link StandardTableDefinition} to create simple BigQuery @@ -196,11 +168,6 @@ Builder setCreationTime(Long creationTime) { return this; } - @Override - @Deprecated - public Builder description(String description) { - return setDescription(description); - } @Override public Builder setDescription(String description) { @@ -214,11 +181,6 @@ Builder setEtag(String etag) { return this; } - @Override - @Deprecated - public Builder expirationTime(Long expirationTime) { - return setExpirationTime(expirationTime); - } @Override public Builder setExpirationTime(Long expirationTime) { @@ -226,11 +188,6 @@ public Builder setExpirationTime(Long expirationTime) { return this; } - @Override - @Deprecated - public Builder friendlyName(String friendlyName) { - return setFriendlyName(friendlyName); - } @Override public Builder setFriendlyName(String friendlyName) { @@ -256,11 +213,6 @@ Builder setSelfLink(String selfLink) { return this; } - @Override - @Deprecated - public Builder tableId(TableId tableId) { - return setTableId(tableId); - } @Override public Builder setTableId(TableId tableId) { @@ -268,11 +220,6 @@ public Builder setTableId(TableId tableId) { return this; } - @Override - @Deprecated - public Builder definition(TableDefinition definition) { - return setDefinition(definition); - } @Override public Builder setDefinition(TableDefinition definition) { @@ -299,13 +246,6 @@ public TableInfo build() { this.definition = builder.definition; } - /** - * Returns the hash of the table resource. - */ - @Deprecated - public String etag() { - return getEtag(); - } /** * Returns the hash of the table resource. @@ -314,13 +254,6 @@ public String getEtag() { return etag; } - /** - * Returns the service-generated id for the table. - */ - @Deprecated - public String generatedId() { - return getGeneratedId(); - } /** * Returns the service-generated id for the table. @@ -329,14 +262,6 @@ public String getGeneratedId() { return generatedId; } - /** - * Returns an URL that can be used to access the resource again. The returned URL can be used for - * get or update requests. - */ - @Deprecated - public String selfLink() { - return getSelfLink(); - } /** * Returns an URL that can be used to access the resource again. The returned URL can be used for @@ -346,13 +271,6 @@ public String getSelfLink() { return selfLink; } - /** - * Returns the table identity. - */ - @Deprecated - public TableId tableId() { - return getTableId(); - } /** * Returns the table identity. @@ -361,13 +279,6 @@ public TableId getTableId() { return tableId; } - /** - * Returns a user-friendly name for the table. - */ - @Deprecated - public String friendlyName() { - return getFriendlyName(); - } /** * Returns a user-friendly name for the table. @@ -376,13 +287,6 @@ public String getFriendlyName() { return Data.isNull(friendlyName) ? null : friendlyName; } - /** - * Returns a user-friendly description for the table. - */ - @Deprecated - public String description() { - return getDescription(); - } /** * Returns a user-friendly description for the table. @@ -391,13 +295,6 @@ public String getDescription() { return Data.isNull(description) ? null : description; } - /** - * Returns the time when this table was created, in milliseconds since the epoch. - */ - @Deprecated - public Long creationTime() { - return getCreationTime(); - } /** * Returns the time when this table was created, in milliseconds since the epoch. @@ -406,14 +303,6 @@ public Long getCreationTime() { return creationTime; } - /** - * Returns the time when this table expires, in milliseconds since the epoch. If not present, the - * table will persist indefinitely. Expired tables will be deleted and their storage reclaimed. - */ - @Deprecated - public Long expirationTime() { - return getExpirationTime(); - } /** * Returns the time when this table expires, in milliseconds since the epoch. If not present, the @@ -423,13 +312,6 @@ public Long getExpirationTime() { return Data.isNull(expirationTime) ? null : expirationTime; } - /** - * Returns the time when this table was last modified, in milliseconds since the epoch. - */ - @Deprecated - public Long lastModifiedTime() { - return getLastModifiedTime(); - } /** * Returns the time when this table was last modified, in milliseconds since the epoch. @@ -438,14 +320,6 @@ public Long getLastModifiedTime() { return lastModifiedTime; } - /** - * Returns the table definition. - */ - @SuppressWarnings("unchecked") - @Deprecated - public T definition() { - return getDefinition(); - } /** * Returns the table definition. @@ -491,16 +365,6 @@ public boolean equals(Object obj) { && Objects.equals(toPb(), ((TableInfo) obj).toPb()); } - /** - * Returns a builder for a {@code TableInfo} object given table identity and definition. Use - * {@link StandardTableDefinition} to create simple BigQuery table. Use {@link ViewDefinition} to - * create a BigQuery view. Use {@link ExternalTableDefinition} to create a BigQuery a table backed - * by external data. - */ - @Deprecated - public static Builder builder(TableId tableId, TableDefinition definition) { - return newBuilder(tableId, definition); - } /** * Returns a builder for a {@code TableInfo} object given table identity and definition. Use diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TimePartitioning.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TimePartitioning.java index 46f234104cee..20383fd24f70 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TimePartitioning.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TimePartitioning.java @@ -54,14 +54,6 @@ private TimePartitioning(Type type, Long expirationMs) { this.expirationMs = expirationMs; } - /** - * Returns the time partitioning type. Currently, the only type supported is {@link Type#DAY}, - * which will generate one partition per day based on data loading time. - */ - @Deprecated - public Type type() { - return getType(); - } /** * Returns the time partitioning type. Currently, the only type supported is {@link Type#DAY}, @@ -71,14 +63,6 @@ public Type getType() { return type; } - /** - * Returns the number of milliseconds for which to keep the storage for a partition. When expired, - * the storage for the partition is reclaimed. - */ - @Deprecated - public Long expirationMs() { - return getExpirationMs(); - } /** * Returns the number of milliseconds for which to keep the storage for a partition. When expired, diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/UserDefinedFunction.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/UserDefinedFunction.java index bbd32a432bbe..e62e7b6f7081 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/UserDefinedFunction.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/UserDefinedFunction.java @@ -68,13 +68,6 @@ public enum Type { this.content = content; } - /** - * Returns the type of user defined function. - */ - @Deprecated - public Type type() { - return getType(); - } /** * Returns the type of user defined function. @@ -83,18 +76,11 @@ public Type getType() { return type; } - /** - * If {@link #type()} is {@link Type#INLINE} this method returns a code blob. If {@link #type()} - * is {@link Type#FROM_URI} the method returns a Google Cloud Storage URI (e.g. gs://bucket/path). - */ - @Deprecated - public String content() { - return getContent(); - } /** - * If {@link #type()} is {@link Type#INLINE} this method returns a code blob. If {@link #type()} - * is {@link Type#FROM_URI} the method returns a Google Cloud Storage URI (e.g. gs://bucket/path). + * If {@link #getType()} is {@link Type#INLINE} this method returns a code blob. If + * {@link #getType()} is {@link Type#FROM_URI} the method returns a Google Cloud Storage + * URI (e.g. gs://bucket/path). */ public String getContent() { return content; diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ViewDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ViewDefinition.java index fe9d1d1e3396..dc02dea05edc 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ViewDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ViewDefinition.java @@ -67,13 +67,6 @@ private Builder(Table tablePb) { } } - /** - * Sets the query used to create the view. - */ - @Deprecated - public Builder query(String query) { - return setQuery(query); - } /** * Sets the query used to create the view. @@ -83,19 +76,9 @@ public Builder setQuery(String query) { return self(); } - /** - * Sets user defined functions that can be used by {@link #query()}. - * - * @see User-Defined - * Functions - */ - @Deprecated - public Builder userDefinedFunctions(List userDefinedFunctions) { - return setUserDefinedFunctions(userDefinedFunctions); - } /** - * Sets user defined functions that can be used by {@link #query()}. + * Sets user defined functions that can be used by {@link #getQuery()}. * * @see User-Defined * Functions @@ -105,19 +88,9 @@ public Builder setUserDefinedFunctions(List userDefinedFunc return self(); } - /** - * Sets user defined functions that can be used by {@link #query()}. - * - * @see User-Defined - * Functions - */ - @Deprecated - public Builder userDefinedFunctions(UserDefinedFunction... userDefinedFunctions) { - return setUserDefinedFunctions(userDefinedFunctions); - } /** - * Sets user defined functions that can be used by {@link #query()}. + * Sets user defined functions that can be used by {@link #getQuery()}. * * @see User-Defined * Functions @@ -142,13 +115,6 @@ private ViewDefinition(Builder builder) { this.userDefinedFunctions = builder.userDefinedFunctions; } - /** - * Returns the query used to create the view. - */ - @Deprecated - public String query() { - return getQuery(); - } /** * Returns the query used to create the view. @@ -157,20 +123,9 @@ public String getQuery() { return query; } - /** - * Returns user defined functions that can be used by {@link #query()}. Returns {@code null} if - * not set. - * - * @see User-Defined Functions - * - */ - @Deprecated - public List userDefinedFunctions() { - return getUserDefinedFunctions(); - } /** - * Returns user defined functions that can be used by {@link #query()}. Returns {@code null} if + * Returns user defined functions that can be used by {@link #getQuery()}. Returns {@code null} if * not set. * * @see User-Defined Functions @@ -221,15 +176,6 @@ Table toPb() { return tablePb; } - /** - * Returns a builder for a BigQuery view definition. - * - * @param query the query used to generate the view - */ - @Deprecated - public static Builder builder(String query) { - return newBuilder(query); - } /** * Returns a builder for a BigQuery view definition. @@ -240,16 +186,6 @@ public static Builder newBuilder(String query) { return new Builder().setQuery(query); } - /** - * Returns a builder for a BigQuery view definition. - * - * @param query the query used to generate the table - * @param functions user-defined functions that can be used by the query - */ - @Deprecated - public static Builder builder(String query, List functions) { - return newBuilder(query, functions); - } /** * Returns a builder for a BigQuery view definition. @@ -261,16 +197,6 @@ public static Builder newBuilder(String query, List functio return newBuilder(query).setUserDefinedFunctions(functions); } - /** - * Returns a builder for a BigQuery view definition. - * - * @param query the query used to generate the table - * @param functions user-defined functions that can be used by the query - */ - @Deprecated - public static Builder builder(String query, UserDefinedFunction... functions) { - return newBuilder(query, functions); - } /** * Returns a builder for a BigQuery view definition. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java index 6be6c084064d..24a9c3b3dae6 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java @@ -113,11 +113,6 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur this.projectionFields = loadConfigurationPb.getProjectionFields(); } - @Override - @Deprecated - public Builder destinationTable(TableId destinationTable) { - return setDestinationTable(destinationTable); - } @Override public Builder setDestinationTable(TableId destinationTable) { @@ -125,11 +120,6 @@ public Builder setDestinationTable(TableId destinationTable) { return this; } - @Override - @Deprecated - public Builder createDisposition(CreateDisposition createDisposition) { - return setCreateDisposition(createDisposition); - } @Override public Builder setCreateDisposition(CreateDisposition createDisposition) { @@ -137,11 +127,6 @@ public Builder setCreateDisposition(CreateDisposition createDisposition) { return this; } - @Override - @Deprecated - public Builder writeDisposition(WriteDisposition writeDisposition) { - return setWriteDisposition(writeDisposition); - } @Override public Builder setWriteDisposition(WriteDisposition writeDisposition) { @@ -149,11 +134,6 @@ public Builder setWriteDisposition(WriteDisposition writeDisposition) { return this; } - @Override - @Deprecated - public Builder formatOptions(FormatOptions formatOptions) { - return setFormatOptions(formatOptions); - } @Override public Builder setFormatOptions(FormatOptions formatOptions) { @@ -161,11 +141,6 @@ public Builder setFormatOptions(FormatOptions formatOptions) { return this; } - @Override - @Deprecated - public Builder maxBadRecords(Integer maxBadRecords) { - return setMaxBadRecords(maxBadRecords); - } @Override public Builder setMaxBadRecords(Integer maxBadRecords) { @@ -173,11 +148,6 @@ public Builder setMaxBadRecords(Integer maxBadRecords) { return this; } - @Override - @Deprecated - public Builder schema(Schema schema) { - return setSchema(schema); - } @Override public Builder setSchema(Schema schema) { @@ -185,11 +155,6 @@ public Builder setSchema(Schema schema) { return this; } - @Override - @Deprecated - public Builder ignoreUnknownValues(Boolean ignoreUnknownValues) { - return setIgnoreUnknownValues(ignoreUnknownValues); - } @Override public Builder setIgnoreUnknownValues(Boolean ignoreUnknownValues) { @@ -197,11 +162,6 @@ public Builder setIgnoreUnknownValues(Boolean ignoreUnknownValues) { return this; } - @Override - @Deprecated - public Builder projectionFields(List projectionFields) { - return setProjectionFields(projectionFields); - } @Override public Builder setProjectionFields(List projectionFields) { @@ -227,77 +187,42 @@ protected WriteChannelConfiguration(Builder builder) { this.projectionFields = builder.projectionFields; } - @Override - @Deprecated - public TableId destinationTable() { - return getDestinationTable(); - } @Override public TableId getDestinationTable() { return destinationTable; } - @Override - @Deprecated - public CreateDisposition createDisposition() { - return this.getCreateDisposition(); - } @Override public CreateDisposition getCreateDisposition() { return this.createDisposition; } - @Override - @Deprecated - public WriteDisposition writeDisposition() { - return getWriteDisposition(); - } @Override public WriteDisposition getWriteDisposition() { return writeDisposition; } - @Override - @Deprecated - public CsvOptions csvOptions() { - return getCsvOptions(); - } @Override public CsvOptions getCsvOptions() { return formatOptions instanceof CsvOptions ? (CsvOptions) formatOptions : null; } - @Override - @Deprecated - public Integer maxBadRecords() { - return getMaxBadRecords(); - } @Override public Integer getMaxBadRecords() { return maxBadRecords; } - @Override - @Deprecated - public Schema schema() { - return getSchema(); - } @Override public Schema getSchema() { return schema; } - @Override - @Deprecated - public String format() { - return getFormat(); - } @Override public String getFormat() { @@ -309,11 +234,6 @@ public Boolean ignoreUnknownValues() { return ignoreUnknownValues; } - @Override - @Deprecated - public List projectionFields() { - return getProjectionFields(); - } @Override public List getProjectionFields() { @@ -398,13 +318,6 @@ static WriteChannelConfiguration fromPb( return new Builder(configurationPb).build(); } - /** - * Creates a builder for a BigQuery Load Configuration given the destination table. - */ - @Deprecated - public static Builder builder(TableId destinationTable) { - return newBuilder(destinationTable); - } /** * Creates a builder for a BigQuery Load Configuration given the destination table. @@ -413,13 +326,6 @@ public static Builder newBuilder(TableId destinationTable) { return new Builder().setDestinationTable(destinationTable); } - /** - * Creates a builder for a BigQuery Load Configuration given the destination table and format. - */ - @Deprecated - public static Builder builder(TableId destinationTable, FormatOptions format) { - return newBuilder(destinationTable, format); - } /** * Creates a builder for a BigQuery Load Configuration given the destination table and format. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java index 072c77aec4a9..330e21b707e1 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java @@ -49,13 +49,6 @@ private RemoteBigQueryHelper(BigQueryOptions options) { this.options = options; } - /** - * Returns a {@link BigQueryOptions} object to be used for testing. - */ - @Deprecated - public BigQueryOptions options() { - return options; - } /** * Returns a {@link BigQueryOptions} object to be used for testing. diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AclTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AclTest.java index c960f1e425cd..ddb07d01a186 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AclTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AclTest.java @@ -40,14 +40,6 @@ public void testDomainEntity() { assertEquals(entity, Entity.fromPb(pb)); } - @Test - public void testDomainEntityDeprecated() { - Domain entity = new Domain("d1"); - assertEquals("d1", entity.domain()); - assertEquals(Type.DOMAIN, entity.type()); - Dataset.Access pb = entity.toPb(); - assertEquals(entity, Entity.fromPb(pb)); - } @Test public void testGroupEntity() { @@ -58,14 +50,6 @@ public void testGroupEntity() { assertEquals(entity, Entity.fromPb(pb)); } - @Test - public void testGroupEntityDeprecated() { - Group entity = new Group("g1"); - assertEquals("g1", entity.identifier()); - assertEquals(Type.GROUP, entity.type()); - Dataset.Access pb = entity.toPb(); - assertEquals(entity, Entity.fromPb(pb)); - } @Test public void testSpecialGroupEntity() { @@ -79,17 +63,6 @@ public void testSpecialGroupEntity() { assertEquals("projectOwners", entity.getIdentifier()); } - @Test - public void testSpecialGroupEntityDeprecated() { - Group entity = Group.ofAllAuthenticatedUsers(); - assertEquals("allAuthenticatedUsers", entity.identifier()); - entity = Group.ofProjectWriters(); - assertEquals("projectWriters", entity.identifier()); - entity = Group.ofProjectReaders(); - assertEquals("projectReaders", entity.identifier()); - entity = Group.ofProjectOwners(); - assertEquals("projectOwners", entity.identifier()); - } @Test public void testUserEntity() { @@ -100,14 +73,6 @@ public void testUserEntity() { assertEquals(entity, Entity.fromPb(pb)); } - @Test - public void testUserEntityDeprecated() { - User entity = new User("u1"); - assertEquals("u1", entity.email()); - assertEquals(Type.USER, entity.type()); - Dataset.Access pb = entity.toPb(); - assertEquals(entity, Entity.fromPb(pb)); - } @Test public void testViewEntity() { @@ -119,15 +84,6 @@ public void testViewEntity() { assertEquals(entity, Entity.fromPb(pb)); } - @Test - public void testViewEntityDeprecated() { - TableId viewId = TableId.of("project", "dataset", "view"); - View entity = new View(viewId); - assertEquals(viewId, entity.id()); - assertEquals(Type.VIEW, entity.type()); - Dataset.Access pb = entity.toPb(); - assertEquals(entity, Entity.fromPb(pb)); - } @Test public void testOf() { @@ -141,17 +97,5 @@ public void testOf() { assertEquals(view, acl.getEntity()); assertEquals(null, acl.getRole()); } - - @Test - public void testOfDeprecated() { - Acl acl = Acl.of(Group.ofAllAuthenticatedUsers(), Role.READER); - assertEquals(Group.ofAllAuthenticatedUsers(), acl.entity()); - assertEquals(Role.READER, acl.role()); - Dataset.Access pb = acl.toPb(); - assertEquals(acl, Acl.fromPb(pb)); - View view = new View(TableId.of("project", "dataset", "view")); - acl = Acl.of(view); - assertEquals(view, acl.entity()); - assertEquals(null, acl.role()); - } } + diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryErrorTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryErrorTest.java index 3dfb0576dd33..402f77832a20 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryErrorTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryErrorTest.java @@ -43,17 +43,6 @@ public void testConstructor() { assertEquals(MESSAGE, ERROR_INCOMPLETE.getMessage()); } - @Test - public void testConstructorDeprecated() { - assertEquals(REASON, ERROR.reason()); - assertEquals(LOCATION, ERROR.location()); - assertEquals(DEBUG_INFO, ERROR.getDebugInfo()); - assertEquals(MESSAGE, ERROR.message()); - assertEquals(REASON, ERROR_INCOMPLETE.reason()); - assertEquals(LOCATION, ERROR_INCOMPLETE.location()); - assertEquals(null, ERROR_INCOMPLETE.getDebugInfo()); - assertEquals(MESSAGE, ERROR_INCOMPLETE.message()); - } @Test public void testToAndFromPb() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryExceptionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryExceptionTest.java index 8f9de77667b8..b811243a4136 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryExceptionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryExceptionTest.java @@ -43,7 +43,6 @@ public void testBigqueryException() { assertEquals("message", exception.getMessage()); assertNull(exception.getReason()); assertNull(exception.getError()); - assertNull(exception.error()); assertTrue(exception.isRetryable()); assertTrue(exception.isIdempotent()); @@ -52,7 +51,6 @@ public void testBigqueryException() { assertEquals("message", exception.getMessage()); assertNull(exception.getReason()); assertNull(exception.getError()); - assertNull(exception.error()); assertTrue(exception.isRetryable()); assertTrue(exception.isIdempotent()); @@ -61,7 +59,6 @@ public void testBigqueryException() { assertEquals("message", exception.getMessage()); assertNull(exception.getReason()); assertNull(exception.getError()); - assertNull(exception.error()); assertTrue(exception.isRetryable()); assertTrue(exception.isIdempotent()); @@ -70,7 +67,6 @@ public void testBigqueryException() { assertEquals("message", exception.getMessage()); assertNull(exception.getReason()); assertNull(exception.getError()); - assertNull(exception.error()); assertTrue(exception.isRetryable()); assertTrue(exception.isIdempotent()); @@ -79,7 +75,6 @@ public void testBigqueryException() { assertEquals("message", exception.getMessage()); assertNull(exception.getReason()); assertNull(exception.getError()); - assertNull(exception.error()); assertFalse(exception.isRetryable()); assertTrue(exception.isIdempotent()); @@ -89,7 +84,6 @@ public void testBigqueryException() { assertEquals("message", exception.getMessage()); assertEquals("reason", exception.getReason()); assertEquals(error, exception.getError()); - assertEquals(error, exception.error()); assertTrue(exception.isRetryable()); assertTrue(exception.isIdempotent()); @@ -108,7 +102,6 @@ public void testBigqueryException() { assertEquals("message", exception.getMessage()); assertNull(exception.getReason()); assertNull(exception.getError()); - assertNull(exception.error()); assertTrue(exception.isRetryable()); assertTrue(exception.isIdempotent()); assertSame(cause, exception.getCause()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java index 90d744717934..1ee90d27a148 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java @@ -47,16 +47,6 @@ public class CopyJobConfigurationTest { .setCreateDisposition(CREATE_DISPOSITION) .setWriteDisposition(WRITE_DISPOSITION) .build(); - private static final CopyJobConfiguration DEPRECATED_COPY_JOB_CONFIGURATION = - CopyJobConfiguration.builder(DESTINATION_TABLE, SOURCE_TABLE) - .createDisposition(CREATE_DISPOSITION) - .writeDisposition(WRITE_DISPOSITION) - .build(); - private static final CopyJobConfiguration DEPRECATED_COPY_JOB_CONFIGURATION_MULTIPLE_TABLES = - CopyJobConfiguration.builder(DESTINATION_TABLE, SOURCE_TABLES) - .createDisposition(CREATE_DISPOSITION) - .writeDisposition(WRITE_DISPOSITION) - .build(); @Test public void testToBuilder() { @@ -100,21 +90,6 @@ public void testBuilder() { assertEquals(WRITE_DISPOSITION, COPY_JOB_CONFIGURATION.getWriteDisposition()); } - @Test - public void testBuilderDeprecated() { - assertEquals(DESTINATION_TABLE, - DEPRECATED_COPY_JOB_CONFIGURATION_MULTIPLE_TABLES.destinationTable()); - assertEquals(SOURCE_TABLES, - DEPRECATED_COPY_JOB_CONFIGURATION_MULTIPLE_TABLES.sourceTables()); - assertEquals(CREATE_DISPOSITION, - DEPRECATED_COPY_JOB_CONFIGURATION_MULTIPLE_TABLES.createDisposition()); - assertEquals(WRITE_DISPOSITION, - DEPRECATED_COPY_JOB_CONFIGURATION_MULTIPLE_TABLES.writeDisposition()); - assertEquals(DESTINATION_TABLE, DEPRECATED_COPY_JOB_CONFIGURATION.destinationTable()); - assertEquals(ImmutableList.of(SOURCE_TABLE), DEPRECATED_COPY_JOB_CONFIGURATION.sourceTables()); - assertEquals(CREATE_DISPOSITION, DEPRECATED_COPY_JOB_CONFIGURATION.createDisposition()); - assertEquals(WRITE_DISPOSITION, DEPRECATED_COPY_JOB_CONFIGURATION.writeDisposition()); - } @Test public void testToPbAndFromPb() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CsvOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CsvOptionsTest.java index f08ef14a61c5..f961f7c22a04 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CsvOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CsvOptionsTest.java @@ -39,14 +39,6 @@ public class CsvOptionsTest { .setQuote(QUOTE) .setSkipLeadingRows(SKIP_LEADING_ROWS) .build(); - private static final CsvOptions DEPRECATED_CSV_OPTIONS = CsvOptions.builder() - .allowJaggedRows(ALLOW_JAGGED_ROWS) - .allowQuotedNewLines(ALLOW_QUOTED_NEWLINE) - .encoding(ENCODING) - .fieldDelimiter(FIELD_DELIMITER) - .quote(QUOTE) - .skipLeadingRows(SKIP_LEADING_ROWS) - .build(); @Test public void testToBuilder() { @@ -76,16 +68,6 @@ public void testBuilder() { assertEquals(SKIP_LEADING_ROWS, (long) CSV_OPTIONS.getSkipLeadingRows()); } - @Test - public void testBuilderDeprecated() { - assertEquals(FormatOptions.CSV, DEPRECATED_CSV_OPTIONS.type()); - assertEquals(ALLOW_JAGGED_ROWS, DEPRECATED_CSV_OPTIONS.allowJaggedRows()); - assertEquals(ALLOW_QUOTED_NEWLINE, DEPRECATED_CSV_OPTIONS.allowQuotedNewLines()); - assertEquals(ENCODING.name(), DEPRECATED_CSV_OPTIONS.encoding()); - assertEquals(FIELD_DELIMITER, DEPRECATED_CSV_OPTIONS.fieldDelimiter()); - assertEquals(QUOTE, DEPRECATED_CSV_OPTIONS.quote()); - assertEquals(SKIP_LEADING_ROWS, (long) DEPRECATED_CSV_OPTIONS.skipLeadingRows()); - } @Test public void testToAndFromPb() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetIdTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetIdTest.java index 8d9743fc8473..a53c21833788 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetIdTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetIdTest.java @@ -33,13 +33,6 @@ public void testOf() { assertEquals("dataset", DATASET_COMPLETE.getDataset()); } - @Test - public void testOfDeprecated() { - assertEquals(null, DATASET.project()); - assertEquals("dataset", DATASET.dataset()); - assertEquals("project", DATASET_COMPLETE.project()); - assertEquals("dataset", DATASET_COMPLETE.dataset()); - } @Test public void testEquals() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java index 14828dec75f3..3568f3427596 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java @@ -60,22 +60,6 @@ public class DatasetInfoTest { .setDatasetId(DATASET_ID_COMPLETE) .setAcl(ACCESS_RULES_COMPLETE) .build(); - private static final DatasetInfo DEPRECATED_DATASET_INFO = DatasetInfo.builder(DATASET_ID) - .acl(ACCESS_RULES) - .setCreationTime(CREATION_TIME) - .defaultTableLifetime(DEFAULT_TABLE_EXPIRATION) - .description(DESCRIPTION) - .setEtag(ETAG) - .friendlyName(FRIENDLY_NAME) - .setGeneratedId(GENERATED_ID) - .setLastModified(LAST_MODIFIED) - .location(LOCATION) - .setSelfLink(SELF_LINK) - .build(); - private static final DatasetInfo DEPRECATED_DATASET_INFO_COMPLETE = DATASET_INFO.toBuilder() - .datasetId(DATASET_ID_COMPLETE) - .acl(ACCESS_RULES_COMPLETE) - .build(); @Test public void testToBuilder() { @@ -124,32 +108,6 @@ public void testBuilder() { assertEquals(SELF_LINK, DATASET_INFO_COMPLETE.getSelfLink()); } - @Test - public void testBuilderDeprecated() { - assertNull(DEPRECATED_DATASET_INFO.datasetId().getProject()); - assertEquals(DATASET_ID, DEPRECATED_DATASET_INFO.datasetId()); - assertEquals(ACCESS_RULES, DEPRECATED_DATASET_INFO.acl()); - assertEquals(CREATION_TIME, DEPRECATED_DATASET_INFO.creationTime()); - assertEquals(DEFAULT_TABLE_EXPIRATION, DEPRECATED_DATASET_INFO.defaultTableLifetime()); - assertEquals(DESCRIPTION, DEPRECATED_DATASET_INFO.description()); - assertEquals(ETAG, DEPRECATED_DATASET_INFO.etag()); - assertEquals(FRIENDLY_NAME, DEPRECATED_DATASET_INFO.friendlyName()); - assertEquals(GENERATED_ID, DEPRECATED_DATASET_INFO.generatedId()); - assertEquals(LAST_MODIFIED, DEPRECATED_DATASET_INFO.lastModified()); - assertEquals(LOCATION, DEPRECATED_DATASET_INFO.location()); - assertEquals(SELF_LINK, DEPRECATED_DATASET_INFO.selfLink()); - assertEquals(DATASET_ID_COMPLETE, DEPRECATED_DATASET_INFO_COMPLETE.datasetId()); - assertEquals(ACCESS_RULES_COMPLETE, DEPRECATED_DATASET_INFO_COMPLETE.acl()); - assertEquals(CREATION_TIME, DEPRECATED_DATASET_INFO_COMPLETE.creationTime()); - assertEquals(DEFAULT_TABLE_EXPIRATION, DEPRECATED_DATASET_INFO_COMPLETE.defaultTableLifetime()); - assertEquals(DESCRIPTION, DEPRECATED_DATASET_INFO_COMPLETE.description()); - assertEquals(ETAG, DEPRECATED_DATASET_INFO_COMPLETE.etag()); - assertEquals(FRIENDLY_NAME, DEPRECATED_DATASET_INFO_COMPLETE.friendlyName()); - assertEquals(GENERATED_ID, DEPRECATED_DATASET_INFO_COMPLETE.generatedId()); - assertEquals(LAST_MODIFIED, DEPRECATED_DATASET_INFO_COMPLETE.lastModified()); - assertEquals(LOCATION, DEPRECATED_DATASET_INFO_COMPLETE.location()); - assertEquals(SELF_LINK, DEPRECATED_DATASET_INFO_COMPLETE.selfLink()); - } @Test public void testOf() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java index 2c585afa264d..37dc098e5e9e 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java @@ -120,34 +120,6 @@ public void testBuilder() { assertEquals(SELF_LINK, builtDataset.getSelfLink()); } - @Test - public void testBuilderDeprecated() { - initializeExpectedDataset(2); - replay(bigquery); - Dataset builtDataset = new Dataset.Builder(serviceMockReturnsOptions, DATASET_ID) - .acl(ACCESS_RULES) - .setCreationTime(CREATION_TIME) - .defaultTableLifetime(DEFAULT_TABLE_EXPIRATION) - .description(DESCRIPTION) - .setEtag(ETAG) - .friendlyName(FRIENDLY_NAME) - .setGeneratedId(GENERATED_ID) - .setLastModified(LAST_MODIFIED) - .location(LOCATION) - .setSelfLink(SELF_LINK) - .build(); - assertEquals(DATASET_ID, builtDataset.datasetId()); - assertEquals(ACCESS_RULES, builtDataset.acl()); - assertEquals(CREATION_TIME, builtDataset.creationTime()); - assertEquals(DEFAULT_TABLE_EXPIRATION, builtDataset.defaultTableLifetime()); - assertEquals(DESCRIPTION, builtDataset.description()); - assertEquals(ETAG, builtDataset.etag()); - assertEquals(FRIENDLY_NAME, builtDataset.friendlyName()); - assertEquals(GENERATED_ID, builtDataset.generatedId()); - assertEquals(LAST_MODIFIED, builtDataset.lastModified()); - assertEquals(LOCATION, builtDataset.location()); - assertEquals(SELF_LINK, builtDataset.selfLink()); - } @Test public void testToBuilder() { @@ -376,12 +348,6 @@ public void testBigquery() { assertSame(serviceMockReturnsOptions, expectedDataset.getBigquery()); } - @Test - public void testBigqueryDeprecated() { - initializeExpectedDataset(1); - replay(bigquery); - assertSame(serviceMockReturnsOptions, expectedDataset.bigquery()); - } @Test public void testToAndFromPb() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java index 41df8f178e74..8a470003abd4 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java @@ -53,12 +53,6 @@ public class ExternalTableDefinitionTest { .setIgnoreUnknownValues(IGNORE_UNKNOWN_VALUES) .setMaxBadRecords(MAX_BAD_RECORDS) .build(); - private static final ExternalTableDefinition DEPRECATED_EXTERNAL_TABLE_DEFINITION = - ExternalTableDefinition.builder(SOURCE_URIS, TABLE_SCHEMA, CSV_OPTIONS) - .compression(COMPRESSION) - .ignoreUnknownValues(IGNORE_UNKNOWN_VALUES) - .maxBadRecords(MAX_BAD_RECORDS) - .build(); @Test public void testToBuilder() { @@ -91,16 +85,6 @@ public void testBuilder() { assertEquals(SOURCE_URIS, EXTERNAL_TABLE_DEFINITION.getSourceUris()); } - @Test - public void testBuilderDeprecated() { - assertEquals(TableDefinition.Type.EXTERNAL, DEPRECATED_EXTERNAL_TABLE_DEFINITION.type()); - assertEquals(COMPRESSION, DEPRECATED_EXTERNAL_TABLE_DEFINITION.compression()); - assertEquals(CSV_OPTIONS, DEPRECATED_EXTERNAL_TABLE_DEFINITION.formatOptions()); - assertEquals(IGNORE_UNKNOWN_VALUES, DEPRECATED_EXTERNAL_TABLE_DEFINITION.ignoreUnknownValues()); - assertEquals(MAX_BAD_RECORDS, DEPRECATED_EXTERNAL_TABLE_DEFINITION.maxBadRecords()); - assertEquals(TABLE_SCHEMA, DEPRECATED_EXTERNAL_TABLE_DEFINITION.schema()); - assertEquals(SOURCE_URIS, DEPRECATED_EXTERNAL_TABLE_DEFINITION.sourceUris()); - } @Test public void testToAndFromPb() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExtractJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExtractJobConfigurationTest.java index b5a9b0dc5e83..419ae8b8f6cf 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExtractJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExtractJobConfigurationTest.java @@ -50,20 +50,6 @@ public class ExtractJobConfigurationTest { .setCompression(COMPRESSION) .setFormat(FORMAT) .build(); - private static final ExtractJobConfiguration DEPRECATED_EXTRACT_CONFIGURATION = - ExtractJobConfiguration.builder(TABLE_ID, DESTINATION_URIS) - .printHeader(PRINT_HEADER) - .fieldDelimiter(FIELD_DELIMITER) - .compression(COMPRESSION) - .format(FORMAT) - .build(); - private static final ExtractJobConfiguration DEPRECATED_EXTRACT_CONFIGURATION_ONE_URI = - ExtractJobConfiguration.builder(TABLE_ID, DESTINATION_URI) - .printHeader(PRINT_HEADER) - .fieldDelimiter(FIELD_DELIMITER) - .compression(COMPRESSION) - .format(FORMAT) - .build(); @Test public void testToBuilder() { @@ -118,22 +104,6 @@ public void testBuilder() { assertEquals(FORMAT, EXTRACT_CONFIGURATION_ONE_URI.getFormat()); } - @Test - public void testBuilderDeprecated() { - assertEquals(TABLE_ID, DEPRECATED_EXTRACT_CONFIGURATION.sourceTable()); - assertEquals(DESTINATION_URIS, DEPRECATED_EXTRACT_CONFIGURATION.destinationUris()); - assertEquals(FIELD_DELIMITER, DEPRECATED_EXTRACT_CONFIGURATION.fieldDelimiter()); - assertEquals(COMPRESSION, DEPRECATED_EXTRACT_CONFIGURATION.compression()); - assertEquals(PRINT_HEADER, DEPRECATED_EXTRACT_CONFIGURATION.printHeader()); - assertEquals(FORMAT, DEPRECATED_EXTRACT_CONFIGURATION.format()); - assertEquals(TABLE_ID, DEPRECATED_EXTRACT_CONFIGURATION_ONE_URI.sourceTable()); - assertEquals(ImmutableList.of(DESTINATION_URI), - DEPRECATED_EXTRACT_CONFIGURATION_ONE_URI.destinationUris()); - assertEquals(FIELD_DELIMITER, DEPRECATED_EXTRACT_CONFIGURATION_ONE_URI.fieldDelimiter()); - assertEquals(COMPRESSION, DEPRECATED_EXTRACT_CONFIGURATION_ONE_URI.compression()); - assertEquals(PRINT_HEADER, DEPRECATED_EXTRACT_CONFIGURATION_ONE_URI.printHeader()); - assertEquals(FORMAT, DEPRECATED_EXTRACT_CONFIGURATION_ONE_URI.format()); - } @Test public void testToPbAndFromPb() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java index 4dc34d35dd87..07d86616d7b7 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java @@ -50,19 +50,6 @@ public class FieldTest { .setMode(FIELD_MODE3) .setDescription(FIELD_DESCRIPTION3) .build(); - private static final Field DEPRECATED_FIELD_SCHEMA1 = Field.builder(FIELD_NAME1, FIELD_TYPE1) - .mode(FIELD_MODE1) - .description(FIELD_DESCRIPTION1) - .build(); - private static final Field DEPRECATED_FIELD_SCHEMA2 = Field.builder(FIELD_NAME2, FIELD_TYPE2) - .mode(FIELD_MODE2) - .description(FIELD_DESCRIPTION2) - .build(); - private static final Field DEPRECATED_FIELD_SCHEMA3 = Field - .builder(FIELD_NAME3, FIELD_TYPE3) - .mode(FIELD_MODE3) - .description(FIELD_DESCRIPTION3) - .build(); @Test public void testToBuilder() { @@ -99,20 +86,6 @@ public void testBuilder() { assertEquals(ImmutableList.of(FIELD_SCHEMA1, FIELD_SCHEMA2), FIELD_SCHEMA3.getFields()); } - @Test - public void testBuilderDeprecated() { - assertEquals(FIELD_NAME1, DEPRECATED_FIELD_SCHEMA1.name()); - assertEquals(FIELD_TYPE1, DEPRECATED_FIELD_SCHEMA1.type()); - assertEquals(FIELD_MODE1, DEPRECATED_FIELD_SCHEMA1.mode()); - assertEquals(FIELD_DESCRIPTION1, DEPRECATED_FIELD_SCHEMA1.description()); - assertEquals(null, DEPRECATED_FIELD_SCHEMA1.fields()); - assertEquals(FIELD_NAME3, DEPRECATED_FIELD_SCHEMA3.name()); - assertEquals(FIELD_TYPE3, DEPRECATED_FIELD_SCHEMA3.type()); - assertEquals(FIELD_MODE3, DEPRECATED_FIELD_SCHEMA3.mode()); - assertEquals(FIELD_DESCRIPTION3, DEPRECATED_FIELD_SCHEMA3.description()); - assertEquals(ImmutableList.of(DEPRECATED_FIELD_SCHEMA1, DEPRECATED_FIELD_SCHEMA2), - DEPRECATED_FIELD_SCHEMA3.fields()); - } @Test public void testToAndFromPb() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java index 9c99b97d9318..8e6a1d16dc5e 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java @@ -80,37 +80,6 @@ public void testFromPb() { assertEquals(FieldValue.fromPb(TIMESTAMP_FIELD), value.getRepeatedValue().get(1)); } - @Test - public void testFromPbDeprecated() { - FieldValue value = FieldValue.fromPb(BOOLEAN_FIELD); - assertEquals(FieldValue.Attribute.PRIMITIVE, value.attribute()); - assertFalse(value.booleanValue()); - value = FieldValue.fromPb(INTEGER_FIELD); - assertEquals(FieldValue.Attribute.PRIMITIVE, value.attribute()); - assertEquals(1, value.longValue()); - value = FieldValue.fromPb(FLOAT_FIELD); - assertEquals(FieldValue.Attribute.PRIMITIVE, value.attribute()); - assertEquals(1.5, value.doubleValue(), 0); - value = FieldValue.fromPb(STRING_FIELD); - assertEquals(FieldValue.Attribute.PRIMITIVE, value.attribute()); - assertEquals("string", value.stringValue()); - value = FieldValue.fromPb(TIMESTAMP_FIELD); - assertEquals(FieldValue.Attribute.PRIMITIVE, value.attribute()); - assertEquals(42000000, value.timestampValue()); - value = FieldValue.fromPb(BYTES_FIELD); - assertEquals(FieldValue.Attribute.PRIMITIVE, value.attribute()); - assertArrayEquals(BYTES, value.bytesValue()); - value = FieldValue.fromPb(NULL_FIELD); - assertNull(value.value()); - value = FieldValue.fromPb(REPEATED_FIELD); - assertEquals(FieldValue.Attribute.REPEATED, value.attribute()); - assertEquals(FieldValue.fromPb(INTEGER_FIELD), value.repeatedValue().get(0)); - assertEquals(FieldValue.fromPb(INTEGER_FIELD), value.repeatedValue().get(1)); - value = FieldValue.fromPb(RECORD_FIELD); - assertEquals(FieldValue.Attribute.RECORD, value.attribute()); - assertEquals(FieldValue.fromPb(FLOAT_FIELD), value.repeatedValue().get(0)); - assertEquals(FieldValue.fromPb(TIMESTAMP_FIELD), value.repeatedValue().get(1)); - } @Test public void testEquals() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FormatOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FormatOptionsTest.java index a019e347ba84..9febd1fa177d 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FormatOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FormatOptionsTest.java @@ -34,18 +34,6 @@ public void testConstructor() { assertEquals(FormatOptions.AVRO, options.getType()); } - @Test - @SuppressWarnings("deprecation") - public void testConstructorDeprecated() { - FormatOptions options = new FormatOptions(FormatOptions.CSV); - assertEquals(FormatOptions.CSV, options.type()); - options = new FormatOptions(FormatOptions.JSON); - assertEquals(FormatOptions.JSON, options.type()); - options = new FormatOptions(FormatOptions.DATASTORE_BACKUP); - assertEquals(FormatOptions.DATASTORE_BACKUP, options.type()); - options = new FormatOptions(FormatOptions.AVRO); - assertEquals(FormatOptions.AVRO, options.type()); - } @Test public void testFactoryMethods() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/InsertAllRequestTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/InsertAllRequestTest.java index f498e84aa788..e162d377aac6 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/InsertAllRequestTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/InsertAllRequestTest.java @@ -115,75 +115,6 @@ public class InsertAllRequestTest { .setSkipInvalidRows(false) .setTemplateSuffix(TEMPLATE_SUFFIX) .build(); - private static final InsertAllRequest DEPRECATED_INSERT_ALL_REQUEST1 = - InsertAllRequest.builder(TABLE_ID) - .addRow(CONTENT1) - .addRow(CONTENT2) - .ignoreUnknownValues(IGNORE_UNKNOWN_VALUES) - .skipInvalidRows(SKIP_INVALID_ROWS) - .build(); - private static final InsertAllRequest DEPRECATED_INSERT_ALL_REQUEST2 = - InsertAllRequest.builder(TABLE_ID) - .rows(ROWS) - .ignoreUnknownValues(IGNORE_UNKNOWN_VALUES) - .skipInvalidRows(SKIP_INVALID_ROWS) - .build(); - private static final InsertAllRequest DEPRECATED_INSERT_ALL_REQUEST3 = - InsertAllRequest.builder(TABLE_ID.getDataset(), TABLE_ID.getTable()) - .rows(ROWS_WITH_ID) - .ignoreUnknownValues(IGNORE_UNKNOWN_VALUES) - .skipInvalidRows(SKIP_INVALID_ROWS) - .build(); - private static final InsertAllRequest DEPRECATED_INSERT_ALL_REQUEST4 = - InsertAllRequest.builder(TABLE_ID, ROWS) - .ignoreUnknownValues(IGNORE_UNKNOWN_VALUES) - .skipInvalidRows(SKIP_INVALID_ROWS) - .build(); - private static final InsertAllRequest DEPRECATED_INSERT_ALL_REQUEST5 = - InsertAllRequest.builder(TABLE_ID.getDataset(), TABLE_ID.getTable(), ROWS_WITH_ID) - .ignoreUnknownValues(IGNORE_UNKNOWN_VALUES) - .skipInvalidRows(SKIP_INVALID_ROWS) - .build(); - private static final InsertAllRequest DEPRECATED_INSERT_ALL_REQUEST6 = - InsertAllRequest.builder(TABLE_ID, ROWS.get(0), ROWS.get(1)) - .ignoreUnknownValues(IGNORE_UNKNOWN_VALUES) - .skipInvalidRows(SKIP_INVALID_ROWS) - .build(); - private static final InsertAllRequest DEPRECATED_INSERT_ALL_REQUEST7 = - InsertAllRequest.builder(TABLE_ID.getDataset(), TABLE_ID.getTable(), ROWS_WITH_ID.get(0), - ROWS_WITH_ID.get(1)) - .ignoreUnknownValues(IGNORE_UNKNOWN_VALUES) - .skipInvalidRows(SKIP_INVALID_ROWS) - .build(); - private static final InsertAllRequest DEPRECATED_INSERT_ALL_REQUEST8 = - InsertAllRequest.builder(TABLE_ID.getDataset(), TABLE_ID.getTable()) - .addRow("id1", CONTENT1) - .addRow("id2", CONTENT2) - .ignoreUnknownValues(IGNORE_UNKNOWN_VALUES) - .skipInvalidRows(SKIP_INVALID_ROWS) - .build(); - private static final InsertAllRequest DEPRECATED_INSERT_ALL_REQUEST9 = - InsertAllRequest.builder(TABLE_INFO) - .addRow("id1", CONTENT1) - .addRow("id2", CONTENT2) - .ignoreUnknownValues(IGNORE_UNKNOWN_VALUES) - .skipInvalidRows(SKIP_INVALID_ROWS) - .build(); - private static final InsertAllRequest DEPRECATED_INSERT_ALL_REQUEST10 = - InsertAllRequest.builder(TABLE_INFO) - .addRow("id1", CONTENT1) - .addRow("id2", CONTENT2) - .ignoreUnknownValues(true) - .skipInvalidRows(false) - .build(); - private static final InsertAllRequest DEPRECATED_INSERT_ALL_REQUEST11 = - InsertAllRequest.builder(TABLE_INFO) - .addRow("id1", CONTENT1) - .addRow("id2", CONTENT2) - .ignoreUnknownValues(true) - .skipInvalidRows(false) - .templateSuffix(TEMPLATE_SUFFIX) - .build(); @Test public void testBuilder() { @@ -244,64 +175,6 @@ public void testBuilder() { assertEquals(TEMPLATE_SUFFIX, INSERT_ALL_REQUEST11.getTemplateSuffix()); } - @Test - public void testBuilderDeprecated() { - assertEquals(TABLE_ID, DEPRECATED_INSERT_ALL_REQUEST1.getTable()); - assertEquals(TABLE_ID, DEPRECATED_INSERT_ALL_REQUEST2.getTable()); - assertEquals(TABLE_ID, DEPRECATED_INSERT_ALL_REQUEST3.getTable()); - assertEquals(TABLE_ID, DEPRECATED_INSERT_ALL_REQUEST4.getTable()); - assertEquals(TABLE_ID, DEPRECATED_INSERT_ALL_REQUEST5.getTable()); - assertEquals(TABLE_ID, DEPRECATED_INSERT_ALL_REQUEST6.getTable()); - assertEquals(TABLE_ID, DEPRECATED_INSERT_ALL_REQUEST7.getTable()); - assertEquals(TABLE_ID, DEPRECATED_INSERT_ALL_REQUEST8.getTable()); - assertEquals(TABLE_ID, DEPRECATED_INSERT_ALL_REQUEST9.getTable()); - assertEquals(TABLE_ID, DEPRECATED_INSERT_ALL_REQUEST10.getTable()); - assertEquals(TABLE_ID, DEPRECATED_INSERT_ALL_REQUEST11.getTable()); - assertEquals(ROWS, DEPRECATED_INSERT_ALL_REQUEST1.rows()); - assertEquals(ROWS, DEPRECATED_INSERT_ALL_REQUEST2.rows()); - assertEquals(ROWS, DEPRECATED_INSERT_ALL_REQUEST4.rows()); - assertEquals(ROWS, DEPRECATED_INSERT_ALL_REQUEST6.rows()); - assertEquals(ROWS_WITH_ID, DEPRECATED_INSERT_ALL_REQUEST3.rows()); - assertEquals(ROWS_WITH_ID, DEPRECATED_INSERT_ALL_REQUEST5.rows()); - assertEquals(ROWS_WITH_ID, DEPRECATED_INSERT_ALL_REQUEST7.rows()); - assertEquals(ROWS_WITH_ID, DEPRECATED_INSERT_ALL_REQUEST8.rows()); - assertEquals(ROWS_WITH_ID, DEPRECATED_INSERT_ALL_REQUEST9.rows()); - assertEquals(ROWS_WITH_ID, DEPRECATED_INSERT_ALL_REQUEST10.rows()); - assertEquals(ROWS_WITH_ID, DEPRECATED_INSERT_ALL_REQUEST11.rows()); - assertEquals(SKIP_INVALID_ROWS, DEPRECATED_INSERT_ALL_REQUEST1.skipInvalidRows()); - assertEquals(SKIP_INVALID_ROWS, DEPRECATED_INSERT_ALL_REQUEST2.skipInvalidRows()); - assertEquals(SKIP_INVALID_ROWS, DEPRECATED_INSERT_ALL_REQUEST3.skipInvalidRows()); - assertEquals(SKIP_INVALID_ROWS, DEPRECATED_INSERT_ALL_REQUEST4.skipInvalidRows()); - assertEquals(SKIP_INVALID_ROWS, DEPRECATED_INSERT_ALL_REQUEST5.skipInvalidRows()); - assertEquals(SKIP_INVALID_ROWS, DEPRECATED_INSERT_ALL_REQUEST6.skipInvalidRows()); - assertEquals(SKIP_INVALID_ROWS, DEPRECATED_INSERT_ALL_REQUEST7.skipInvalidRows()); - assertEquals(SKIP_INVALID_ROWS, DEPRECATED_INSERT_ALL_REQUEST8.skipInvalidRows()); - assertEquals(SKIP_INVALID_ROWS, DEPRECATED_INSERT_ALL_REQUEST9.skipInvalidRows()); - assertFalse(DEPRECATED_INSERT_ALL_REQUEST10.skipInvalidRows()); - assertFalse(DEPRECATED_INSERT_ALL_REQUEST11.skipInvalidRows()); - assertEquals(IGNORE_UNKNOWN_VALUES, DEPRECATED_INSERT_ALL_REQUEST1.ignoreUnknownValues()); - assertEquals(IGNORE_UNKNOWN_VALUES, DEPRECATED_INSERT_ALL_REQUEST2.ignoreUnknownValues()); - assertEquals(IGNORE_UNKNOWN_VALUES, DEPRECATED_INSERT_ALL_REQUEST3.ignoreUnknownValues()); - assertEquals(IGNORE_UNKNOWN_VALUES, DEPRECATED_INSERT_ALL_REQUEST4.ignoreUnknownValues()); - assertEquals(IGNORE_UNKNOWN_VALUES, DEPRECATED_INSERT_ALL_REQUEST5.ignoreUnknownValues()); - assertEquals(IGNORE_UNKNOWN_VALUES, DEPRECATED_INSERT_ALL_REQUEST6.ignoreUnknownValues()); - assertEquals(IGNORE_UNKNOWN_VALUES, DEPRECATED_INSERT_ALL_REQUEST7.ignoreUnknownValues()); - assertEquals(IGNORE_UNKNOWN_VALUES, DEPRECATED_INSERT_ALL_REQUEST8.ignoreUnknownValues()); - assertEquals(IGNORE_UNKNOWN_VALUES, DEPRECATED_INSERT_ALL_REQUEST9.ignoreUnknownValues()); - assertTrue(DEPRECATED_INSERT_ALL_REQUEST10.ignoreUnknownValues()); - assertTrue(DEPRECATED_INSERT_ALL_REQUEST11.ignoreUnknownValues()); - assertNull(DEPRECATED_INSERT_ALL_REQUEST1.templateSuffix()); - assertNull(DEPRECATED_INSERT_ALL_REQUEST2.templateSuffix()); - assertNull(DEPRECATED_INSERT_ALL_REQUEST3.templateSuffix()); - assertNull(DEPRECATED_INSERT_ALL_REQUEST4.templateSuffix()); - assertNull(DEPRECATED_INSERT_ALL_REQUEST5.templateSuffix()); - assertNull(DEPRECATED_INSERT_ALL_REQUEST6.templateSuffix()); - assertNull(DEPRECATED_INSERT_ALL_REQUEST7.templateSuffix()); - assertNull(DEPRECATED_INSERT_ALL_REQUEST8.templateSuffix()); - assertNull(DEPRECATED_INSERT_ALL_REQUEST9.templateSuffix()); - assertNull(DEPRECATED_INSERT_ALL_REQUEST10.templateSuffix()); - assertEquals(TEMPLATE_SUFFIX, DEPRECATED_INSERT_ALL_REQUEST11.templateSuffix()); - } @Test public void testOf() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/InsertAllResponseTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/InsertAllResponseTest.java index 932fa6825f6e..897ffe75b09b 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/InsertAllResponseTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/InsertAllResponseTest.java @@ -55,13 +55,6 @@ public void testErrorsFor() { assertNull(INSERT_ALL_RESPONSE.getErrorsFor(2L)); } - @Test - public void testErrorsForDeprecated() { - assertEquals(ERRORS_MAP, INSERT_ALL_RESPONSE.insertErrors()); - assertEquals(ERRORS1, INSERT_ALL_RESPONSE.errorsFor(0L)); - assertEquals(ERRORS2, INSERT_ALL_RESPONSE.errorsFor(1L)); - assertNull(INSERT_ALL_RESPONSE.errorsFor(2L)); - } @Test public void testHasErrors() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobIdTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobIdTest.java index 92a601c6d167..280cfe0e5bc5 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobIdTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobIdTest.java @@ -33,13 +33,6 @@ public void testOf() { assertEquals("job", JOB_COMPLETE.getJob()); } - @Test - public void testOfDeprecated() { - assertEquals(null, JOB.project()); - assertEquals("job", JOB.job()); - assertEquals("project", JOB_COMPLETE.project()); - assertEquals("job", JOB_COMPLETE.job()); - } @Test public void testEquals() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobInfoTest.java index c9d669abf43d..3ea71a2435f1 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobInfoTest.java @@ -199,46 +199,6 @@ public class JobInfoTest { .setUserEmail(EMAIL) .setStatus(JOB_STATUS) .build(); - private static final JobInfo DEPRECATED_COPY_JOB = JobInfo.builder(COPY_CONFIGURATION) - .jobId(JOB_ID) - .setStatistics(COPY_JOB_STATISTICS) - .jobId(JOB_ID) - .setEtag(ETAG) - .setGeneratedId(GENERATED_ID) - .setSelfLink(SELF_LINK) - .setUserEmail(EMAIL) - .setStatus(JOB_STATUS) - .build(); - private static final JobInfo DEPRECATED_EXTRACT_JOB = JobInfo.builder(EXTRACT_CONFIGURATION) - .jobId(JOB_ID) - .setStatistics(EXTRACT_JOB_STATISTICS) - .jobId(JOB_ID) - .setEtag(ETAG) - .setGeneratedId(GENERATED_ID) - .setSelfLink(SELF_LINK) - .setUserEmail(EMAIL) - .setStatus(JOB_STATUS) - .build(); - private static final JobInfo DEPRECATED_LOAD_JOB = JobInfo.builder(LOAD_CONFIGURATION) - .jobId(JOB_ID) - .setStatistics(LOAD_JOB_STATISTICS) - .jobId(JOB_ID) - .setEtag(ETAG) - .setGeneratedId(GENERATED_ID) - .setSelfLink(SELF_LINK) - .setUserEmail(EMAIL) - .setStatus(JOB_STATUS) - .build(); - private static final JobInfo DEPRECATED_QUERY_JOB = JobInfo.builder(QUERY_CONFIGURATION) - .jobId(JOB_ID) - .setStatistics(QUERY_JOB_STATISTICS) - .jobId(JOB_ID) - .setEtag(ETAG) - .setGeneratedId(GENERATED_ID) - .setSelfLink(SELF_LINK) - .setUserEmail(EMAIL) - .setStatus(JOB_STATUS) - .build(); @Test public void testToBuilder() { @@ -341,45 +301,6 @@ public void testBuilder() { assertEquals(QUERY_JOB_STATISTICS, QUERY_JOB.getStatistics()); } - @Test - public void testBuilderDeprecated() { - assertEquals(ETAG, DEPRECATED_COPY_JOB.etag()); - assertEquals(GENERATED_ID, DEPRECATED_COPY_JOB.generatedId()); - assertEquals(SELF_LINK, DEPRECATED_COPY_JOB.selfLink()); - assertEquals(EMAIL, DEPRECATED_COPY_JOB.userEmail()); - assertEquals(JOB_ID, DEPRECATED_COPY_JOB.jobId()); - assertEquals(JOB_STATUS, DEPRECATED_COPY_JOB.status()); - assertEquals(COPY_CONFIGURATION, DEPRECATED_COPY_JOB.configuration()); - assertEquals(COPY_JOB_STATISTICS, DEPRECATED_COPY_JOB.statistics()); - - assertEquals(ETAG, DEPRECATED_EXTRACT_JOB.etag()); - assertEquals(GENERATED_ID, DEPRECATED_EXTRACT_JOB.generatedId()); - assertEquals(SELF_LINK, DEPRECATED_EXTRACT_JOB.selfLink()); - assertEquals(EMAIL, DEPRECATED_EXTRACT_JOB.userEmail()); - assertEquals(JOB_ID, DEPRECATED_EXTRACT_JOB.jobId()); - assertEquals(JOB_STATUS, DEPRECATED_EXTRACT_JOB.status()); - assertEquals(EXTRACT_CONFIGURATION, DEPRECATED_EXTRACT_JOB.configuration()); - assertEquals(EXTRACT_JOB_STATISTICS, DEPRECATED_EXTRACT_JOB.statistics()); - - assertEquals(ETAG, DEPRECATED_LOAD_JOB.etag()); - assertEquals(GENERATED_ID, DEPRECATED_LOAD_JOB.generatedId()); - assertEquals(SELF_LINK, DEPRECATED_LOAD_JOB.selfLink()); - assertEquals(EMAIL, DEPRECATED_LOAD_JOB.userEmail()); - assertEquals(JOB_ID, DEPRECATED_LOAD_JOB.jobId()); - assertEquals(JOB_STATUS, DEPRECATED_LOAD_JOB.status()); - assertEquals(LOAD_CONFIGURATION, DEPRECATED_LOAD_JOB.configuration()); - assertEquals(LOAD_JOB_STATISTICS, DEPRECATED_LOAD_JOB.statistics()); - - assertEquals(ETAG, DEPRECATED_QUERY_JOB.etag()); - assertEquals(GENERATED_ID, DEPRECATED_QUERY_JOB.generatedId()); - assertEquals(SELF_LINK, DEPRECATED_QUERY_JOB.selfLink()); - assertEquals(EMAIL, DEPRECATED_QUERY_JOB.userEmail()); - assertEquals(JOB_ID, DEPRECATED_QUERY_JOB.jobId()); - assertEquals(JOB_STATUS, DEPRECATED_QUERY_JOB.status()); - assertEquals(QUERY_CONFIGURATION, DEPRECATED_QUERY_JOB.configuration()); - assertEquals(QUERY_JOB_STATISTICS, DEPRECATED_QUERY_JOB.statistics()); - } - @Test public void testToPbAndFromPb() { assertNotNull(COPY_JOB.toPb().getConfiguration().getCopy()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java index 46e47af7eaa7..d6643d6d2d10 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java @@ -109,11 +109,7 @@ public class JobStatisticsTest { .build(); @Test - public void testBuilderDeprecated() { - assertEquals(CREATION_TIME, COPY_STATISTICS.getCreationTime()); - assertEquals(START_TIME, COPY_STATISTICS.getStartTime()); - assertEquals(END_TIME, COPY_STATISTICS.getEndTime()); - + public void testBuilder() { assertEquals(CREATION_TIME, EXTRACT_STATISTICS.getCreationTime()); assertEquals(START_TIME, EXTRACT_STATISTICS.getStartTime()); assertEquals(END_TIME, EXTRACT_STATISTICS.getEndTime()); @@ -155,53 +151,6 @@ public void testBuilderDeprecated() { assertEquals(null, QUERY_STATISTICS_INCOMPLETE.getQueryPlan()); } - @Test - public void testBuilder() { - assertEquals(CREATION_TIME, COPY_STATISTICS.creationTime()); - assertEquals(START_TIME, COPY_STATISTICS.startTime()); - assertEquals(END_TIME, COPY_STATISTICS.endTime()); - - assertEquals(CREATION_TIME, EXTRACT_STATISTICS.creationTime()); - assertEquals(START_TIME, EXTRACT_STATISTICS.startTime()); - assertEquals(END_TIME, EXTRACT_STATISTICS.endTime()); - assertEquals(FILE_COUNT, EXTRACT_STATISTICS.destinationUriFileCounts()); - - assertEquals(CREATION_TIME, LOAD_STATISTICS.creationTime()); - assertEquals(START_TIME, LOAD_STATISTICS.startTime()); - assertEquals(END_TIME, LOAD_STATISTICS.endTime()); - assertEquals(INPUT_BYTES, LOAD_STATISTICS.inputBytes()); - assertEquals(INPUT_FILES, LOAD_STATISTICS.inputFiles()); - assertEquals(OUTPUT_BYTES, LOAD_STATISTICS.outputBytes()); - assertEquals(OUTPUT_ROWS, LOAD_STATISTICS.outputRows()); - - assertEquals(CREATION_TIME, QUERY_STATISTICS.creationTime()); - assertEquals(START_TIME, QUERY_STATISTICS.startTime()); - assertEquals(END_TIME, QUERY_STATISTICS.endTime()); - assertEquals(BILLING_TIER, QUERY_STATISTICS.billingTier()); - assertEquals(CACHE_HIT, QUERY_STATISTICS.cacheHit()); - assertEquals(TOTAL_BYTES_BILLED, QUERY_STATISTICS.totalBytesBilled()); - assertEquals(TOTAL_BYTES_PROCESSED, QUERY_STATISTICS.totalBytesProcessed()); - assertEquals(TOTAL_BYTES_PROCESSED, QUERY_STATISTICS.totalBytesProcessed()); - assertEquals(QUERY_PLAN, QUERY_STATISTICS.queryPlan()); - - assertEquals(CREATION_TIME, LOAD_STATISTICS_INCOMPLETE.creationTime()); - assertEquals(START_TIME, LOAD_STATISTICS_INCOMPLETE.startTime()); - assertEquals(END_TIME, LOAD_STATISTICS_INCOMPLETE.endTime()); - assertEquals(INPUT_BYTES, LOAD_STATISTICS_INCOMPLETE.inputBytes()); - assertEquals(INPUT_FILES, LOAD_STATISTICS_INCOMPLETE.inputFiles()); - assertEquals(null, LOAD_STATISTICS_INCOMPLETE.outputBytes()); - assertEquals(null, LOAD_STATISTICS_INCOMPLETE.outputRows()); - - assertEquals(CREATION_TIME, QUERY_STATISTICS_INCOMPLETE.creationTime()); - assertEquals(START_TIME, QUERY_STATISTICS_INCOMPLETE.startTime()); - assertEquals(END_TIME, QUERY_STATISTICS_INCOMPLETE.endTime()); - assertEquals(BILLING_TIER, QUERY_STATISTICS_INCOMPLETE.billingTier()); - assertEquals(CACHE_HIT, QUERY_STATISTICS_INCOMPLETE.cacheHit()); - assertEquals(null, QUERY_STATISTICS_INCOMPLETE.totalBytesBilled()); - assertEquals(null, QUERY_STATISTICS_INCOMPLETE.totalBytesProcessed()); - assertEquals(null, QUERY_STATISTICS_INCOMPLETE.queryPlan()); - } - @Test public void testToPbAndFromPb() { compareExtractStatistics(EXTRACT_STATISTICS, diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatusTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatusTest.java index 34bf1bb10997..a8bff287246f 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatusTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatusTest.java @@ -51,21 +51,6 @@ public void testConstructor() { assertEquals(null, JOB_STATUS_INCOMPLETE2.getExecutionErrors()); } - @Test - public void testConstructorDeprecated() { - assertEquals(STATE, JOB_STATUS.state()); - assertEquals(ERROR, JOB_STATUS.error()); - assertEquals(ALL_ERRORS, JOB_STATUS.executionErrors()); - - assertEquals(STATE, JOB_STATUS_INCOMPLETE1.state()); - assertEquals(ERROR, JOB_STATUS_INCOMPLETE1.error()); - assertEquals(null, JOB_STATUS_INCOMPLETE1.executionErrors()); - - assertEquals(STATE, JOB_STATUS_INCOMPLETE2.state()); - assertEquals(null, JOB_STATUS_INCOMPLETE2.error()); - assertEquals(null, JOB_STATUS_INCOMPLETE2.executionErrors()); - } - @Test public void testToPbAndFromPb() { compareStatus(JOB_STATUS, JobStatus.fromPb(JOB_STATUS.toPb())); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java index 42529b1043e7..7b185e0421f0 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java @@ -118,30 +118,6 @@ public void testBuilder() { assertSame(serviceMockReturnsOptions, builtJob.getBigquery()); } - @Test - public void testBuilderDeprecated() { - initializeExpectedJob(2); - replay(bigquery); - Job builtJob = new Job.Builder(serviceMockReturnsOptions, COPY_CONFIGURATION) - .jobId(JOB_ID) - .setStatistics(COPY_JOB_STATISTICS) - .jobId(JOB_ID) - .setEtag(ETAG) - .setGeneratedId(GENERATED_ID) - .setSelfLink(SELF_LINK) - .setUserEmail(EMAIL) - .setStatus(JOB_STATUS) - .build(); - assertEquals(ETAG, builtJob.etag()); - assertEquals(GENERATED_ID, builtJob.generatedId()); - assertEquals(SELF_LINK, builtJob.selfLink()); - assertEquals(EMAIL, builtJob.userEmail()); - assertEquals(JOB_ID, builtJob.jobId()); - assertEquals(JOB_STATUS, builtJob.status()); - assertEquals(COPY_CONFIGURATION, builtJob.configuration()); - assertEquals(COPY_JOB_STATISTICS, builtJob.statistics()); - assertSame(serviceMockReturnsOptions, builtJob.bigquery()); - } @Test public void testToBuilder() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java index 548e8ebcdacc..675c05c1562c 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java @@ -57,16 +57,6 @@ public class LoadJobConfigurationTest { .setProjectionFields(PROJECTION_FIELDS) .setSchema(TABLE_SCHEMA) .build(); - private static final LoadJobConfiguration DEPRECATED_LOAD_CONFIGURATION = - LoadJobConfiguration.builder(TABLE_ID, SOURCE_URIS) - .createDisposition(CREATE_DISPOSITION) - .writeDisposition(WRITE_DISPOSITION) - .formatOptions(CSV_OPTIONS) - .ignoreUnknownValues(IGNORE_UNKNOWN_VALUES) - .maxBadRecords(MAX_BAD_RECORDS) - .projectionFields(PROJECTION_FIELDS) - .schema(TABLE_SCHEMA) - .build(); @Test public void testToBuilder() { @@ -105,32 +95,6 @@ public void testToBuilderIncomplete() { compareLoadJobConfiguration(configuration, configuration.toBuilder().build()); } - @Test - public void testBuilder() { - assertEquals(TABLE_ID, DEPRECATED_LOAD_CONFIGURATION.destinationTable()); - assertEquals(CREATE_DISPOSITION, DEPRECATED_LOAD_CONFIGURATION.createDisposition()); - assertEquals(WRITE_DISPOSITION, DEPRECATED_LOAD_CONFIGURATION.writeDisposition()); - assertEquals(CSV_OPTIONS, DEPRECATED_LOAD_CONFIGURATION.csvOptions()); - assertEquals(FORMAT, DEPRECATED_LOAD_CONFIGURATION.format()); - assertEquals(IGNORE_UNKNOWN_VALUES, DEPRECATED_LOAD_CONFIGURATION.ignoreUnknownValues()); - assertEquals(MAX_BAD_RECORDS, DEPRECATED_LOAD_CONFIGURATION.maxBadRecords()); - assertEquals(PROJECTION_FIELDS, DEPRECATED_LOAD_CONFIGURATION.projectionFields()); - assertEquals(TABLE_SCHEMA, DEPRECATED_LOAD_CONFIGURATION.schema()); - } - - @Test - public void testBuilderDeprecated() { - assertEquals(TABLE_ID, LOAD_CONFIGURATION.getDestinationTable()); - assertEquals(CREATE_DISPOSITION, LOAD_CONFIGURATION.getCreateDisposition()); - assertEquals(WRITE_DISPOSITION, LOAD_CONFIGURATION.getWriteDisposition()); - assertEquals(CSV_OPTIONS, LOAD_CONFIGURATION.getCsvOptions()); - assertEquals(FORMAT, LOAD_CONFIGURATION.getFormat()); - assertEquals(IGNORE_UNKNOWN_VALUES, LOAD_CONFIGURATION.ignoreUnknownValues()); - assertEquals(MAX_BAD_RECORDS, LOAD_CONFIGURATION.getMaxBadRecords()); - assertEquals(PROJECTION_FIELDS, LOAD_CONFIGURATION.getProjectionFields()); - assertEquals(TABLE_SCHEMA, LOAD_CONFIGURATION.getSchema()); - } - @Test public void testToPbAndFromPb() { compareLoadJobConfiguration(LOAD_CONFIGURATION, diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java index b847ae9688ca..4ec5d31cd94c 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java @@ -90,21 +90,6 @@ public class QueryJobConfigurationTest { .setDryRun(true) .setUseLegacySql(USE_LEGACY_SQL) .build(); - private static final QueryJobConfiguration DEPRECATED_QUERY_JOB_CONFIGURATION = - QueryJobConfiguration.builder(QUERY) - .useQueryCache(USE_QUERY_CACHE) - .tableDefinitions(TABLE_DEFINITIONS) - .allowLargeResults(ALLOW_LARGE_RESULTS) - .createDisposition(CREATE_DISPOSITION) - .defaultDataset(DATASET_ID) - .destinationTable(TABLE_ID) - .writeDisposition(WRITE_DISPOSITION) - .priority(PRIORITY) - .flattenResults(FLATTEN_RESULTS) - .userDefinedFunctions(USER_DEFINED_FUNCTIONS) - .dryRun(true) - .useLegacySql(USE_LEGACY_SQL) - .build(); @Test public void testToBuilder() { @@ -130,41 +115,6 @@ public void testToBuilderIncomplete() { compareQueryJobConfiguration(job, job.toBuilder().build()); } - @Test - public void testBuilder() { - assertEquals(ALLOW_LARGE_RESULTS, DEPRECATED_QUERY_JOB_CONFIGURATION.allowLargeResults()); - assertEquals(CREATE_DISPOSITION, DEPRECATED_QUERY_JOB_CONFIGURATION.getCreateDisposition()); - assertEquals(DATASET_ID, DEPRECATED_QUERY_JOB_CONFIGURATION.getDefaultDataset()); - assertEquals(TABLE_ID, DEPRECATED_QUERY_JOB_CONFIGURATION.getDestinationTable()); - assertEquals(FLATTEN_RESULTS, DEPRECATED_QUERY_JOB_CONFIGURATION.flattenResults()); - assertEquals(PRIORITY, DEPRECATED_QUERY_JOB_CONFIGURATION.getPriority()); - assertEquals(QUERY, DEPRECATED_QUERY_JOB_CONFIGURATION.getQuery()); - assertEquals(TABLE_DEFINITIONS, DEPRECATED_QUERY_JOB_CONFIGURATION.getTableDefinitions()); - assertEquals(USE_QUERY_CACHE, DEPRECATED_QUERY_JOB_CONFIGURATION.useQueryCache()); - assertEquals(USER_DEFINED_FUNCTIONS, - DEPRECATED_QUERY_JOB_CONFIGURATION.getUserDefinedFunctions()); - assertEquals(WRITE_DISPOSITION, DEPRECATED_QUERY_JOB_CONFIGURATION.getWriteDisposition()); - assertTrue(DEPRECATED_QUERY_JOB_CONFIGURATION.dryRun()); - assertTrue(DEPRECATED_QUERY_JOB_CONFIGURATION.useLegacySql()); - } - - @Test - public void testBuilderDeprecated() { - assertEquals(ALLOW_LARGE_RESULTS, QUERY_JOB_CONFIGURATION.allowLargeResults()); - assertEquals(CREATE_DISPOSITION, QUERY_JOB_CONFIGURATION.createDisposition()); - assertEquals(DATASET_ID, QUERY_JOB_CONFIGURATION.defaultDataset()); - assertEquals(TABLE_ID, QUERY_JOB_CONFIGURATION.destinationTable()); - assertEquals(FLATTEN_RESULTS, QUERY_JOB_CONFIGURATION.flattenResults()); - assertEquals(PRIORITY, QUERY_JOB_CONFIGURATION.priority()); - assertEquals(QUERY, QUERY_JOB_CONFIGURATION.query()); - assertEquals(TABLE_DEFINITIONS, QUERY_JOB_CONFIGURATION.tableDefinitions()); - assertEquals(USE_QUERY_CACHE, QUERY_JOB_CONFIGURATION.useQueryCache()); - assertEquals(USER_DEFINED_FUNCTIONS, QUERY_JOB_CONFIGURATION.userDefinedFunctions()); - assertEquals(WRITE_DISPOSITION, QUERY_JOB_CONFIGURATION.writeDisposition()); - assertTrue(QUERY_JOB_CONFIGURATION.dryRun()); - assertTrue(QUERY_JOB_CONFIGURATION.useLegacySql()); - } - @Test public void testToPbAndFromPb() { assertNotNull(QUERY_JOB_CONFIGURATION.toPb().getQuery()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestTest.java index 82f37aba50df..c866de7834c9 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestTest.java @@ -53,14 +53,6 @@ public class QueryRequestTest { .setUseLegacySql(USE_LEGACY_SQL) .setPositionalParameters(POSITIONAL_PARAMETERS) .build(); - private static final QueryRequest DEPRECATED_QUERY_REQUEST = QueryRequest.builder(QUERY) - .useQueryCache(USE_QUERY_CACHE) - .defaultDataset(DATASET_ID) - .dryRun(DRY_RUN) - .pageSize(PAGE_SIZE) - .maxWaitTime(MAX_WAIT_TIME) - .useLegacySql(USE_LEGACY_SQL) - .build(); @Rule public ExpectedException thrown = ExpectedException.none(); @@ -98,20 +90,6 @@ public void testBuilder() { QueryRequest.newBuilder(null); } - @Test - public void testBuilderDeprecated() { - assertEquals(QUERY, DEPRECATED_QUERY_REQUEST.query()); - assertEquals(USE_QUERY_CACHE, DEPRECATED_QUERY_REQUEST.useQueryCache()); - assertEquals(DATASET_ID, DEPRECATED_QUERY_REQUEST.defaultDataset()); - assertEquals(DRY_RUN, DEPRECATED_QUERY_REQUEST.dryRun()); - assertEquals(PAGE_SIZE, DEPRECATED_QUERY_REQUEST.pageSize()); - assertEquals(MAX_WAIT_TIME, DEPRECATED_QUERY_REQUEST.maxWaitTime()); - assertTrue(DEPRECATED_QUERY_REQUEST.getNamedParameters().isEmpty()); - assertTrue(DEPRECATED_QUERY_REQUEST.getPositionalParameters().isEmpty()); - assertFalse(DEPRECATED_QUERY_REQUEST.useLegacySql()); - thrown.expect(NullPointerException.class); - QueryRequest.builder(null); - } @Test public void testNamedParameters() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryResponseTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryResponseTest.java index d0595e2d44e1..ae151f9b699d 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryResponseTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryResponseTest.java @@ -32,19 +32,15 @@ public class QueryResponseTest { private static final String ETAG = "etag"; private static final Field FIELD_SCHEMA1 = Field.newBuilder("StringField", Field.Type.string()) - .setMode(Field.Mode.NULLABLE) - .setDescription("FieldDescription1") - .build(); + .setMode(Field.Mode.NULLABLE) + .setDescription("FieldDescription1") + .build(); + private static final Schema SCHEMA = Schema.of(FIELD_SCHEMA1); private static final JobId JOB_ID = JobId.of("project", "job"); private static final Long TOTAL_ROWS = 42L; private static final QueryResult.QueryResultsPageFetcher FETCHER = new QueryResult.QueryResultsPageFetcher() { - @Override - @Deprecated - public QueryResult nextPage() { - return getNextPage(); - } @Override public QueryResult getNextPage() { @@ -85,15 +81,6 @@ public void testBuilder() { assertTrue(QUERY_RESPONSE.hasErrors()); } - @Test - public void testBuilderDeprecated() { - assertEquals(ETAG, QUERY_RESPONSE.etag()); - assertEquals(QUERY_RESULT, QUERY_RESPONSE.result()); - assertEquals(JOB_ID, QUERY_RESPONSE.jobId()); - assertEquals(JOB_COMPLETE, QUERY_RESPONSE.jobCompleted()); - assertEquals(ERRORS, QUERY_RESPONSE.executionErrors()); - assertTrue(QUERY_RESPONSE.hasErrors()); - } @Test public void testBuilderIncomplete() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryResultTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryResultTest.java index 9ba62d0fe923..a102a1c2fa77 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryResultTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryResultTest.java @@ -29,18 +29,14 @@ public class QueryResultTest { private static final String CURSOR = "cursor"; private static final Field FIELD_SCHEMA1 = Field.newBuilder("StringField", Field.Type.string()) - .setMode(Field.Mode.NULLABLE) - .setDescription("FieldDescription1") - .build(); + .setMode(Field.Mode.NULLABLE) + .setDescription("FieldDescription1") + .build(); + private static final Schema SCHEMA = Schema.of(FIELD_SCHEMA1); private static final long TOTAL_ROWS = 42L; private static final QueryResult.QueryResultsPageFetcher FETCHER = new QueryResult.QueryResultsPageFetcher() { - @Override - @Deprecated - public QueryResult nextPage() { - return getNextPage(); - } @Override public QueryResult getNextPage() { @@ -78,21 +74,6 @@ public void testBuilder() { assertEquals(null, QUERY_RESULT_INCOMPLETE.getNextPage()); } - @Test - public void testBuilderDeprecated() { - assertEquals(SCHEMA, QUERY_RESULT.schema()); - assertEquals(TOTAL_ROWS, QUERY_RESULT.totalRows()); - assertEquals(TOTAL_BYTES_PROCESSED, QUERY_RESULT.totalBytesProcessed()); - assertEquals(CACHE_HIT, QUERY_RESULT.cacheHit()); - assertEquals(CURSOR, QUERY_RESULT.nextPageCursor()); - assertEquals(null, QUERY_RESULT.nextPage()); - assertEquals(null, QUERY_RESULT_INCOMPLETE.schema()); - assertEquals(0L, QUERY_RESULT_INCOMPLETE.totalRows()); - assertEquals(TOTAL_BYTES_PROCESSED, QUERY_RESULT_INCOMPLETE.totalBytesProcessed()); - assertEquals(false, QUERY_RESULT_INCOMPLETE.cacheHit()); - assertEquals(null, QUERY_RESULT_INCOMPLETE.nextPageCursor()); - assertEquals(null, QUERY_RESULT_INCOMPLETE.nextPage()); - } @Test public void testEquals() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryStageTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryStageTest.java index 1bc90d8f4032..20c063c8dc78 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryStageTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryStageTest.java @@ -69,13 +69,6 @@ public void testQueryStepConstructor() { assertEquals(SUBSTEPS2, QUERY_STEP2.getSubsteps()); } - @Test - public void testQueryStepConstructorDeprecated() { - assertEquals("KIND", QUERY_STEP1.name()); - assertEquals("KIND", QUERY_STEP2.name()); - assertEquals(SUBSTEPS1, QUERY_STEP1.substeps()); - assertEquals(SUBSTEPS2, QUERY_STEP2.substeps()); - } @Test public void testBuilder() { @@ -94,22 +87,6 @@ public void testBuilder() { assertEquals(WRITE_RATIO_MAX, QUERY_STAGE.getWriteRatioMax(), 0); } - @Test - public void testBuilderDeprecated() { - assertEquals(COMPUTE_RATIO_AVG, QUERY_STAGE.computeRatioAvg(), 0); - assertEquals(COMPUTE_RATIO_MAX, QUERY_STAGE.computeRatioMax(), 0); - assertEquals(ID, QUERY_STAGE.generatedId()); - assertEquals(NAME, QUERY_STAGE.name()); - assertEquals(READ_RATIO_AVG, QUERY_STAGE.readRatioAvg(), 0); - assertEquals(READ_RATIO_MAX, QUERY_STAGE.readRatioMax(), 0); - assertEquals(RECORDS_READ, QUERY_STAGE.recordsRead()); - assertEquals(RECORDS_WRITTEN, QUERY_STAGE.recordsWritten()); - assertEquals(STEPS, QUERY_STAGE.steps()); - assertEquals(WAIT_RATIO_AVG, QUERY_STAGE.waitRatioAvg(), 0); - assertEquals(WAIT_RATIO_MAX, QUERY_STAGE.waitRatioMax(), 0); - assertEquals(WRITE_RATIO_AVG, QUERY_STAGE.writeRatioAvg(), 0); - assertEquals(WRITE_RATIO_MAX, QUERY_STAGE.writeRatioMax(), 0); - } @Test public void testToAndFromPb() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SchemaTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SchemaTest.java index 9fe59e377e59..767388a973d3 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SchemaTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SchemaTest.java @@ -44,7 +44,6 @@ public class SchemaTest { private static final List FIELDS = ImmutableList.of(FIELD_SCHEMA1, FIELD_SCHEMA2, FIELD_SCHEMA3); private static final Schema TABLE_SCHEMA = Schema.newBuilder().setFields(FIELDS).build(); - private static final Schema DEPRECATED_TABLE_SCHEMA = Schema.builder().fields(FIELDS).build(); @Test public void testToBuilder() { @@ -61,16 +60,6 @@ public void testBuilder() { compareTableSchema(TABLE_SCHEMA, schema); } - @Test - public void testBuilderDepreacated() { - assertEquals(FIELDS, DEPRECATED_TABLE_SCHEMA.fields()); - Schema schema = DEPRECATED_TABLE_SCHEMA.toBuilder() - .fields(FIELD_SCHEMA1, FIELD_SCHEMA2) - .addField(FIELD_SCHEMA3) - .build(); - compareTableSchema(DEPRECATED_TABLE_SCHEMA, schema); - } - @Test public void testOf() { compareTableSchema(TABLE_SCHEMA, Schema.of(FIELDS)); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java index 2f915a71864a..1a8e1aa9acd6 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java @@ -57,15 +57,6 @@ public class StandardTableDefinitionTest { .setSchema(TABLE_SCHEMA) .setTimePartitioning(TIME_PARTITIONING) .build(); - private static final StandardTableDefinition DEPRECATED_TABLE_DEFINITION = - StandardTableDefinition.builder() - .setLocation(LOCATION) - .setNumBytes(NUM_BYTES) - .setNumRows(NUM_ROWS) - .setStreamingBuffer(STREAMING_BUFFER) - .schema(TABLE_SCHEMA) - .timePartitioning(TIME_PARTITIONING) - .build(); @Test public void testToBuilder() { @@ -96,16 +87,6 @@ public void testBuilder() { assertEquals(TIME_PARTITIONING, TABLE_DEFINITION.getTimePartitioning()); } - @Test - public void testBuilderDeprecated() { - assertEquals(TableDefinition.Type.TABLE, DEPRECATED_TABLE_DEFINITION.type()); - assertEquals(TABLE_SCHEMA, DEPRECATED_TABLE_DEFINITION.schema()); - assertEquals(LOCATION, DEPRECATED_TABLE_DEFINITION.location()); - assertEquals(NUM_BYTES, DEPRECATED_TABLE_DEFINITION.numBytes()); - assertEquals(NUM_ROWS, DEPRECATED_TABLE_DEFINITION.numRows()); - assertEquals(STREAMING_BUFFER, DEPRECATED_TABLE_DEFINITION.streamingBuffer()); - assertEquals(TIME_PARTITIONING, DEPRECATED_TABLE_DEFINITION.timePartitioning()); - } @Test public void testOf() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableIdTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableIdTest.java index a519d4d9966a..d809e3be7da0 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableIdTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableIdTest.java @@ -35,15 +35,6 @@ public void testOf() { assertEquals("table", TABLE_COMPLETE.getTable()); } - @Test - public void testOfDeprecated() { - assertEquals(null, TABLE.project()); - assertEquals("dataset", TABLE.dataset()); - assertEquals("table", TABLE.table()); - assertEquals("project", TABLE_COMPLETE.project()); - assertEquals("dataset", TABLE_COMPLETE.dataset()); - assertEquals("table", TABLE_COMPLETE.table()); - } @Test public void testEquals() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableInfoTest.java index fcc78f3e2c2d..187c4aa8d03e 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableInfoTest.java @@ -83,7 +83,7 @@ public class TableInfoTest { private static final List USER_DEFINED_FUNCTIONS = ImmutableList.of(UserDefinedFunction.inline("Function"), UserDefinedFunction.fromUri("URI")); private static final ViewDefinition VIEW_DEFINITION = - ViewDefinition.builder(VIEW_QUERY, USER_DEFINED_FUNCTIONS).build(); + ViewDefinition.newBuilder(VIEW_QUERY, USER_DEFINED_FUNCTIONS).build(); private static final TableInfo TABLE_INFO = TableInfo.newBuilder(TABLE_ID, TABLE_DEFINITION) .setCreationTime(CREATION_TIME) @@ -116,17 +116,6 @@ public class TableInfoTest { .setLastModifiedTime(LAST_MODIFIED_TIME) .setSelfLink(SELF_LINK) .build(); - private static final TableInfo DEPRECATED_TABLE_INFO = - TableInfo.builder(TABLE_ID, TABLE_DEFINITION) - .setCreationTime(CREATION_TIME) - .description(DESCRIPTION) - .setEtag(ETAG) - .expirationTime(EXPIRATION_TIME) - .friendlyName(FRIENDLY_NAME) - .setGeneratedId(GENERATED_ID) - .setLastModifiedTime(LAST_MODIFIED_TIME) - .setSelfLink(SELF_LINK) - .build(); @Test public void testToBuilder() { @@ -188,19 +177,6 @@ public void testBuilder() { assertEquals(SELF_LINK, EXTERNAL_TABLE_INFO.getSelfLink()); } - @Test - public void testBuilderDeprecated() { - assertEquals(TABLE_ID, DEPRECATED_TABLE_INFO.tableId()); - assertEquals(CREATION_TIME, DEPRECATED_TABLE_INFO.creationTime()); - assertEquals(DESCRIPTION, DEPRECATED_TABLE_INFO.description()); - assertEquals(ETAG, DEPRECATED_TABLE_INFO.etag()); - assertEquals(EXPIRATION_TIME, DEPRECATED_TABLE_INFO.expirationTime()); - assertEquals(FRIENDLY_NAME, DEPRECATED_TABLE_INFO.friendlyName()); - assertEquals(GENERATED_ID, DEPRECATED_TABLE_INFO.generatedId()); - assertEquals(LAST_MODIFIED_TIME, DEPRECATED_TABLE_INFO.lastModifiedTime()); - assertEquals(TABLE_DEFINITION, DEPRECATED_TABLE_INFO.definition()); - assertEquals(SELF_LINK, DEPRECATED_TABLE_INFO.selfLink()); - } @Test public void testOf() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java index dae32a89c830..015eb36203fe 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java @@ -132,32 +132,6 @@ public void testBuilder() { assertSame(serviceMockReturnsOptions, builtTable.getBigquery()); } - @Test - public void testBuilderDeprecated() { - initializeExpectedTable(2); - replay(bigquery); - Table builtTable = new Table.Builder(serviceMockReturnsOptions, TABLE_ID1, TABLE_DEFINITION) - .setCreationTime(CREATION_TIME) - .description(DESCRIPTION) - .setEtag(ETAG) - .expirationTime(EXPIRATION_TIME) - .friendlyName(FRIENDLY_NAME) - .setGeneratedId(GENERATED_ID) - .setLastModifiedTime(LAST_MODIFIED_TIME) - .setSelfLink(SELF_LINK) - .build(); - assertEquals(TABLE_ID1, builtTable.tableId()); - assertEquals(CREATION_TIME, builtTable.creationTime()); - assertEquals(DESCRIPTION, builtTable.description()); - assertEquals(ETAG, builtTable.etag()); - assertEquals(EXPIRATION_TIME, builtTable.expirationTime()); - assertEquals(FRIENDLY_NAME, builtTable.friendlyName()); - assertEquals(GENERATED_ID, builtTable.generatedId()); - assertEquals(LAST_MODIFIED_TIME, builtTable.lastModifiedTime()); - assertEquals(TABLE_DEFINITION, builtTable.definition()); - assertEquals(SELF_LINK, builtTable.selfLink()); - assertSame(serviceMockReturnsOptions, builtTable.bigquery()); - } @Test public void testToBuilder() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TimePartitioningTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TimePartitioningTest.java index d5e6c3cef989..ff847ab81019 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TimePartitioningTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TimePartitioningTest.java @@ -44,14 +44,6 @@ public void testOf() { assertNull(partitioning.getExpirationMs()); } - @Test - public void testOfDeprecated() { - assertEquals(TYPE, TIME_PARTITIONING.type()); - assertEquals(EXPIRATION_MS, TIME_PARTITIONING.expirationMs().longValue()); - TimePartitioning partitioning = TimePartitioning.of(TYPE); - assertEquals(TYPE, partitioning.type()); - assertNull(partitioning.expirationMs()); - } @Test public void testTypeOf_Npe() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/UserDefinedFunctionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/UserDefinedFunctionTest.java index 214d6725ef90..40fb6efa91ff 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/UserDefinedFunctionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/UserDefinedFunctionTest.java @@ -36,13 +36,6 @@ public void testConstructor() { assertEquals(UserDefinedFunction.Type.FROM_URI, URI_FUNCTION.getType()); } - @Test - public void testConstructorDeprecated() { - assertEquals(INLINE, INLINE_FUNCTION.content()); - assertEquals(UserDefinedFunction.Type.INLINE, INLINE_FUNCTION.type()); - assertEquals(URI, URI_FUNCTION.content()); - assertEquals(UserDefinedFunction.Type.FROM_URI, URI_FUNCTION.type()); - } @Test public void testFactoryMethod() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ViewDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ViewDefinitionTest.java index 864b8a97e659..7cd2c5711866 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ViewDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ViewDefinitionTest.java @@ -33,8 +33,6 @@ public class ViewDefinitionTest { ImmutableList.of(UserDefinedFunction.inline("Function"), UserDefinedFunction.fromUri("URI")); private static final ViewDefinition VIEW_DEFINITION = ViewDefinition.newBuilder(VIEW_QUERY, USER_DEFINED_FUNCTIONS).build(); - private static final ViewDefinition DEPRECATED_VIEW_DEFINITION = - ViewDefinition.builder(VIEW_QUERY, USER_DEFINED_FUNCTIONS).build(); @Test public void testToBuilder() { @@ -78,28 +76,6 @@ public void testBuilder() { assertNull(viewDefinition.getUserDefinedFunctions()); } - @Test - public void testBuilderDeprecated() { - assertEquals(VIEW_QUERY, DEPRECATED_VIEW_DEFINITION.query()); - assertEquals(TableDefinition.Type.VIEW, DEPRECATED_VIEW_DEFINITION.type()); - assertEquals(USER_DEFINED_FUNCTIONS, DEPRECATED_VIEW_DEFINITION.userDefinedFunctions()); - ViewDefinition viewDefinition = ViewDefinition.builder(VIEW_QUERY) - .userDefinedFunctions(UserDefinedFunction.inline("Function"), - UserDefinedFunction.fromUri("URI")) - .build(); - assertEquals(VIEW_QUERY, viewDefinition.query()); - assertEquals(TableDefinition.Type.VIEW, viewDefinition.type()); - assertEquals(USER_DEFINED_FUNCTIONS, viewDefinition.userDefinedFunctions()); - viewDefinition = ViewDefinition.builder(VIEW_QUERY, - UserDefinedFunction.inline("Function"), UserDefinedFunction.fromUri("URI")).build(); - assertEquals(VIEW_QUERY, viewDefinition.query()); - assertEquals(TableDefinition.Type.VIEW, viewDefinition.type()); - assertEquals(USER_DEFINED_FUNCTIONS, viewDefinition.userDefinedFunctions()); - viewDefinition = ViewDefinition.builder(VIEW_QUERY).build(); - assertEquals(VIEW_QUERY, viewDefinition.query()); - assertEquals(TableDefinition.Type.VIEW, viewDefinition.type()); - assertNull(viewDefinition.userDefinedFunctions()); - } @Test public void testToAndFromPb() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java index 0e3524d2fb25..f72fc5f0d856 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java @@ -57,16 +57,6 @@ public class WriteChannelConfigurationTest { .setProjectionFields(PROJECTION_FIELDS) .setSchema(TABLE_SCHEMA) .build(); - private static final WriteChannelConfiguration DEPRECATED_LOAD_CONFIGURATION = - WriteChannelConfiguration.builder(TABLE_ID) - .createDisposition(CREATE_DISPOSITION) - .writeDisposition(WRITE_DISPOSITION) - .formatOptions(CSV_OPTIONS) - .ignoreUnknownValues(IGNORE_UNKNOWN_VALUES) - .maxBadRecords(MAX_BAD_RECORDS) - .projectionFields(PROJECTION_FIELDS) - .schema(TABLE_SCHEMA) - .build(); @Test public void testToBuilder() { @@ -126,36 +116,6 @@ public void testBuilder() { assertEquals(TABLE_SCHEMA, loadConfiguration.getSchema()); } - @Test - public void testBuilderDeprecated() { - assertEquals(TABLE_ID, DEPRECATED_LOAD_CONFIGURATION.destinationTable()); - assertEquals(CREATE_DISPOSITION, DEPRECATED_LOAD_CONFIGURATION.createDisposition()); - assertEquals(WRITE_DISPOSITION, DEPRECATED_LOAD_CONFIGURATION.writeDisposition()); - assertEquals(CSV_OPTIONS, DEPRECATED_LOAD_CONFIGURATION.csvOptions()); - assertEquals(FORMAT, DEPRECATED_LOAD_CONFIGURATION.format()); - assertEquals(IGNORE_UNKNOWN_VALUES, DEPRECATED_LOAD_CONFIGURATION.ignoreUnknownValues()); - assertEquals(MAX_BAD_RECORDS, DEPRECATED_LOAD_CONFIGURATION.maxBadRecords()); - assertEquals(PROJECTION_FIELDS, DEPRECATED_LOAD_CONFIGURATION.projectionFields()); - assertEquals(TABLE_SCHEMA, DEPRECATED_LOAD_CONFIGURATION.schema()); - WriteChannelConfiguration loadConfiguration = - WriteChannelConfiguration.builder(TABLE_ID, CSV_OPTIONS) - .createDisposition(CREATE_DISPOSITION) - .writeDisposition(WRITE_DISPOSITION) - .ignoreUnknownValues(IGNORE_UNKNOWN_VALUES) - .maxBadRecords(MAX_BAD_RECORDS) - .projectionFields(PROJECTION_FIELDS) - .schema(TABLE_SCHEMA) - .build(); - assertEquals(TABLE_ID, loadConfiguration.destinationTable()); - assertEquals(CREATE_DISPOSITION, loadConfiguration.createDisposition()); - assertEquals(WRITE_DISPOSITION, loadConfiguration.writeDisposition()); - assertEquals(CSV_OPTIONS, loadConfiguration.csvOptions()); - assertEquals(FORMAT, loadConfiguration.format()); - assertEquals(IGNORE_UNKNOWN_VALUES, loadConfiguration.ignoreUnknownValues()); - assertEquals(MAX_BAD_RECORDS, loadConfiguration.maxBadRecords()); - assertEquals(PROJECTION_FIELDS, loadConfiguration.projectionFields()); - assertEquals(TABLE_SCHEMA, loadConfiguration.schema()); - } @Test public void testToPbAndFromPb() { diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/Compute.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/Compute.java index 97ba2e539208..2bf6197e493b 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/Compute.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/Compute.java @@ -64,12 +64,6 @@ enum DiskTypeField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } - @Override public String getSelector() { return selector; @@ -105,12 +99,6 @@ enum MachineTypeField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } - @Override public String getSelector() { return selector; @@ -142,12 +130,6 @@ enum RegionField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } - @Override public String getSelector() { return selector; @@ -178,12 +160,6 @@ enum ZoneField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } - @Override public String getSelector() { return selector; @@ -209,12 +185,6 @@ enum LicenseField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } - @Override public String getSelector() { return selector; @@ -264,12 +234,6 @@ enum OperationField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } - @Override public String getSelector() { return selector; @@ -303,12 +267,6 @@ enum AddressField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } - @Override public String getSelector() { return selector; @@ -350,12 +308,6 @@ enum DiskField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } - @Override public String getSelector() { return selector; @@ -390,12 +342,6 @@ enum SnapshotField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } - @Override public String getSelector() { return selector; @@ -432,12 +378,6 @@ enum ImageField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } - @Override public String getSelector() { return selector; @@ -469,12 +409,6 @@ enum SubnetworkField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } - @Override public String getSelector() { return selector; @@ -507,12 +441,6 @@ enum NetworkField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } - @Override public String getSelector() { return selector; @@ -552,12 +480,6 @@ enum InstanceField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } - @Override public String getSelector() { return selector; @@ -1151,7 +1073,7 @@ private DiskTypeOption(ComputeRpc.Option option, Object value) { /** * Returns an option to specify the disk type's fields to be returned by the RPC call. If this * option is not provided, all disk type's fields are returned. {@code DiskTypeOption.fields} - * can be used to specify only the fields of interest. {@link DiskType#diskTypeId()} is always + * can be used to specify only the fields of interest. {@link DiskType#getDiskTypeId()} is always * returned, even if not specified. */ public static DiskTypeOption fields(DiskTypeField... fields) { @@ -1197,7 +1119,7 @@ public static DiskTypeListOption pageToken(String pageToken) { * Returns an option to specify the disk type's fields to be returned by the RPC call. If this * option is not provided, all disk type's fields are returned. * {@code DiskTypeListOption.fields} can be used to specify only the fields of interest. - * {@link DiskType#diskTypeId()} is always returned, even if not specified. + * {@link DiskType#getDiskTypeId()} is always returned, even if not specified. */ public static DiskTypeListOption fields(DiskTypeField... fields) { return new DiskTypeListOption(ComputeRpc.Option.FIELDS, @@ -1254,7 +1176,7 @@ private MachineTypeOption(ComputeRpc.Option option, Object value) { * Returns an option to specify the machine type's fields to be returned by the RPC call. If * this option is not provided, all machine type's fields are returned. * {@code MachineTypeOption.fields} can be used to specify only the fields of interest. - * {@link MachineType#machineTypeId()} is always returned, even if not specified. + * {@link MachineType#getMachineTypeId()} is always returned, even if not specified. */ public static MachineTypeOption fields(MachineTypeField... fields) { return new MachineTypeOption(ComputeRpc.Option.FIELDS, @@ -1299,7 +1221,7 @@ public static MachineTypeListOption pageToken(String pageToken) { * Returns an option to specify the machine type's fields to be returned by the RPC call. If * this option is not provided, all machine type's fields are returned. * {@code MachineTypeListOption.fields} can be used to specify only the fields of interest. - * {@link MachineType#machineTypeId()} is always returned, even if not specified. + * {@link MachineType#getMachineTypeId()} is always returned, even if not specified. */ public static MachineTypeListOption fields(MachineTypeField... fields) { return new MachineTypeListOption(ComputeRpc.Option.FIELDS, @@ -1355,7 +1277,7 @@ private RegionOption(ComputeRpc.Option option, Object value) { /** * Returns an option to specify the region's fields to be returned by the RPC call. If this * option is not provided, all region's fields are returned. {@code RegionOption.fields} can be - * used to specify only the fields of interest. {@link Region#regionId()} is always + * used to specify only the fields of interest. {@link Region#getRegionId()} is always * returned, even if not specified. */ public static RegionOption fields(RegionField... fields) { @@ -1400,7 +1322,7 @@ public static RegionListOption pageToken(String pageToken) { /** * Returns an option to specify the region's fields to be returned by the RPC call. If this * option is not provided, all region's fields are returned. {@code RegionListOption.fields} can - * be used to specify only the fields of interest. {@link Region#regionId()} is always + * be used to specify only the fields of interest. {@link Region#getRegionId()} is always * returned, even if not specified. */ public static RegionListOption fields(RegionField... fields) { @@ -1423,7 +1345,7 @@ private ZoneOption(ComputeRpc.Option option, Object value) { /** * Returns an option to specify the zone's fields to be returned by the RPC call. If this option * is not provided, all zone's fields are returned. {@code ZoneOption.fields} can be used to - * specify only the fields of interest. {@link Zone#zoneId()} is always returned, even if + * specify only the fields of interest. {@link Zone#getZoneId()} is always returned, even if * not specified. */ public static ZoneOption fields(ZoneField... fields) { @@ -1468,7 +1390,7 @@ public static ZoneListOption pageToken(String pageToken) { /** * Returns an option to specify the zone's fields to be returned by the RPC call. If this option * is not provided, all zone's fields are returned. {@code ZoneListOption.fields} can be used to - * specify only the fields of interest. {@link Zone#zoneId()} is always returned, even if + * specify only the fields of interest. {@link Zone#getZoneId()} is always returned, even if * not specified. */ public static ZoneListOption fields(ZoneField... fields) { @@ -1491,7 +1413,7 @@ private LicenseOption(ComputeRpc.Option option, Object value) { /** * Returns an option to specify the license's fields to be returned by the RPC call. If this * option is not provided, all license's fields are returned. {@code LicenseOption.fields} can - * be used to specify only the fields of interest. {@link License#licenseId()} is always + * be used to specify only the fields of interest. {@link License#getLicenseId()} is always * returned, even if not specified. */ public static LicenseOption fields(LicenseField... fields) { @@ -1514,7 +1436,7 @@ private OperationOption(ComputeRpc.Option option, Object value) { /** * Returns an option to specify the operation's fields to be returned by the RPC call. If this * option is not provided, all operation's fields are returned. {@code OperationOption.fields} - * can be used to specify only the fields of interest. {@link Operation#operationId()} is + * can be used to specify only the fields of interest. {@link Operation#getOperationId()} is * always returned, even if not specified. */ public static OperationOption fields(OperationField... fields) { @@ -1560,7 +1482,7 @@ public static OperationListOption pageToken(String pageToken) { * Returns an option to specify the operation's fields to be returned by the RPC call. If this * option is not provided, all operation's fields are returned. * {@code OperationListOption.fields} can be used to specify only the fields of interest. - * {@link Operation#operationId()} is always returned, even if not specified. + * {@link Operation#getOperationId()} is always returned, even if not specified. */ public static OperationListOption fields(OperationField... fields) { return new OperationListOption(ComputeRpc.Option.FIELDS, @@ -1582,7 +1504,7 @@ private AddressOption(ComputeRpc.Option option, Object value) { /** * Returns an option to specify the address' fields to be returned by the RPC call. If this * option is not provided, all address' fields are returned. {@code AddressOption.fields} can be - * used to specify only the fields of interest. {@link Address#addressId()} is always + * used to specify only the fields of interest. {@link Address#getAddressId()} is always * returned, even if not specified. */ public static AddressOption fields(AddressField... fields) { @@ -1627,7 +1549,7 @@ public static AddressListOption pageToken(String pageToken) { /** * Returns an option to specify the address' fields to be returned by the RPC call. If this * option is not provided, all address' fields are returned. {@code AddressListOption.fields} - * can be used to specify only the fields of interest. {@link Address#addressId()} is always + * can be used to specify only the fields of interest. {@link Address#getAddressId()} is always * returned, even if not specified. */ public static AddressListOption fields(AddressField... fields) { @@ -1684,7 +1606,7 @@ private SnapshotOption(ComputeRpc.Option option, Object value) { /** * Returns an option to specify the snapshot's fields to be returned by the RPC call. If this * option is not provided, all the snapshot's fields are returned. {@code SnapshotOption.fields} - * can be used to specify only the fields of interest. {@link Snapshot#snapshotId()} is always + * can be used to specify only the fields of interest. {@link Snapshot#getSnapshotId()} is always * returned, even if not specified. */ public static SnapshotOption fields(SnapshotField... fields) { @@ -1730,7 +1652,7 @@ public static SnapshotListOption pageToken(String pageToken) { * Returns an option to specify the snapshot's fields to be returned by the RPC call. If this * option is not provided, all the snapshot's fields are returned. * {@code SnapshotListOption.fields} can be used to specify only the fields of interest. - * {@link Snapshot#snapshotId()} is always returned, even if not specified. + * {@link Snapshot#getSnapshotId()} is always returned, even if not specified. */ public static SnapshotListOption fields(SnapshotField... fields) { return new SnapshotListOption(ComputeRpc.Option.FIELDS, diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/ComputeImpl.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/ComputeImpl.java index 5b66cefb182a..34cdaf57ea33 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/ComputeImpl.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/ComputeImpl.java @@ -50,12 +50,6 @@ private static class GlobalOperationPageFetcher implements NextPageFetcher nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listGlobalOperations(serviceOptions, requestOptions); @@ -77,12 +71,6 @@ private static class DiskTypePageFetcher implements NextPageFetcher { this.zone = zone; } - @Override - @Deprecated - public Page nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listDiskTypes(zone, serviceOptions, requestOptions); @@ -102,12 +90,6 @@ private static class AggregatedDiskTypePageFetcher implements NextPageFetcher nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listDiskTypes(serviceOptions, requestOptions); @@ -129,12 +111,6 @@ private static class MachineTypePageFetcher implements NextPageFetcher nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listMachineTypes(zone, serviceOptions, requestOptions); @@ -154,12 +130,6 @@ private static class AggregatedMachineTypePageFetcher implements NextPageFetcher this.serviceOptions = serviceOptions; } - @Override - @Deprecated - public Page nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listMachineTypes(serviceOptions, requestOptions); @@ -179,12 +149,6 @@ private static class RegionPageFetcher implements NextPageFetcher { this.serviceOptions = serviceOptions; } - @Override - @Deprecated - public Page nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listRegions(serviceOptions, requestOptions); @@ -204,12 +168,6 @@ private static class ZonePageFetcher implements NextPageFetcher { this.serviceOptions = serviceOptions; } - @Override - @Deprecated - public Page nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listZones(serviceOptions, requestOptions); @@ -231,12 +189,6 @@ private static class RegionOperationPageFetcher implements NextPageFetcher nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listRegionOperations(region, serviceOptions, requestOptions); @@ -258,12 +210,6 @@ private static class ZoneOperationPageFetcher implements NextPageFetcher nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listZoneOperations(zone, serviceOptions, requestOptions); @@ -283,12 +229,6 @@ private static class GlobalAddressPageFetcher implements NextPageFetcher
nextPage() { - return getNextPage(); - } - @Override public Page
getNextPage() { return listGlobalAddresses(serviceOptions, requestOptions); @@ -310,12 +250,6 @@ private static class RegionAddressPageFetcher implements NextPageFetcher
nextPage() { - return getNextPage(); - } - @Override public Page
getNextPage() { return listRegionAddresses(region, serviceOptions, requestOptions); @@ -335,12 +269,6 @@ private static class AggregatedAddressPageFetcher implements NextPageFetcher nextPage() { - return getNextPage(); - } - @Override public Page
getNextPage() { return listAddresses(serviceOptions, requestOptions); @@ -360,12 +288,6 @@ private static class SnapshotPageFetcher implements NextPageFetcher { this.serviceOptions = serviceOptions; } - @Override - @Deprecated - public Page nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listSnapshots(serviceOptions, requestOptions); @@ -387,12 +309,6 @@ private static class ImagePageFetcher implements NextPageFetcher { this.project = project; } - @Override - @Deprecated - public Page nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listImages(project, serviceOptions, requestOptions); @@ -414,12 +330,6 @@ private static class DiskPageFetcher implements NextPageFetcher { this.zone = zone; } - @Override - @Deprecated - public Page nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listDisks(zone, serviceOptions, requestOptions); @@ -439,12 +349,6 @@ private static class AggregatedDiskPageFetcher implements NextPageFetcher this.serviceOptions = serviceOptions; } - @Override - @Deprecated - public Page nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listDisks(serviceOptions, requestOptions); @@ -466,12 +370,6 @@ private static class SubnetworkPageFetcher implements NextPageFetcher nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listSubnetworks(region, serviceOptions, requestOptions); @@ -491,12 +389,6 @@ private static class AggregatedSubnetworkPageFetcher implements NextPageFetcher< this.serviceOptions = serviceOptions; } - @Override - @Deprecated - public Page nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listSubnetworks(serviceOptions, requestOptions); @@ -516,12 +408,6 @@ private static class NetworkPageFetcher implements NextPageFetcher { this.serviceOptions = serviceOptions; } - @Override - @Deprecated - public Page nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listNetworks(serviceOptions, requestOptions); @@ -543,12 +429,6 @@ private static class InstancePageFetcher implements NextPageFetcher { this.zone = zone; } - @Override - @Deprecated - public Page nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listInstances(zone, serviceOptions, requestOptions); @@ -568,12 +448,6 @@ private static class AggregatedInstancePageFetcher implements NextPageFetcher nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listInstances(serviceOptions, requestOptions); @@ -1566,6 +1440,7 @@ public com.google.api.services.compute.model.Operation call() { } } + @Override public Operation create(SubnetworkInfo subnetwork, OperationOption... options) { final SubnetworkInfo completeSubnetwork = subnetwork.setProjectId(getOptions().getProjectId()); final Map optionsMap = optionMap(options); diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/Region.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/Region.java index 70c1c5b880c2..f9f8252eb3d6 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/Region.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/Region.java @@ -373,7 +373,7 @@ public DeprecationStatus deprecationStatus() { } /** - * Returns the deprecation status of the region. If {@link DeprecationStatus#status()} is either + * Returns the deprecation status of the region. If {@link DeprecationStatus#getStatus()} is either * {@link DeprecationStatus.Status#DELETED} or {@link DeprecationStatus.Status#OBSOLETE} the * region should not be used. Returns {@code null} if the region is not deprecated. */ diff --git a/google-cloud-compute/src/main/java/com/google/cloud/compute/Zone.java b/google-cloud-compute/src/main/java/com/google/cloud/compute/Zone.java index bd90ca6ee050..011cb5409f5f 100644 --- a/google-cloud-compute/src/main/java/com/google/cloud/compute/Zone.java +++ b/google-cloud-compute/src/main/java/com/google/cloud/compute/Zone.java @@ -231,7 +231,7 @@ public DeprecationStatus deprecationStatus() { } /** - * Returns the deprecation status of the zone. If {@link DeprecationStatus#status()} is either + * Returns the deprecation status of the zone. If {@link DeprecationStatus#getStatus()} is either * {@link DeprecationStatus.Status#DELETED} or {@link DeprecationStatus.Status#OBSOLETE} the zone * should not be used. Returns {@code null} if the zone is not deprecated. */ diff --git a/google-cloud-core/src/main/java/com/google/cloud/AsyncPage.java b/google-cloud-core/src/main/java/com/google/cloud/AsyncPage.java index ab836e6e4b89..13fa7a6cb98e 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/AsyncPage.java +++ b/google-cloud-core/src/main/java/com/google/cloud/AsyncPage.java @@ -44,12 +44,6 @@ */ public interface AsyncPage extends Page { - /** - * Returns a {@link Future} object for the next page. {@link Future#get()} returns {@code null} if - * the last page has been reached. - */ - @Deprecated - Future> nextPageAsync(); /** * Returns a {@link Future} object for the next page. {@link Future#get()} returns {@code null} if diff --git a/google-cloud-core/src/main/java/com/google/cloud/AsyncPageImpl.java b/google-cloud-core/src/main/java/com/google/cloud/AsyncPageImpl.java index c5734408d4bf..bc4858ecb7ce 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/AsyncPageImpl.java +++ b/google-cloud-core/src/main/java/com/google/cloud/AsyncPageImpl.java @@ -41,8 +41,6 @@ public class AsyncPageImpl extends PageImpl implements AsyncPage { * @param the value type that the page holds */ public interface NextPageFetcher extends Serializable { - @Deprecated - Future> nextPage(); Future> getNextPage(); } @@ -57,11 +55,6 @@ private SyncNextPageFetcher(NextPageFetcher asyncPageFetcher) { this.asyncPageFetcher = asyncPageFetcher; } - @Override - public Page nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { try { @@ -81,11 +74,6 @@ public AsyncPageImpl(NextPageFetcher asyncPageFetcher, String cursor, Iterabl this.asyncPageFetcher = asyncPageFetcher; } - @Override - @Deprecated - public Future> nextPageAsync() { - return getNextPageAsync(); - } @Override public Future> getNextPageAsync() { diff --git a/google-cloud-core/src/main/java/com/google/cloud/BaseService.java b/google-cloud-core/src/main/java/com/google/cloud/BaseService.java index f221ade32482..dcfb097a073b 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/BaseService.java +++ b/google-cloud-core/src/main/java/com/google/cloud/BaseService.java @@ -55,11 +55,6 @@ protected BaseService(OptionsT options) { this.options = options; } - @Override - @Deprecated - public OptionsT options() { - return options; - } @Override public OptionsT getOptions() { diff --git a/google-cloud-core/src/main/java/com/google/cloud/BaseServiceException.java b/google-cloud-core/src/main/java/com/google/cloud/BaseServiceException.java index 00e58a5ce604..cb834f8d3608 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/BaseServiceException.java +++ b/google-cloud-core/src/main/java/com/google/cloud/BaseServiceException.java @@ -63,13 +63,6 @@ public Error(Integer code, String reason, boolean rejected) { this.rejected = rejected; } - /** - * Returns the code associated with this exception. - */ - @Deprecated - public Integer code() { - return getCode(); - } /** * Returns the code associated with this exception. @@ -78,15 +71,6 @@ public Integer getCode() { return code; } - /** - * Returns true if the error indicates that the API call was certainly not accepted by the - * server. For instance, if the server returns a rate limit exceeded error, it certainly did not - * process the request and this method will return {@code true}. - */ - @Deprecated - public boolean rejected() { - return isRejected(); - } /** * Returns true if the error indicates that the API call was certainly not accepted by the @@ -97,13 +81,6 @@ public boolean isRejected() { return rejected; } - /** - * Returns the reason that caused the exception. - */ - @Deprecated - public String reason() { - return getReason(); - } /** * Returns the reason that caused the exception. @@ -214,10 +191,6 @@ public BaseServiceException(ApiException apiException, boolean idempotent) { this.debugInfo = null; } - @Deprecated - protected Set retryableErrors() { - return getRetryableErrors(); - } protected Set getRetryableErrors() { return Collections.emptySet(); @@ -234,13 +207,6 @@ protected boolean isRetryable(boolean idempotent, IOException exception) { return idempotent && exceptionIsRetryable; } - /** - * Returns the code associated with this exception. - */ - @Deprecated - public int code() { - return getCode(); - } /** * Returns the code associated with this exception. @@ -249,13 +215,6 @@ public int getCode() { return code; } - /** - * Returns the reason that caused the exception. - */ - @Deprecated - public String reason() { - return getReason(); - } /** * Returns the reason that caused the exception. @@ -264,13 +223,6 @@ public String getReason() { return reason; } - /** - * Returns {@code true} when it is safe to retry the operation that caused this exception. - */ - @Deprecated - public boolean retryable() { - return isRetryable(); - } /** * Returns {@code true} when it is safe to retry the operation that caused this exception. @@ -279,13 +231,6 @@ public boolean isRetryable() { return retryable; } - /** - * Returns {@code true} when the operation that caused this exception had no side effects. - */ - @Deprecated - public boolean idempotent() { - return isIdempotent(); - } /** * Returns {@code true} when the operation that caused this exception had no side effects. @@ -294,14 +239,6 @@ public boolean isIdempotent() { return idempotent; } - /** - * Returns the service location where the error causing the exception occurred. Returns {@code - * null} if not available. - */ - @Deprecated - public String location() { - return getLocation(); - } /** * Returns the service location where the error causing the exception occurred. Returns {@code @@ -311,10 +248,6 @@ public String getLocation() { return location; } - @Deprecated - protected String debugInfo() { - return getDebugInfo(); - } protected String getDebugInfo() { return debugInfo; diff --git a/google-cloud-core/src/main/java/com/google/cloud/BaseWriteChannel.java b/google-cloud-core/src/main/java/com/google/cloud/BaseWriteChannel.java index f7a67deece57..86105d469d39 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/BaseWriteChannel.java +++ b/google-cloud-core/src/main/java/com/google/cloud/BaseWriteChannel.java @@ -47,19 +47,11 @@ public abstract class BaseWriteChannel< private boolean isOpen = true; private int chunkSize = getDefaultChunkSize(); - @Deprecated - protected int minChunkSize() { - return getMinChunkSize(); - } protected int getMinChunkSize() { return MIN_CHUNK_SIZE; } - @Deprecated - protected int defaultChunkSize() { - return getDefaultChunkSize(); - } protected int getDefaultChunkSize() { return DEFAULT_CHUNK_SIZE; @@ -73,74 +65,41 @@ protected int getDefaultChunkSize() { */ protected abstract void flushBuffer(int length, boolean last); - @Deprecated - protected ServiceOptionsT options() { - return options; - } protected ServiceOptionsT getOptions() { return options; } - @Deprecated - protected EntityT entity() { - return getEntity(); - } protected EntityT getEntity() { return entity; } - @Deprecated - protected String uploadId() { - return getUploadId(); - } protected String getUploadId() { return uploadId; } - @Deprecated - protected long position() { - return getPosition(); - } protected long getPosition() { return position; } - @Deprecated - protected byte[] buffer() { - return getBuffer(); - } protected byte[] getBuffer() { return buffer; } - @Deprecated - protected long limit() { - return getLimit(); - } protected int getLimit() { return limit; } - @Deprecated - protected int chunkSize() { - return getChunkSize(); - } protected int getChunkSize() { return chunkSize; } - @Override - @Deprecated - public final void chunkSize(int chunkSize) { - setChunkSize(chunkSize); - } @Override public final void setChunkSize(int chunkSize) { @@ -285,40 +244,24 @@ protected Builder(ServiceOptionsT options, EntityT entity, String uploadId) { this.uploadId = uploadId; } - @Deprecated - public Builder position(int position) { - return setPosition(position); - } public Builder setPosition(long position) { this.position = position; return this; } - @Deprecated - public Builder buffer(byte[] buffer) { - return setBuffer(buffer); - } public Builder setBuffer(byte[] buffer) { this.buffer = buffer; return this; } - @Deprecated - public Builder isOpen(boolean isOpen) { - return setIsOpen(isOpen); - } public Builder setIsOpen(boolean isOpen) { this.isOpen = isOpen; return this; } - @Deprecated - public Builder chunkSize(int chunkSize) { - return setChunkSize(chunkSize); - } public Builder setChunkSize(int chunkSize) { this.chunkSize = chunkSize; diff --git a/google-cloud-core/src/main/java/com/google/cloud/ByteArray.java b/google-cloud-core/src/main/java/com/google/cloud/ByteArray.java index 0c719fb18d98..b92b0bac29d5 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/ByteArray.java +++ b/google-cloud-core/src/main/java/com/google/cloud/ByteArray.java @@ -108,10 +108,6 @@ public final InputStream asInputStream() { return byteString.newInput(); } - @Deprecated - protected ByteString byteString() { - return getByteString(); - } protected ByteString getByteString() { return byteString; diff --git a/google-cloud-core/src/main/java/com/google/cloud/ExceptionHandler.java b/google-cloud-core/src/main/java/com/google/cloud/ExceptionHandler.java index 91534885a1ab..a2a69a737641 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/ExceptionHandler.java +++ b/google-cloud-core/src/main/java/com/google/cloud/ExceptionHandler.java @@ -87,16 +87,6 @@ public static class Builder { private Builder() {} - /** - * Adds the exception handler interceptors. Call order will be maintained. - * - * @param interceptors the interceptors for this exception handler - * @return the Builder for chaining - */ - @Deprecated - public Builder interceptor(Interceptor... interceptors) { - return addInterceptors(interceptors); - } /** * Adds the exception handler interceptors. Call order will be maintained. @@ -243,19 +233,11 @@ void verifyCaller(Callable callable) { } } - @Deprecated - public Set> retriableExceptions() { - return getRetriableExceptions(); - } public Set> getRetriableExceptions() { return retriableExceptions; } - @Deprecated - public Set> nonRetriableExceptions() { - return nonRetriableExceptions; - } public Set> getNonRetriableExceptions() { return nonRetriableExceptions; @@ -301,13 +283,6 @@ public boolean equals(Object obj) { && Objects.equals(retryInfo, other.retryInfo); } - /** - * Returns an instance which retry any checked exception and abort on any runtime exception. - */ - @Deprecated - public static ExceptionHandler defaultInstance() { - return getDefaultInstance(); - } /** * Returns an instance which retry any checked exception and abort on any runtime exception. @@ -316,10 +291,6 @@ public static ExceptionHandler getDefaultInstance() { return DEFAULT_INSTANCE; } - @Deprecated - public static Builder builder() { - return newBuilder(); - } public static Builder newBuilder() { return new Builder(); diff --git a/google-cloud-core/src/main/java/com/google/cloud/FieldSelector.java b/google-cloud-core/src/main/java/com/google/cloud/FieldSelector.java index 37190a3c2e03..125a03e212cf 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/FieldSelector.java +++ b/google-cloud-core/src/main/java/com/google/cloud/FieldSelector.java @@ -31,12 +31,6 @@ */ public interface FieldSelector { - /** - * Returns a string selector. This selector is passed to a Google Cloud service (possibly with - * other field selectors) to specify which resource fields should be returned by an API call. - */ - @Deprecated - String selector(); /** * Returns a string selector. This selector is passed to a Google Cloud service (possibly with diff --git a/google-cloud-core/src/main/java/com/google/cloud/HttpServiceOptions.java b/google-cloud-core/src/main/java/com/google/cloud/HttpServiceOptions.java index 870e50d3586c..1613b68acb74 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/HttpServiceOptions.java +++ b/google-cloud-core/src/main/java/com/google/cloud/HttpServiceOptions.java @@ -103,15 +103,6 @@ protected B self() { return (B) this; } - /** - * Sets the HTTP transport factory. - * - * @return the builder - */ - @Deprecated - public B httpTransportFactory(HttpTransportFactory httpTransportFactory) { - return setHttpTransportFactory(httpTransportFactory); - } /** * Sets the HTTP transport factory. @@ -123,17 +114,6 @@ public B setHttpTransportFactory(HttpTransportFactory httpTransportFactory) { return self(); } - /** - * Sets the timeout in milliseconds to establish a connection. - * - * @param connectTimeout connection timeout in milliseconds. 0 for an infinite timeout, a - * negative number for the default value (20000). - * @return the builder - */ - @Deprecated - public B connectTimeout(int connectTimeout) { - return setConnectTimeout(connectTimeout); - } /** * Sets the timeout in milliseconds to establish a connection. @@ -147,17 +127,6 @@ public B setConnectTimeout(int connectTimeout) { return self(); } - /** - * Sets the timeout in milliseconds to read data from an established connection. - * - * @param readTimeout read timeout in milliseconds. 0 for an infinite timeout, a negative number - * for the default value (20000). - * @return the builder - */ - @Deprecated - public B readTimeout(int readTimeout) { - return setReadTimeout(readTimeout); - } /** * Sets the timeout in milliseconds to read data from an established connection. @@ -184,13 +153,6 @@ protected HttpServiceOptions( readTimeout = builder.readTimeout; } - /** - * Returns the HTTP transport factory. - */ - @Deprecated - public HttpTransportFactory httpTransportFactory() { - return getHttpTransportFactory(); - } /** * Returns the HTTP transport factory. @@ -199,14 +161,6 @@ public HttpTransportFactory getHttpTransportFactory() { return httpTransportFactory; } - /** - * Returns a request initializer responsible for initializing requests according to service - * options. - */ - @Deprecated - public HttpRequestInitializer httpRequestInitializer() { - return getHttpRequestInitializer(); - } /** * Returns a request initializer responsible for initializing requests according to service @@ -249,14 +203,6 @@ public int getConnectTimeout() { return connectTimeout; } - /** - * Returns the timeout in milliseconds to read from an established connection. 0 is an infinite - * timeout, a negative number is the default value (20000). - */ - @Deprecated - public int readTimeout() { - return getReadTimeout(); - } /** * Returns the timeout in milliseconds to read from an established connection. 0 is an infinite diff --git a/google-cloud-core/src/main/java/com/google/cloud/Identity.java b/google-cloud-core/src/main/java/com/google/cloud/Identity.java index c82005a38d44..cbf2c6292d2e 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/Identity.java +++ b/google-cloud-core/src/main/java/com/google/cloud/Identity.java @@ -86,29 +86,11 @@ private Identity(Type type, String value) { this.value = value; } - @Deprecated - public Type type() { - return getType(); - } public Type getType() { return type; } - /** - * Returns the string identifier for this identity. The value corresponds to: - *
    - *
  • email address (for identities of type {@code USER}, {@code SERVICE_ACCOUNT}, and - * {@code GROUP}) - *
  • domain (for identities of type {@code DOMAIN}) - *
  • {@code null} (for identities of type {@code ALL_USERS} and - * {@code ALL_AUTHENTICATED_USERS}) - *
- */ - @Deprecated - public String value() { - return getValue(); - } /** * Returns the string identifier for this identity. The value corresponds to: diff --git a/google-cloud-core/src/main/java/com/google/cloud/MonitoredResource.java b/google-cloud-core/src/main/java/com/google/cloud/MonitoredResource.java index 66cd15ce1eec..052a773560bd 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/MonitoredResource.java +++ b/google-cloud-core/src/main/java/com/google/cloud/MonitoredResource.java @@ -61,19 +61,10 @@ public static class Builder { this.labels = new HashMap<>(monitoredResource.labels); } - /** - * Sets the monitored resource type. This value must match the one of - * {@link MonitoredResourceDescriptor#type()} of a {@code MonitoredResourceDescriptor} object. - * For example, the type {@code cloudsql_database} represent databases in Google Cloud SQL. - */ - @Deprecated - public Builder type(String type) { - return setType(type); - } /** * Sets the monitored resource type. This value must match the one of - * {@link MonitoredResourceDescriptor#type()} of a {@code MonitoredResourceDescriptor} object. + * {@link MonitoredResourceDescriptor#getType()} of a {@code MonitoredResourceDescriptor} object. * For example, the type {@code cloudsql_database} represent databases in Google Cloud SQL. */ public Builder setType(String type) { @@ -81,19 +72,10 @@ public Builder setType(String type) { return this; } - /** - * Sets the values for all the labels required by the corresponding monitored resource - * descriptor (see {@link MonitoredResourceDescriptor#labels()}. For example, Google Compute - * Engine VM instances use the labels {@code instance_id} and {@code zone}. - */ - @Deprecated - public Builder labels(Map labels) { - return setLabels(labels); - } /** * Sets the values for all the labels required by the corresponding monitored resource - * descriptor (see {@link MonitoredResourceDescriptor#labels()}. For example, Google Compute + * descriptor (see {@link MonitoredResourceDescriptor#getLabels()}. For example, Google Compute * Engine VM instances use the labels {@code instance_id} and {@code zone}. */ public Builder setLabels(Map labels) { @@ -127,38 +109,20 @@ public MonitoredResource build() { this.labels = ImmutableMap.copyOf(builder.labels); } - /** - * Returns the monitored resource type. This value must match the one of - * {@link MonitoredResourceDescriptor#type()} of a {@code MonitoredResourceDescriptor} object. - * For example, the type {@code cloudsql_database} represent databases in Google Cloud SQL. - */ - @Deprecated - public String type() { - return getType(); - } /** * Returns the monitored resource type. This value must match the one of - * {@link MonitoredResourceDescriptor#type()} of a {@code MonitoredResourceDescriptor} object. + * {@link MonitoredResourceDescriptor#getType()} of a {@code MonitoredResourceDescriptor} object. * For example, the type {@code cloudsql_database} represent databases in Google Cloud SQL. */ public String getType() { return type; } - /** - * Returns the values for all the labels required by the corresponding monitored resource - * descriptor (see {@link MonitoredResourceDescriptor#labels()}. For example, Google Compute - * Engine VM instances use the labels {@code instance_id} and {@code zone}. - */ - @Deprecated - public Map labels() { - return getLabels(); - } /** * Returns the values for all the labels required by the corresponding monitored resource - * descriptor (see {@link MonitoredResourceDescriptor#labels()}. For example, Google Compute + * descriptor (see {@link MonitoredResourceDescriptor#getLabels()}. For example, Google Compute * Engine VM instances use the labels {@code instance_id} and {@code zone}. */ public Map getLabels() { @@ -204,13 +168,6 @@ public Builder toBuilder() { return new Builder(this); } - /** - * Returns a builder for {@code MonitoredResource} objects given the resource's type. - */ - @Deprecated - public static Builder builder(String type) { - return newBuilder(type); - } /** * Returns a builder for {@code MonitoredResource} objects given the resource's type. diff --git a/google-cloud-core/src/main/java/com/google/cloud/MonitoredResourceDescriptor.java b/google-cloud-core/src/main/java/com/google/cloud/MonitoredResourceDescriptor.java index ebee6544df4a..d4529124c839 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/MonitoredResourceDescriptor.java +++ b/google-cloud-core/src/main/java/com/google/cloud/MonitoredResourceDescriptor.java @@ -117,13 +117,6 @@ static ValueType fromPb(com.google.api.LabelDescriptor.ValueType typePb) { this.description = description; } - /** - * Returns the key associated to this label. - */ - @Deprecated - public String key() { - return getKey(); - } /** * Returns the key associated to this label. @@ -132,13 +125,6 @@ public String getKey() { return key; } - /** - * Returns the type of data that can be assigned to this label. - */ - @Deprecated - public ValueType valueType() { - return getValueType(); - } /** * Returns the type of data that can be assigned to this label. @@ -147,14 +133,6 @@ public ValueType getValueType() { return valueType; } - /** - * Returns the optional human-readable description for this label. If not set, this method - * returns {@code null}. - */ - @Deprecated - public String description() { - return getDescription(); - } /** * Returns the optional human-readable description for this label. If not set, this method @@ -257,14 +235,6 @@ MonitoredResourceDescriptor build() { this.labels = checkNotNull(builder.labels); } - /** - * Returns the monitored resource type. For example, the type {@code cloudsql_database} represents - * databases in Google Cloud SQL. - */ - @Deprecated - public String type() { - return getType(); - } /** * Returns the monitored resource type. For example, the type {@code cloudsql_database} represents @@ -274,14 +244,6 @@ public String getType() { return type; } - /** - * Returns an optional name for the monitored resource descriptor. If not set, this method returns - * {@code null}. - */ - @Deprecated - public String name() { - return getName(); - } /** * Returns an optional name for the monitored resource descriptor. If not set, this method returns @@ -291,15 +253,6 @@ public String getName() { return name; } - /** - * Returns an optional concise name for the monitored resource type. This value might be displayed - * in user interfaces. For example, {@code Google Cloud SQL Database}. If not set, this method - * returns {@code null}. - */ - @Deprecated - public String displayName() { - return getDisplayName(); - } /** * Returns an optional concise name for the monitored resource type. This value might be displayed @@ -310,14 +263,6 @@ public String getDisplayName() { return displayName; } - /** - * Returns an optional detailed description of the monitored resource type. This value might be - * used in documentation. If not set, this method returns {@code null}. - */ - @Deprecated - public String description() { - return getDescription(); - } /** * Returns an optional detailed description of the monitored resource type. This value might be @@ -327,15 +272,6 @@ public String getDescription() { return description; } - /** - * Returns a list of labels used to describe instances of this monitored resource type. For - * example, an individual Google Cloud SQL database is identified by values for the labels - * {@code database_id} and {@code region}. - */ - @Deprecated - public List labels() { - return getLabels(); - } /** * Returns a list of labels used to describe instances of this monitored resource type. For diff --git a/google-cloud-core/src/main/java/com/google/cloud/Page.java b/google-cloud-core/src/main/java/com/google/cloud/Page.java index dde285e3aaa1..03cbe566d470 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/Page.java +++ b/google-cloud-core/src/main/java/com/google/cloud/Page.java @@ -44,11 +44,6 @@ */ public interface Page { - /** - * Returns the values contained in this page. - */ - @Deprecated - Iterable values(); /** * Returns the values contained in this page. @@ -61,22 +56,12 @@ public interface Page { */ Iterator iterateAll(); - /** - * Returns the cursor for the nextPage or {@code null} if no more results. - */ - @Deprecated - String nextPageCursor(); /** * Returns the cursor for the nextPage or {@code null} if no more results. */ String getNextPageCursor(); - /** - * Returns the next page of results or {@code null} if no more result. - */ - @Deprecated - Page nextPage(); /** * Returns the next page of results or {@code null} if no more result. diff --git a/google-cloud-core/src/main/java/com/google/cloud/PageImpl.java b/google-cloud-core/src/main/java/com/google/cloud/PageImpl.java index 99c675dea375..37b7fd9dee08 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/PageImpl.java +++ b/google-cloud-core/src/main/java/com/google/cloud/PageImpl.java @@ -44,8 +44,6 @@ public class PageImpl implements Page, Serializable { * @param the value type that the page holds */ public interface NextPageFetcher extends Serializable { - @Deprecated - Page nextPage(); Page getNextPage(); } @@ -83,11 +81,6 @@ public PageImpl(NextPageFetcher pageFetcher, String cursor, Iterable resul this.results = results; } - @Override - @Deprecated - public Iterable values() { - return getValues(); - } @Override public Iterable getValues() { @@ -99,22 +92,12 @@ public Iterator iterateAll() { return new PageIterator<>(this); } - @Override - @Deprecated - public String nextPageCursor() { - return getNextPageCursor(); - } @Override public String getNextPageCursor() { return cursor; } - @Override - @Deprecated - public Page nextPage() { - return getNextPage(); - } @Override public Page getNextPage() { diff --git a/google-cloud-core/src/main/java/com/google/cloud/Policy.java b/google-cloud-core/src/main/java/com/google/cloud/Policy.java index 4307f1dffdfc..c8fc044086ea 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/Policy.java +++ b/google-cloud-core/src/main/java/com/google/cloud/Policy.java @@ -132,16 +132,6 @@ protected Builder(Policy policy) { setVersion(policy.version); } - /** - * Replaces the builder's map of bindings with the given map of bindings. - * - * @throws NullPointerException if the given map is null or contains any null keys or values - * @throws IllegalArgumentException if any identities in the given map are null - */ - @Deprecated - public final Builder bindings(Map> bindings) { - return setBindings(bindings); - } /** * Replaces the builder's map of bindings with the given map of bindings. @@ -212,21 +202,6 @@ public final Builder removeIdentity(Role role, Identity first, Identity... other return this; } - /** - * Sets the policy's etag. - * - *

Etags are used for optimistic concurrency control as a way to help prevent simultaneous - * updates of a policy from overwriting each other. It is strongly suggested that systems make - * use of the etag in the read-modify-write cycle to perform policy updates in order to avoid - * race conditions. An etag is returned in the response to getIamPolicy, and systems are - * expected to put that etag in the request to setIamPolicy to ensure that their change will be - * applied to the same version of the policy. If no etag is provided in the call to - * setIamPolicy, then the existing policy is overwritten blindly. - */ - @Deprecated - protected final Builder etag(String etag) { - return setEtag(etag); - } /** * Sets the policy's etag. @@ -244,14 +219,6 @@ protected final Builder setEtag(String etag) { return this; } - /** - * Sets the version of the policy. The default version is 0, meaning only the "owner", "editor", - * and "viewer" roles are permitted. If the version is 1, you may also use other roles. - */ - @Deprecated - protected final Builder version(int version) { - return setVersion(version); - } /** * Sets the version of the policy. The default version is 0, meaning only the "owner", "editor", @@ -287,13 +254,6 @@ public Builder toBuilder() { return new Builder(this); } - /** - * Returns the map of bindings that comprises the policy. - */ - @Deprecated - public Map> bindings() { - return getBindings(); - } /** * Returns the map of bindings that comprises the policy. @@ -302,21 +262,6 @@ public Map> getBindings() { return bindings; } - /** - * Returns the policy's etag. - * - *

Etags are used for optimistic concurrency control as a way to help prevent simultaneous - * updates of a policy from overwriting each other. It is strongly suggested that systems make - * use of the etag in the read-modify-write cycle to perform policy updates in order to avoid - * race conditions. An etag is returned in the response to getIamPolicy, and systems are - * expected to put that etag in the request to setIamPolicy to ensure that their change will be - * applied to the same version of the policy. If no etag is provided in the call to - * setIamPolicy, then the existing policy is overwritten blindly. - */ - @Deprecated - public String etag() { - return getEtag(); - } /** * Returns the policy's etag. @@ -333,14 +278,6 @@ public String getEtag() { return etag; } - /** - * Returns the version of the policy. The default version is 0, meaning only the "owner", - * "editor", and "viewer" roles are permitted. If the version is 1, you may also use other roles. - */ - @Deprecated - public int version() { - return getVersion(); - } /** * Returns the version of the policy. The default version is 0, meaning only the "owner", @@ -378,13 +315,6 @@ public boolean equals(Object obj) { && Objects.equals(version, other.getVersion()); } - /** - * Returns a builder for {@code Policy} objects. - */ - @Deprecated - public static Builder builder() { - return newBuilder(); - } /** * Returns a builder for {@code Policy} objects. diff --git a/google-cloud-core/src/main/java/com/google/cloud/ReadChannel.java b/google-cloud-core/src/main/java/com/google/cloud/ReadChannel.java index a09752692884..aa04baaab1ba 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/ReadChannel.java +++ b/google-cloud-core/src/main/java/com/google/cloud/ReadChannel.java @@ -40,12 +40,6 @@ public interface ReadChannel extends ReadableByteChannel, Closeable, Restorable< void seek(long position) throws IOException; - /** - * Sets the minimum size that will be read by a single RPC. - * Read data will be locally buffered until consumed. - */ - @Deprecated - void chunkSize(int chunkSize); /** * Sets the minimum size that will be read by a single RPC. diff --git a/google-cloud-core/src/main/java/com/google/cloud/RetryParams.java b/google-cloud-core/src/main/java/com/google/cloud/RetryParams.java index e835ad5d3cd7..f737032cfe7a 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/RetryParams.java +++ b/google-cloud-core/src/main/java/com/google/cloud/RetryParams.java @@ -107,16 +107,6 @@ private Builder() { } } - /** - * Sets retryMinAttempts. - * - * @param retryMinAttempts the retryMinAttempts to set - * @return the Builder for chaining - */ - @Deprecated - public Builder retryMinAttempts(int retryMinAttempts) { - return setRetryMinAttempts(retryMinAttempts); - } /** * Sets retryMinAttempts. @@ -129,16 +119,6 @@ public Builder setRetryMinAttempts(int retryMinAttempts) { return this; } - /** - * Sets retryMaxAttempts. - * - * @param retryMaxAttempts the retryMaxAttempts to set - * @return the Builder for chaining - */ - @Deprecated - public Builder retryMaxAttempts(int retryMaxAttempts) { - return setRetryMaxAttempts(retryMaxAttempts); - } /** * Sets retryMaxAttempts. @@ -151,16 +131,6 @@ public Builder setRetryMaxAttempts(int retryMaxAttempts) { return this; } - /** - * Sets initialRetryDelayMillis. - * - * @param initialRetryDelayMillis the initialRetryDelayMillis to set - * @return the Builder for chaining - */ - @Deprecated - public Builder initialRetryDelayMillis(long initialRetryDelayMillis) { - return setInitialRetryDelayMillis(initialRetryDelayMillis); - } /** * Sets initialRetryDelayMillis. @@ -173,16 +143,6 @@ public Builder setInitialRetryDelayMillis(long initialRetryDelayMillis) { return this; } - /** - * Sets maxRetryDelayMillis. - * - * @param maxRetryDelayMillis the maxRetryDelayMillis to set - * @return the Builder for chaining - */ - @Deprecated - public Builder maxRetryDelayMillis(long maxRetryDelayMillis) { - return setMaxRetryDelayMillis(maxRetryDelayMillis); - } /** * Sets maxRetryDelayMillis. @@ -195,16 +155,6 @@ public Builder setMaxRetryDelayMillis(long maxRetryDelayMillis) { return this; } - /** - * Sets retryDelayBackoffFactor. - * - * @param retryDelayBackoffFactor the retryDelayBackoffFactor to set - * @return the Builder for chaining - */ - @Deprecated - public Builder retryDelayBackoffFactor(double retryDelayBackoffFactor) { - return setRetryDelayBackoffFactor(retryDelayBackoffFactor); - } /** * Sets retryDelayBackoffFactor. @@ -217,18 +167,6 @@ public Builder setRetryDelayBackoffFactor(double retryDelayBackoffFactor) { return this; } - /** - * Sets totalRetryPeriodMillis. Note that App Engine Standard Environment front-end modules have - * a 60 second deadline for HTTP requests. For that reason, you should set the total retry - * period to under 60 seconds if you are using it on an App Engine front-end module. - * - * @param totalRetryPeriodMillis the totalRetryPeriodMillis to set - * @return the Builder for chaining - */ - @Deprecated - public Builder totalRetryPeriodMillis(long totalRetryPeriodMillis) { - return setTotalRetryPeriodMillis(totalRetryPeriodMillis); - } /** * Sets totalRetryPeriodMillis. Note that App Engine Standard Environment front-end modules have @@ -275,13 +213,6 @@ private RetryParams(Builder builder) { checkArgument(totalRetryPeriodMillis >= 0, "totalRetryPeriodMillis must not be negative"); } - /** - * Returns an instance with the default parameters. - */ - @Deprecated - public static RetryParams defaultInstance() { - return getDefaultInstance(); - } /** * Returns an instance with the default parameters. @@ -298,13 +229,6 @@ public static RetryParams noRetries() { return NO_RETRIES; } - /** - * Returns the retryMinAttempts. Default value is {@value #DEFAULT_RETRY_MIN_ATTEMPTS}. - */ - @Deprecated - public int retryMinAttempts() { - return getRetryMinAttempts(); - } /** * Returns the retryMinAttempts. Default value is {@value #DEFAULT_RETRY_MIN_ATTEMPTS}. @@ -313,13 +237,6 @@ public int getRetryMinAttempts() { return retryMinAttempts; } - /** - * Returns the retryMaxAttempts. Default value is {@value #DEFAULT_RETRY_MAX_ATTEMPTS}. - */ - @Deprecated - public int retryMaxAttempts() { - return getRetryMaxAttempts(); - } /** * Returns the retryMaxAttempts. Default value is {@value #DEFAULT_RETRY_MAX_ATTEMPTS}. @@ -328,14 +245,6 @@ public int getRetryMaxAttempts() { return retryMaxAttempts; } - /** - * Returns the initialRetryDelayMillis. Default value is - * {@value #DEFAULT_INITIAL_RETRY_DELAY_MILLIS}. - */ - @Deprecated - public long initialRetryDelayMillis() { - return getInitialRetryDelayMillis(); - } /** * Returns the initialRetryDelayMillis. Default value is @@ -345,13 +254,6 @@ public long getInitialRetryDelayMillis() { return initialRetryDelayMillis; } - /** - * Returns the maxRetryDelayMillis. Default values is {@value #DEFAULT_MAX_RETRY_DELAY_MILLIS}. - */ - @Deprecated - public long maxRetryDelayMillis() { - return getMaxRetryDelayMillis(); - } /** * Returns the maxRetryDelayMillis. Default values is {@value #DEFAULT_MAX_RETRY_DELAY_MILLIS}. @@ -360,14 +262,6 @@ public long getMaxRetryDelayMillis() { return maxRetryDelayMillis; } - /** - * Returns the maxRetryDelayBackoffFactor. Default values is - * {@value #DEFAULT_RETRY_DELAY_BACKOFF_FACTOR}. - */ - @Deprecated - public double retryDelayBackoffFactor() { - return getRetryDelayBackoffFactor(); - } /** * Returns the maxRetryDelayBackoffFactor. Default values is @@ -377,14 +271,6 @@ public double getRetryDelayBackoffFactor() { return retryDelayBackoffFactor; } - /** - * Returns the totalRetryPeriodMillis. Default value is - * {@value #DEFAULT_TOTAL_RETRY_PERIOD_MILLIS}. - */ - @Deprecated - public long totalRetryPeriodMillis() { - return getTotalRetryPeriodMillis(); - } /** * Returns the totalRetryPeriodMillis. Default value is @@ -428,10 +314,6 @@ public String toString() { return toStringHelper.toString(); } - @Deprecated - public static Builder builder() { - return newBuilder(); - } public static Builder newBuilder() { return new Builder(); diff --git a/google-cloud-core/src/main/java/com/google/cloud/Role.java b/google-cloud-core/src/main/java/com/google/cloud/Role.java index 9444421e6b69..e7742b2b9384 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/Role.java +++ b/google-cloud-core/src/main/java/com/google/cloud/Role.java @@ -40,14 +40,6 @@ private Role(String value) { this.value = value; } - /** - * Returns the string identifier for this role. For example, {@code "roles/viewer"}, - * {@code "roles/editor"}, or {@code "roles/owner"}. - */ - @Deprecated - public String value() { - return getValue(); - } /** * Returns the string identifier for this role. For example, {@code "roles/viewer"}, diff --git a/google-cloud-core/src/main/java/com/google/cloud/Service.java b/google-cloud-core/src/main/java/com/google/cloud/Service.java index 4c64e6fab2fd..3c3c87bd76fa 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/Service.java +++ b/google-cloud-core/src/main/java/com/google/cloud/Service.java @@ -22,8 +22,6 @@ * @param the {@code ServiceOptions} subclass corresponding to the service */ public interface Service> { - @Deprecated - OptionsT options(); OptionsT getOptions(); } diff --git a/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java b/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java index 9122aa525bcf..d5b155486b58 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java +++ b/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java @@ -135,13 +135,6 @@ protected B self() { return (B) this; } - /** - * Sets the service factory. - */ - @Deprecated - public B serviceFactory(ServiceFactory serviceFactory) { - return setServiceFactory(serviceFactory); - } /** * Sets the service factory. @@ -151,17 +144,6 @@ public B setServiceFactory(ServiceFactory serviceFactory) { return self(); } - /** - * Sets the service's clock. The clock is mainly used for testing purpose. {@link Clock} will be - * replaced by Java8's {@code java.time.Clock}. - * - * @param clock the clock to set - * @return the builder - */ - @Deprecated - public B clock(Clock clock) { - return setClock(clock); - } /** * Sets the service's clock. The clock is mainly used for testing purpose. {@link Clock} will be @@ -175,16 +157,6 @@ public B setClock(Clock clock) { return self(); } - /** - * Sets the project ID. If no project ID is set, {@link #getDefaultProjectId()} will be used to - * attempt getting the project ID from the environment. - * - * @return the builder - */ - @Deprecated - public B projectId(String projectId) { - return setProjectId(projectId); - } /** * Sets the project ID. If no project ID is set, {@link #getDefaultProjectId()} will be used to @@ -197,15 +169,6 @@ public B setProjectId(String projectId) { return self(); } - /** - * Sets service host. - * - * @return the builder - */ - @Deprecated - public B host(String host) { - return setHost(host); - } /** * Sets service host. @@ -233,17 +196,6 @@ public B setCredentials(Credentials credentials) { return self(); } - /** - * Sets configuration parameters for request retries. If no configuration is set - * {@link RetryParams#getDefaultInstance()} is used. To disable retries, supply - * {@link RetryParams#noRetries()} here. - * - * @return the builder - */ - @Deprecated - public B retryParams(RetryParams retryParams) { - return setRetryParams(retryParams); - } /** * Sets configuration parameters for request retries. If no configuration is set @@ -257,15 +209,6 @@ public B setRetryParams(RetryParams retryParams) { return self(); } - /** - * Sets the factory for rpc services. - * - * @return the builder - */ - @Deprecated - public B serviceRpcFactory(ServiceRpcFactory serviceRpcFactory) { - return setServiceRpcFactory(serviceRpcFactory); - } /** * Sets the factory for rpc services. @@ -318,19 +261,11 @@ private static GoogleCredentials defaultCredentials() { } } - @Deprecated - protected String defaultHost() { - return getDefaultHost(); - } protected String getDefaultHost() { return DEFAULT_HOST; } - @Deprecated - protected String defaultProject() { - return getDefaultProject(); - } protected String getDefaultProject() { return getDefaultProjectId(); @@ -479,10 +414,6 @@ protected static String getServiceAccountProjectId() { return project; } - @Deprecated - public ServiceT service() { - return getService(); - } @SuppressWarnings("unchecked") public ServiceT getService() { @@ -492,10 +423,6 @@ public ServiceT getService() { return service; } - @Deprecated - public ServiceRpcT rpc() { - return getRpc(); - } @SuppressWarnings("unchecked") public ServiceRpcT getRpc() { @@ -505,14 +432,6 @@ public ServiceRpcT getRpc() { return rpc; } - /** - * Returns the project ID. Return value can be null (for services that don't require a project - * ID). - */ - @Deprecated - public String projectId() { - return getProjectId(); - } /** * Returns the project ID. Return value can be null (for services that don't require a project @@ -522,13 +441,6 @@ public String getProjectId() { return projectId; } - /** - * Returns the service host. - */ - @Deprecated - public String host() { - return getHost(); - } /** * Returns the service host. @@ -556,14 +468,6 @@ public Credentials getScopedCredentials() { return credentialsToReturn; } - /** - * Returns configuration parameters for request retries. By default requests are retried: - * {@link RetryParams#getDefaultInstance()} is used. - */ - @Deprecated - public RetryParams retryParams() { - return getRetryParams(); - } /** * Returns configuration parameters for request retries. By default requests are retried: @@ -573,14 +477,6 @@ public RetryParams getRetryParams() { return retryParams; } - /** - * Returns the service's clock. Default time source uses {@link System#currentTimeMillis()} to get - * current time. - */ - @Deprecated - public Clock clock() { - return getClock(); - } /** * Returns the service's clock. Default time source uses {@link System#currentTimeMillis()} to get @@ -590,13 +486,6 @@ public Clock getClock() { return clock; } - /** - * Returns the application's name as a string in the format {@code gcloud-java/[version]}. - */ - @Deprecated - public String applicationName() { - return getApplicationName(); - } /** * Returns the application's name as a string in the format {@code gcloud-java/[version]}. @@ -605,13 +494,6 @@ public String getApplicationName() { return APPLICATION_NAME; } - /** - * Returns the library's name, {@code gcloud-java}, as a string. - */ - @Deprecated - public String libraryName() { - return getLibraryName(); - } /** * Returns the library's name, {@code gcloud-java}, as a string. @@ -671,24 +553,12 @@ static T newInstance(String className) throws IOException, ClassNotFoundExce } } - @Deprecated - protected ServiceFactory defaultServiceFactory() { - return getDefaultServiceFactory(); - } protected abstract ServiceFactory getDefaultServiceFactory(); - @Deprecated - protected ServiceRpcFactory defaultRpcFactory() { - return getDefaultRpcFactory(); - } protected abstract ServiceRpcFactory getDefaultRpcFactory(); - @Deprecated - protected Set scopes() { - return getScopes(); - } protected abstract Set getScopes(); diff --git a/google-cloud-core/src/main/java/com/google/cloud/WaitForOption.java b/google-cloud-core/src/main/java/com/google/cloud/WaitForOption.java index 1938f819943f..a84b25bc369b 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/WaitForOption.java +++ b/google-cloud-core/src/main/java/com/google/cloud/WaitForOption.java @@ -60,13 +60,6 @@ private CheckingPeriod(long period, TimeUnit unit) { this.unit = unit; } - /** - * Returns the checking period. - */ - @Deprecated - public long period() { - return getPeriod(); - } /** * Returns the checking period. @@ -75,13 +68,6 @@ public long getPeriod() { return period; } - /** - * Returns the time unit for {@link #getPeriod()}. - */ - @Deprecated - public TimeUnit unit() { - return getUnit(); - } /** * Returns the time unit for {@link #getPeriod()}. @@ -152,13 +138,6 @@ private Timeout(long timeoutMillis) { this.timeoutMillis = timeoutMillis; } - /** - * Returns the timeout in milliseconds. - */ - @Deprecated - public long timeoutMillis() { - return getTimeoutMillis(); - } /** * Returns the timeout in milliseconds. diff --git a/google-cloud-core/src/main/java/com/google/cloud/WriteChannel.java b/google-cloud-core/src/main/java/com/google/cloud/WriteChannel.java index f061f55ac581..172e4b03bfdb 100644 --- a/google-cloud-core/src/main/java/com/google/cloud/WriteChannel.java +++ b/google-cloud-core/src/main/java/com/google/cloud/WriteChannel.java @@ -29,12 +29,6 @@ */ public interface WriteChannel extends WritableByteChannel, Closeable, Restorable { - /** - * Sets the minimum size that will be written by a single RPC. - * Written data will be buffered and only flushed upon reaching this size or closing the channel. - */ - @Deprecated - void chunkSize(int chunkSize); /** * Sets the minimum size that will be written by a single RPC. diff --git a/google-cloud-core/src/test/java/com/google/cloud/AsyncPageImplTest.java b/google-cloud-core/src/test/java/com/google/cloud/AsyncPageImplTest.java index 0767d205ecc1..1f6298857ab0 100644 --- a/google-cloud-core/src/test/java/com/google/cloud/AsyncPageImplTest.java +++ b/google-cloud-core/src/test/java/com/google/cloud/AsyncPageImplTest.java @@ -50,11 +50,6 @@ private static class TestPageFetcher implements AsyncPageImpl.NextPageFetcher> nextPage() { - return getNextPage(); - } - @Override public Future> getNextPage() { return Futures.>immediateFuture(nextResult); @@ -71,15 +66,6 @@ public void testPage() { assertEquals(VALUES1, result.getValues()); } - @Test - public void testPageDeprecated() { - final AsyncPageImpl nextResult = new AsyncPageImpl<>(null, "c", VALUES2); - AsyncPageImpl.NextPageFetcher fetcher = new TestPageFetcher(nextResult); - AsyncPageImpl result = new AsyncPageImpl<>(fetcher, "c", VALUES1); - assertEquals(nextResult, result.nextPage()); - assertEquals("c", result.nextPageCursor()); - assertEquals(VALUES1, result.values()); - } @Test public void testPageAsync() throws ExecutionException, InterruptedException { @@ -91,15 +77,6 @@ public void testPageAsync() throws ExecutionException, InterruptedException { assertEquals(VALUES1, result.getValues()); } - @Test - public void testPageAsyncDeprecated() throws ExecutionException, InterruptedException { - final AsyncPageImpl nextResult = new AsyncPageImpl<>(null, "c", VALUES2); - AsyncPageImpl.NextPageFetcher fetcher = new TestPageFetcher(nextResult); - AsyncPageImpl result = new AsyncPageImpl<>(fetcher, "c", VALUES1); - assertEquals(nextResult, result.nextPageAsync().get()); - assertEquals("c", result.nextPageCursor()); - assertEquals(VALUES1, result.values()); - } @Test public void testIterateAll() { diff --git a/google-cloud-core/src/test/java/com/google/cloud/BaseServiceExceptionTest.java b/google-cloud-core/src/test/java/com/google/cloud/BaseServiceExceptionTest.java index 8980643b32c9..9ac4b4b9894d 100644 --- a/google-cloud-core/src/test/java/com/google/cloud/BaseServiceExceptionTest.java +++ b/google-cloud-core/src/test/java/com/google/cloud/BaseServiceExceptionTest.java @@ -150,94 +150,6 @@ public void testBaseServiceException() { assertEquals(IDEMPOTENT, serviceException.isIdempotent()); } - @Test - public void testBaseServiceExceptionDeprecated() { - BaseServiceException serviceException = new BaseServiceException(CODE, MESSAGE, REASON, - IDEMPOTENT); - assertEquals(CODE, serviceException.code()); - assertEquals(MESSAGE, serviceException.getMessage()); - assertEquals(REASON, serviceException.reason()); - assertFalse(serviceException.retryable()); - assertEquals(IDEMPOTENT, serviceException.idempotent()); - assertNull(serviceException.getCause()); - - serviceException = new BaseServiceException(CODE, MESSAGE, REASON, IDEMPOTENT); - assertEquals(CODE, serviceException.code()); - assertEquals(MESSAGE, serviceException.getMessage()); - assertEquals(REASON, serviceException.reason()); - assertFalse(serviceException.retryable()); - assertEquals(IDEMPOTENT, serviceException.idempotent()); - assertNull(serviceException.getCause()); - - Exception cause = new RuntimeException(); - serviceException = new BaseServiceException(CODE, MESSAGE, REASON, IDEMPOTENT, cause); - assertEquals(CODE, serviceException.code()); - assertEquals(MESSAGE, serviceException.getMessage()); - assertEquals(REASON, serviceException.reason()); - assertFalse(serviceException.retryable()); - assertEquals(IDEMPOTENT, serviceException.idempotent()); - assertEquals(cause, serviceException.getCause()); - - serviceException = new BaseServiceException(CODE, MESSAGE, REASON, false, cause); - assertEquals(CODE, serviceException.code()); - assertEquals(MESSAGE, serviceException.getMessage()); - assertEquals(REASON, serviceException.reason()); - assertFalse(serviceException.retryable()); - assertFalse(serviceException.idempotent()); - assertEquals(cause, serviceException.getCause()); - - IOException exception = new SocketTimeoutException(); - serviceException = new BaseServiceException(exception, true); - assertTrue(serviceException.retryable()); - assertTrue(serviceException.idempotent()); - assertNull(serviceException.getMessage()); - assertEquals(exception, serviceException.getCause()); - - exception = new SocketException(); - serviceException = new BaseServiceException(exception, true); - assertTrue(serviceException.retryable()); - assertTrue(serviceException.idempotent()); - assertNull(serviceException.getMessage()); - assertEquals(exception, serviceException.getCause()); - - exception = new IOException("insufficient data written"); - serviceException = new BaseServiceException(exception, true); - assertTrue(serviceException.retryable()); - assertTrue(serviceException.idempotent()); - assertEquals("insufficient data written", serviceException.getMessage()); - assertEquals(exception, serviceException.getCause()); - - GoogleJsonError error = new GoogleJsonError(); - error.setCode(CODE); - error.setMessage(MESSAGE); - serviceException = new BaseServiceException(error, true); - assertEquals(CODE, serviceException.code()); - assertEquals(MESSAGE, serviceException.getMessage()); - assertFalse(serviceException.retryable()); - assertTrue(serviceException.idempotent()); - - serviceException = new CustomServiceException(CODE, MESSAGE, REASON, IDEMPOTENT); - assertEquals(CODE, serviceException.code()); - assertEquals(MESSAGE, serviceException.getMessage()); - assertEquals(REASON, serviceException.reason()); - assertEquals(RETRYABLE, serviceException.retryable()); - assertEquals(IDEMPOTENT, serviceException.idempotent()); - - serviceException = new CustomServiceException(CODE_NO_REASON, MESSAGE, null, IDEMPOTENT); - assertEquals(CODE_NO_REASON, serviceException.code()); - assertEquals(MESSAGE, serviceException.getMessage()); - assertNull(serviceException.reason()); - assertEquals(RETRYABLE, serviceException.retryable()); - assertEquals(IDEMPOTENT, serviceException.idempotent()); - - serviceException = new CustomServiceException(UNKNOWN_CODE, MESSAGE, REASON, IDEMPOTENT); - assertEquals(UNKNOWN_CODE, serviceException.code()); - assertEquals(MESSAGE, serviceException.getMessage()); - assertEquals(REASON, serviceException.reason()); - assertEquals(RETRYABLE, serviceException.retryable()); - assertEquals(IDEMPOTENT, serviceException.idempotent()); - } - @Test public void testTranslateAndThrow() throws Exception { BaseServiceException cause = new BaseServiceException(CODE, MESSAGE, REASON, IDEMPOTENT); diff --git a/google-cloud-core/src/test/java/com/google/cloud/BaseWriteChannelTest.java b/google-cloud-core/src/test/java/com/google/cloud/BaseWriteChannelTest.java index 9fb58a1633d9..a5c278a83254 100644 --- a/google-cloud-core/src/test/java/com/google/cloud/BaseWriteChannelTest.java +++ b/google-cloud-core/src/test/java/com/google/cloud/BaseWriteChannelTest.java @@ -93,17 +93,6 @@ public void testConstructor() { assertEquals(DEFAULT_CHUNK_SIZE, channel.getChunkSize()); } - @Test - public void testConstructorDeprecated() { - assertEquals(null, channel.options()); - assertEquals(ENTITY, channel.entity()); - assertEquals(0, channel.position()); - assertEquals(UPLOAD_ID, channel.uploadId()); - assertEquals(0, channel.limit()); - assertTrue(channel.isOpen()); - assertArrayEquals(new byte[0], channel.buffer()); - assertEquals(DEFAULT_CHUNK_SIZE, channel.chunkSize()); - } @Test public void testClose() throws IOException { diff --git a/google-cloud-core/src/test/java/com/google/cloud/FieldSelectorHelperTest.java b/google-cloud-core/src/test/java/com/google/cloud/FieldSelectorHelperTest.java index 408dc731324a..d95200a1c7b6 100644 --- a/google-cloud-core/src/test/java/com/google/cloud/FieldSelectorHelperTest.java +++ b/google-cloud-core/src/test/java/com/google/cloud/FieldSelectorHelperTest.java @@ -29,33 +29,18 @@ public class FieldSelectorHelperTest { private static final FieldSelector FIELD1 = new FieldSelector() { - @Override - public String selector() { - return getSelector(); - } - @Override public String getSelector() { return "field1"; } }; private static final FieldSelector FIELD2 = new FieldSelector() { - @Override - public String selector() { - return getSelector(); - } - @Override public String getSelector() { return "field2"; } }; private static final FieldSelector FIELD3 = new FieldSelector() { - @Override - public String selector() { - return getSelector(); - } - @Override public String getSelector() { return "field3"; diff --git a/google-cloud-core/src/test/java/com/google/cloud/GrpcServiceOptionsTest.java b/google-cloud-core/src/test/java/com/google/cloud/GrpcServiceOptionsTest.java index f0906fae03b2..a5c7cebfc4aa 100644 --- a/google-cloud-core/src/test/java/com/google/cloud/GrpcServiceOptionsTest.java +++ b/google-cloud-core/src/test/java/com/google/cloud/GrpcServiceOptionsTest.java @@ -43,18 +43,8 @@ public class GrpcServiceOptionsTest { .setMaxTimeout(5678) .setExecutorFactory(MOCK_EXECUTOR_FACTORY) .build(); - private static final TestGrpcServiceOptions DEPRECATED_OPTIONS = - TestGrpcServiceOptions.newBuilder() - .projectId("project-id") - .initialTimeout(1234) - .timeoutMultiplier(1.6) - .maxTimeout(5678) - .executorFactory(MOCK_EXECUTOR_FACTORY) - .build(); private static final TestGrpcServiceOptions DEFAULT_OPTIONS = TestGrpcServiceOptions.newBuilder().setProjectId("project-id").build(); - private static final TestGrpcServiceOptions DEPRECATED_DEFAULT_OPTIONS = - TestGrpcServiceOptions.newBuilder().projectId("project-id").build(); private static final TestGrpcServiceOptions OPTIONS_COPY = OPTIONS.toBuilder().build(); private interface TestService extends Service {} @@ -164,18 +154,6 @@ public void testBuilder() { assertTrue(DEFAULT_OPTIONS.getExecutorFactory() instanceof DefaultExecutorFactory); } - @Test - public void testBuilderDeprecated() { - assertEquals(1234, DEPRECATED_OPTIONS.initialTimeout()); - assertEquals(1.6, DEPRECATED_OPTIONS.timeoutMultiplier(), 0.0); - assertEquals(5678, DEPRECATED_OPTIONS.maxTimeout()); - assertSame(MOCK_EXECUTOR_FACTORY, DEPRECATED_OPTIONS.executorFactory()); - assertEquals(20000, DEPRECATED_DEFAULT_OPTIONS.initialTimeout()); - assertEquals(1.5, DEPRECATED_DEFAULT_OPTIONS.timeoutMultiplier(), 0.0); - assertEquals(100000, DEPRECATED_DEFAULT_OPTIONS.maxTimeout()); - assertTrue(DEPRECATED_DEFAULT_OPTIONS.executorFactory() instanceof DefaultExecutorFactory); - } - @Test public void testBuilderError() { try { diff --git a/google-cloud-core/src/test/java/com/google/cloud/HttpServiceOptionsTest.java b/google-cloud-core/src/test/java/com/google/cloud/HttpServiceOptionsTest.java index 9ac2891c6cbf..81e330236c8b 100644 --- a/google-cloud-core/src/test/java/com/google/cloud/HttpServiceOptionsTest.java +++ b/google-cloud-core/src/test/java/com/google/cloud/HttpServiceOptionsTest.java @@ -40,17 +40,8 @@ public class HttpServiceOptionsTest { .setHttpTransportFactory(MOCK_HTTP_TRANSPORT_FACTORY) .setReadTimeout(5678) .build(); - private static final TestHttpServiceOptions DEPRECATED_OPTIONS = - TestHttpServiceOptions.newBuilder() - .projectId("project-id") - .connectTimeout(1234) - .httpTransportFactory(MOCK_HTTP_TRANSPORT_FACTORY) - .readTimeout(5678) - .build(); private static final TestHttpServiceOptions DEFAULT_OPTIONS = TestHttpServiceOptions.newBuilder().setProjectId("project-id").build(); - private static final TestHttpServiceOptions DEPRECATED_DEFAULT_OPTIONS = - TestHttpServiceOptions.newBuilder().projectId("project-id").build(); private static final TestHttpServiceOptions OPTIONS_COPY = OPTIONS.toBuilder().build(); private interface TestService extends Service {} @@ -158,17 +149,6 @@ public void testBuilder() { assertEquals(-1, DEFAULT_OPTIONS.getReadTimeout()); } - @Test - public void testBuilderDeprecated() { - assertEquals(1234, DEPRECATED_OPTIONS.connectTimeout()); - assertSame(MOCK_HTTP_TRANSPORT_FACTORY, DEPRECATED_OPTIONS.httpTransportFactory()); - assertEquals(5678, DEPRECATED_OPTIONS.readTimeout()); - assertEquals(-1, DEPRECATED_DEFAULT_OPTIONS.connectTimeout()); - assertTrue( - DEPRECATED_DEFAULT_OPTIONS.httpTransportFactory() instanceof DefaultHttpTransportFactory); - assertEquals(-1, DEPRECATED_DEFAULT_OPTIONS.readTimeout()); - } - @Test public void testBaseEquals() { assertEquals(OPTIONS, OPTIONS_COPY); diff --git a/google-cloud-core/src/test/java/com/google/cloud/IdentityTest.java b/google-cloud-core/src/test/java/com/google/cloud/IdentityTest.java index 5a80daa50da4..b7b244adb9db 100644 --- a/google-cloud-core/src/test/java/com/google/cloud/IdentityTest.java +++ b/google-cloud-core/src/test/java/com/google/cloud/IdentityTest.java @@ -37,11 +37,6 @@ public void testAllUsers() { assertNull(ALL_USERS.getValue()); } - @Test - public void testAllUsersDeprecated() { - assertEquals(Identity.Type.ALL_USERS, ALL_USERS.type()); - assertNull(ALL_USERS.value()); - } @Test public void testAllAuthenticatedUsers() { @@ -49,11 +44,6 @@ public void testAllAuthenticatedUsers() { assertNull(ALL_AUTH_USERS.getValue()); } - @Test - public void testAllAuthenticatedUsersDeprecated() { - assertEquals(Identity.Type.ALL_AUTHENTICATED_USERS, ALL_AUTH_USERS.type()); - assertNull(ALL_AUTH_USERS.value()); - } @Test public void testUser() { @@ -61,11 +51,6 @@ public void testUser() { assertEquals("abc@gmail.com", USER.getValue()); } - @Test - public void testUserDeprecated() { - assertEquals(Identity.Type.USER, USER.type()); - assertEquals("abc@gmail.com", USER.value()); - } @Test(expected = NullPointerException.class) public void testUserNullEmail() { @@ -78,11 +63,6 @@ public void testServiceAccount() { assertEquals("service-account@gmail.com", SERVICE_ACCOUNT.getValue()); } - @Test - public void testServiceAccountDeprecated() { - assertEquals(Identity.Type.SERVICE_ACCOUNT, SERVICE_ACCOUNT.type()); - assertEquals("service-account@gmail.com", SERVICE_ACCOUNT.value()); - } @Test(expected = NullPointerException.class) public void testServiceAccountNullEmail() { @@ -95,11 +75,6 @@ public void testGroup() { assertEquals("group@gmail.com", GROUP.getValue()); } - @Test - public void testGroupDeprecated() { - assertEquals(Identity.Type.GROUP, GROUP.type()); - assertEquals("group@gmail.com", GROUP.value()); - } @Test(expected = NullPointerException.class) public void testGroupNullEmail() { @@ -112,11 +87,6 @@ public void testDomain() { assertEquals("google.com", DOMAIN.getValue()); } - @Test - public void testDomainDeprecated() { - assertEquals(Identity.Type.DOMAIN, DOMAIN.type()); - assertEquals("google.com", DOMAIN.value()); - } @Test(expected = NullPointerException.class) public void testDomainNullId() { diff --git a/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceDescriptorTest.java b/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceDescriptorTest.java index 24a8be62e760..e380eab47133 100644 --- a/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceDescriptorTest.java +++ b/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceDescriptorTest.java @@ -67,21 +67,6 @@ public void testLabelDescriptor() { assertNull(INT_LABEL_NO_DESCRIPTION.getDescription()); } - @Test - public void testLabelDescriptorDeprecated() { - assertEquals("booleanKey", BOOLEAN_LABEL.key()); - assertEquals(ValueType.BOOL, BOOLEAN_LABEL.valueType()); - assertEquals("Boolean label", BOOLEAN_LABEL.description()); - assertEquals("stringKey", STRING_LABEL.key()); - assertEquals(ValueType.STRING, STRING_LABEL.valueType()); - assertEquals("String label", STRING_LABEL.description()); - assertEquals("intKey", INT_LABEL.key()); - assertEquals(ValueType.INT64, INT_LABEL.valueType()); - assertEquals("Int label", INT_LABEL.description()); - assertEquals("intKey", INT_LABEL_NO_DESCRIPTION.key()); - assertEquals(ValueType.INT64, INT_LABEL_NO_DESCRIPTION.valueType()); - assertNull(INT_LABEL_NO_DESCRIPTION.description()); - } @Test public void testBuilder() { @@ -99,21 +84,6 @@ public void testBuilder() { assertEquals(ImmutableList.of(), resourceDescriptor.getLabels()); } - @Test - public void testBuilderDeprecated() { - assertEquals(TYPE, RESOURCE_DESCRIPTOR.type()); - assertEquals(NAME, RESOURCE_DESCRIPTOR.name()); - assertEquals(DISPLAY_NAME, RESOURCE_DESCRIPTOR.displayName()); - assertEquals(DESCRIPTION, RESOURCE_DESCRIPTOR.description()); - assertEquals(LABELS, RESOURCE_DESCRIPTOR.labels()); - MonitoredResourceDescriptor resourceDescriptor = - MonitoredResourceDescriptor.newBuilder(TYPE).build(); - assertEquals(TYPE, resourceDescriptor.type()); - assertNull(resourceDescriptor.name()); - assertNull(resourceDescriptor.displayName()); - assertNull(resourceDescriptor.description()); - assertEquals(ImmutableList.of(), resourceDescriptor.labels()); - } @Test public void testToAndFromPbLabelDescriptor() { diff --git a/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceTest.java b/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceTest.java index 845ff035c679..324ed740e433 100644 --- a/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceTest.java +++ b/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceTest.java @@ -32,10 +32,6 @@ public class MonitoredResourceTest { private static final MonitoredResource MONITORED_RESOURCE = MonitoredResource.newBuilder(TYPE) .setLabels(LABELS) .build(); - private static final MonitoredResource DEPRECATED_MONITORED_RESOURCE = - MonitoredResource.builder(TYPE) - .labels(LABELS) - .build(); @Test public void testBuilder() { @@ -58,26 +54,6 @@ public void testBuilder() { assertEquals(ImmutableMap.of(), monitoredResource.getLabels()); } - @Test - public void testBuilderDeprecated() { - assertEquals(TYPE, DEPRECATED_MONITORED_RESOURCE.type()); - assertEquals(LABELS, DEPRECATED_MONITORED_RESOURCE.labels()); - MonitoredResource monitoredResource = MonitoredResource.builder(TYPE) - .addLabel("dataset-id", "myDataset") - .addLabel("zone", "myZone") - .build(); - assertEquals(TYPE, monitoredResource.type()); - assertEquals(LABELS, monitoredResource.labels()); - compareMonitoredResource(DEPRECATED_MONITORED_RESOURCE, monitoredResource); - monitoredResource = MonitoredResource.builder(TYPE) - .type("global") - .addLabel("dataset-id", "myDataset") - .addLabel("zone", "myZone") - .clearLabels() - .build(); - assertEquals("global", monitoredResource.type()); - assertEquals(ImmutableMap.of(), monitoredResource.labels()); - } @Test public void testToBuilder() { diff --git a/google-cloud-core/src/test/java/com/google/cloud/PageImplTest.java b/google-cloud-core/src/test/java/com/google/cloud/PageImplTest.java index 2a70b07ac949..fb1d2c209cc2 100644 --- a/google-cloud-core/src/test/java/com/google/cloud/PageImplTest.java +++ b/google-cloud-core/src/test/java/com/google/cloud/PageImplTest.java @@ -40,11 +40,6 @@ private static class TestPageFetcher implements PageImpl.NextPageFetcher this.nextResult = nextResult; } - @Override - public Page nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return nextResult; @@ -61,15 +56,6 @@ public void testPage() { assertEquals(VALUES, result.getValues()); } - @Test - public void testPageDeprecated() { - final PageImpl nextResult = new PageImpl<>(null, "c", NEXT_VALUES); - PageImpl.NextPageFetcher fetcher = new TestPageFetcher(nextResult); - PageImpl result = new PageImpl<>(fetcher, "c", VALUES); - assertEquals(nextResult, result.nextPage()); - assertEquals("c", result.nextPageCursor()); - assertEquals(VALUES, result.values()); - } @Test public void testIterateAll() { diff --git a/google-cloud-core/src/test/java/com/google/cloud/PolicyTest.java b/google-cloud-core/src/test/java/com/google/cloud/PolicyTest.java index 29583e64827a..cc334ec73271 100644 --- a/google-cloud-core/src/test/java/com/google/cloud/PolicyTest.java +++ b/google-cloud-core/src/test/java/com/google/cloud/PolicyTest.java @@ -55,20 +55,11 @@ public class PolicyTest { .addIdentity(VIEWER, USER, SERVICE_ACCOUNT, ALL_USERS) .addIdentity(EDITOR, ALL_AUTH_USERS, GROUP, DOMAIN) .build(); - private static final Policy DEPRECATED_SIMPLE_POLICY = Policy.builder() - .addIdentity(VIEWER, USER, SERVICE_ACCOUNT, ALL_USERS) - .addIdentity(EDITOR, ALL_AUTH_USERS, GROUP, DOMAIN) - .build(); private static final Policy FULL_POLICY = Policy.newBuilder() .setBindings(SIMPLE_POLICY.getBindings()) .setEtag("etag") .setVersion(1) .build(); - private static final Policy DEPRECATED_FULL_POLICY = Policy.builder() - .bindings(SIMPLE_POLICY.getBindings()) - .etag("etag") - .version(1) - .build(); @Test public void testBuilder() { @@ -108,43 +99,6 @@ public void testBuilder() { assertEquals(0, policy.getVersion()); } - @Test - public void testBuilderDeprecated() { - assertEquals(BINDINGS, DEPRECATED_SIMPLE_POLICY.bindings()); - assertEquals(null, DEPRECATED_SIMPLE_POLICY.etag()); - assertEquals(0, DEPRECATED_SIMPLE_POLICY.version()); - assertEquals(BINDINGS, DEPRECATED_FULL_POLICY.bindings()); - assertEquals("etag", DEPRECATED_FULL_POLICY.etag()); - assertEquals(1, DEPRECATED_FULL_POLICY.version()); - Map> editorBinding = - ImmutableMap.>builder().put(EDITOR, BINDINGS.get(EDITOR)).build(); - Policy policy = DEPRECATED_FULL_POLICY.toBuilder().bindings(editorBinding).build(); - assertEquals(editorBinding, policy.bindings()); - assertEquals("etag", policy.etag()); - assertEquals(1, policy.version()); - policy = DEPRECATED_SIMPLE_POLICY.toBuilder().removeRole(EDITOR).build(); - assertEquals(ImmutableMap.of(VIEWER, BINDINGS.get(VIEWER)), policy.bindings()); - assertNull(policy.etag()); - assertEquals(0, policy.version()); - policy = policy.toBuilder() - .removeIdentity(VIEWER, USER, ALL_USERS) - .addIdentity(VIEWER, DOMAIN, GROUP) - .build(); - assertEquals(ImmutableMap.of(VIEWER, ImmutableSet.of(SERVICE_ACCOUNT, DOMAIN, GROUP)), - policy.bindings()); - assertNull(policy.etag()); - assertEquals(0, policy.version()); - policy = Policy.builder() - .removeIdentity(VIEWER, USER) - .addIdentity(OWNER, USER, SERVICE_ACCOUNT) - .addIdentity(EDITOR, GROUP) - .removeIdentity(EDITOR, GROUP) - .build(); - assertEquals(ImmutableMap.of(OWNER, ImmutableSet.of(USER, SERVICE_ACCOUNT)), policy.bindings()); - assertNull(policy.etag()); - assertEquals(0, policy.version()); - } - @Test public void testIllegalPolicies() { try { diff --git a/google-cloud-core/src/test/java/com/google/cloud/RetryHelperTest.java b/google-cloud-core/src/test/java/com/google/cloud/RetryHelperTest.java index 987cf1daa144..68bb7ce35316 100644 --- a/google-cloud-core/src/test/java/com/google/cloud/RetryHelperTest.java +++ b/google-cloud-core/src/test/java/com/google/cloud/RetryHelperTest.java @@ -101,51 +101,6 @@ public void testTriesWithExceptionHandling() { assertNull(RetryHelper.getContext()); } - @Test - public void testTriesWithExceptionHandlingDeprecated() { - assertNull(RetryHelper.getContext()); - RetryParams params = - RetryParams.builder().initialRetryDelayMillis(0).retryMaxAttempts(3).build(); - ExceptionHandler handler = ExceptionHandler.builder() - .retryOn(IOException.class).abortOn(RuntimeException.class).build(); - final AtomicInteger count = new AtomicInteger(3); - try { - RetryHelper.runWithRetries(new Callable() { - @Override public Void call() throws IOException, NullPointerException { - if (count.decrementAndGet() == 2) { - assertEquals(1, RetryHelper.getContext().getAttemptNumber()); - throw new IOException("should be retried"); - } - assertEquals(2, RetryHelper.getContext().getAttemptNumber()); - throw new NullPointerException("Boo!"); - } - }, params, handler); - fail("Exception should have been thrown"); - } catch (NonRetriableException ex) { - assertEquals("Boo!", ex.getCause().getMessage()); - assertEquals(1, count.intValue()); - } - assertNull(RetryHelper.getContext()); - - params = RetryParams.builder().initialRetryDelayMillis(0).retryMaxAttempts(5).build(); - handler = ExceptionHandler.builder() - .retryOn(E1Exception.class, E4Exception.class) - .abortOn(E3Exception.class).build(); - final Iterator exceptions = Arrays.asList( - new E1Exception(), new E2Exception(), new E4Exception(), new E3Exception()).iterator(); - try { - RetryHelper.runWithRetries(new Callable() { - @Override public Void call() throws E1Exception { - throw exceptions.next(); - } - }, params, handler); - fail("Exception should have been thrown"); - } catch (NonRetriableException ex) { - assertTrue(ex.getCause() instanceof E3Exception); - } - assertNull(RetryHelper.getContext()); - } - @Test public void testTriesAtLeastMinTimes() { // Total retry period set to 60 seconds so as to not factor into test @@ -172,31 +127,6 @@ public void testTriesAtLeastMinTimes() { assertNull(RetryHelper.getContext()); } - @Test - public void testTriesAtLeastMinTimesDeprecated() { - // Total retry period set to 60 seconds so as to not factor into test - RetryParams params = RetryParams.builder().initialRetryDelayMillis(0) - .totalRetryPeriodMillis(60000) - .retryMinAttempts(5) - .retryMaxAttempts(10) - .build(); - final int timesToFail = 7; - assertNull(RetryHelper.getContext()); - int attempted = RetryHelper.runWithRetries(new Callable() { - int timesCalled; - @Override public Integer call() throws IOException { - timesCalled++; - assertEquals(timesCalled, RetryHelper.getContext().getAttemptNumber()); - assertEquals(10, RetryHelper.getContext().getRetryParams().retryMaxAttempts()); - if (timesCalled <= timesToFail) { - throw new IOException(); - } - return timesCalled; - } - }, params, ExceptionHandler.defaultInstance()); - assertEquals(timesToFail + 1, attempted); - assertNull(RetryHelper.getContext()); - } @Test public void testTriesNoMoreThanMaxTimes() { @@ -226,33 +156,6 @@ public void testTriesNoMoreThanMaxTimes() { } } - @Test - public void testTriesNoMoreThanMaxTimesDeprecated() { - // Total retry period set to 60 seconds so as to not factor into test - final int maxAttempts = 10; - RetryParams params = RetryParams.builder().initialRetryDelayMillis(0) - .totalRetryPeriodMillis(60000) - .retryMinAttempts(0) - .retryMaxAttempts(maxAttempts) - .build(); - final AtomicInteger timesCalled = new AtomicInteger(0); - try { - RetryHelper.runWithRetries(callable(new Runnable() { - @Override public void run() { - // Throw an exception up to maxAttempts times, should never be called beyond that - if (timesCalled.incrementAndGet() <= maxAttempts) { - throw new RuntimeException(); - } - fail("Body was executed too many times: " + timesCalled.get()); - } - }), params, ExceptionHandler.builder().retryOn(RuntimeException.class).build()); - // Unnecessary as this line should not be possible reach even if RetryHandler is broken - fail("Should not have succeeded, expected all attempts to fail and give up."); - } catch (RetriesExhaustedException expected) { - // Expect the body to run exactly maxAttempts times - assertEquals(maxAttempts, timesCalled.get()); - } - } private static class FakeClock extends Clock { diff --git a/google-cloud-core/src/test/java/com/google/cloud/RetryParamsTest.java b/google-cloud-core/src/test/java/com/google/cloud/RetryParamsTest.java index c96358042932..5f822fe7ae75 100644 --- a/google-cloud-core/src/test/java/com/google/cloud/RetryParamsTest.java +++ b/google-cloud-core/src/test/java/com/google/cloud/RetryParamsTest.java @@ -53,19 +53,6 @@ public void testDefaults() { } } - @Test - public void testDefaultsDeprecated() { - RetryParams params1 = RetryParams.defaultInstance(); - RetryParams params2 = RetryParams.builder().build(); - for (RetryParams params : Arrays.asList(params1, params2)) { - assertEquals(DEFAULT_INITIAL_RETRY_DELAY_MILLIS, params.initialRetryDelayMillis()); - assertEquals(DEFAULT_MAX_RETRY_DELAY_MILLIS, params.maxRetryDelayMillis()); - assertEquals(DEFAULT_RETRY_DELAY_BACKOFF_FACTOR, params.retryDelayBackoffFactor(), 0); - assertEquals(DEFAULT_RETRY_MAX_ATTEMPTS, params.retryMaxAttempts()); - assertEquals(DEFAULT_RETRY_MIN_ATTEMPTS, params.retryMinAttempts()); - assertEquals(DEFAULT_TOTAL_RETRY_PERIOD_MILLIS, params.totalRetryPeriodMillis()); - } - } @Test public void testSetAndCopy() { @@ -88,26 +75,6 @@ public void testSetAndCopy() { } } - @Test - public void testSetAndCopyDeprecated() { - RetryParams.Builder builder = RetryParams.builder(); - builder.initialRetryDelayMillis(101); - builder.maxRetryDelayMillis(102); - builder.retryDelayBackoffFactor(103); - builder.retryMinAttempts(107); - builder.retryMaxAttempts(108); - builder.totalRetryPeriodMillis(109); - RetryParams params1 = builder.build(); - RetryParams params2 = new RetryParams.Builder(params1).build(); - for (RetryParams params : Arrays.asList(params1, params2)) { - assertEquals(101, params.initialRetryDelayMillis()); - assertEquals(102, params.maxRetryDelayMillis()); - assertEquals(103, params.retryDelayBackoffFactor(), 0); - assertEquals(107, params.retryMinAttempts()); - assertEquals(108, params.retryMaxAttempts()); - assertEquals(109, params.totalRetryPeriodMillis()); - } - } @Test public void testBadSettings() { diff --git a/google-cloud-core/src/test/java/com/google/cloud/RoleTest.java b/google-cloud-core/src/test/java/com/google/cloud/RoleTest.java index 7cce4ee4fbc2..75df1d301dad 100644 --- a/google-cloud-core/src/test/java/com/google/cloud/RoleTest.java +++ b/google-cloud-core/src/test/java/com/google/cloud/RoleTest.java @@ -36,15 +36,6 @@ public void testOf() { compareRoles(OWNER, Role.of("roles/owner")); } - @Test - public void testOfDeprecated() { - assertEquals("roles/viewer", VIEWER.value()); - assertEquals("roles/editor", EDITOR.value()); - assertEquals("roles/owner", OWNER.value()); - compareRoles(VIEWER, Role.of("roles/viewer")); - compareRoles(EDITOR, Role.of("roles/editor")); - compareRoles(OWNER, Role.of("roles/owner")); - } @Test public void testViewer() { diff --git a/google-cloud-core/src/test/java/com/google/cloud/ServiceOptionsTest.java b/google-cloud-core/src/test/java/com/google/cloud/ServiceOptionsTest.java index cf364db57ec1..e08b5c35ce69 100644 --- a/google-cloud-core/src/test/java/com/google/cloud/ServiceOptionsTest.java +++ b/google-cloud-core/src/test/java/com/google/cloud/ServiceOptionsTest.java @@ -89,18 +89,8 @@ public class ServiceOptionsTest { .setProjectId("project-id") .setRetryParams(RetryParams.noRetries()) .build(); - private static final TestServiceOptions DEPRECATED_OPTIONS = - TestServiceOptions.newBuilder() - .setCredentials(credentials) - .clock(TEST_CLOCK) - .host("host") - .projectId("project-id") - .retryParams(RetryParams.noRetries()) - .build(); private static final TestServiceOptions DEFAULT_OPTIONS = TestServiceOptions.newBuilder().setProjectId("project-id").build(); - private static final TestServiceOptions DEPRECATED_DEFAULT_OPTIONS = - TestServiceOptions.newBuilder().projectId("project-id").build(); private static final TestServiceOptions OPTIONS_COPY = OPTIONS.toBuilder().build(); private static final String LIBRARY_NAME = "gcloud-java"; private static final Pattern APPLICATION_NAME_PATTERN = @@ -236,18 +226,6 @@ public void testBuilderNullCredentials() { TestServiceOptions.newBuilder().setCredentials(null).build(); } - @Test - public void testBuilderDeprecated() { - assertSame(credentials, DEPRECATED_OPTIONS.getCredentials()); - assertSame(TEST_CLOCK, DEPRECATED_OPTIONS.clock()); - assertEquals("host", DEPRECATED_OPTIONS.host()); - assertEquals("project-id", DEPRECATED_OPTIONS.projectId()); - assertSame(RetryParams.noRetries(), DEPRECATED_OPTIONS.retryParams()); - assertSame(Clock.defaultClock(), DEPRECATED_DEFAULT_OPTIONS.clock()); - assertEquals("https://www.googleapis.com", DEPRECATED_DEFAULT_OPTIONS.host()); - assertSame(RetryParams.getDefaultInstance(), DEPRECATED_DEFAULT_OPTIONS.retryParams()); - } - @Test public void testGetProjectIdRequired() { assertTrue(OPTIONS.projectIdRequired()); diff --git a/google-cloud-core/src/test/java/com/google/cloud/WaitForOptionTest.java b/google-cloud-core/src/test/java/com/google/cloud/WaitForOptionTest.java index 959b086aed20..dffc160bebd4 100644 --- a/google-cloud-core/src/test/java/com/google/cloud/WaitForOptionTest.java +++ b/google-cloud-core/src/test/java/com/google/cloud/WaitForOptionTest.java @@ -45,12 +45,6 @@ public void testCheckEvery() { assertEquals(TimeUnit.MILLISECONDS, CHECKING_PERIOD_OPTION.getUnit()); } - @Test - public void testCheckEveryDeprecated() { - assertEquals(OptionType.CHECKING_PERIOD, CHECKING_PERIOD_OPTION.getOptionType()); - assertEquals(42, CHECKING_PERIOD_OPTION.period()); - assertEquals(TimeUnit.MILLISECONDS, CHECKING_PERIOD_OPTION.unit()); - } @Test public void testCheckEvery_InvalidPeriod() { @@ -59,13 +53,6 @@ public void testCheckEvery_InvalidPeriod() { WaitForOption.checkEvery(-1, TimeUnit.MILLISECONDS); } - @Test - public void testTimeoutDeprecated() { - assertEquals(OptionType.TIMEOUT, TIMEOUT_OPTION.getOptionType()); - assertEquals(43, TIMEOUT_OPTION.timeoutMillis()); - Timeout timeoutOption = WaitForOption.timeout(43, TimeUnit.SECONDS); - assertEquals(43_000, timeoutOption.timeoutMillis()); - } @Test public void testTimeout_InvalidTimeout() { diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BaseDatastoreBatchWriter.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BaseDatastoreBatchWriter.java index 6a69e271fc32..c7ff2eb61fbe 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BaseDatastoreBatchWriter.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BaseDatastoreBatchWriter.java @@ -203,11 +203,6 @@ public final void delete(Key... keys) { } } - @Override - @Deprecated - public boolean active() { - return isActive(); - } @Override public boolean isActive() { @@ -276,8 +271,6 @@ protected List toMutationPbList() { return mutationsPb; } - @Deprecated - protected abstract Datastore datastore(); protected abstract Datastore getDatastore(); } diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BaseEntity.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BaseEntity.java index b41507158bba..469909397f61 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BaseEntity.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BaseEntity.java @@ -109,13 +109,6 @@ protected B setProperties(Map> properties) { return self(); } - /** - * Sets the key for the entity. - */ - @Deprecated - public B key(K key) { - return setKey(key); - } /** * Sets the key for the entity. @@ -502,13 +495,6 @@ public boolean hasKey() { return key != null; } - /** - * Returns the associated key or null if it does not have one. - */ - @Deprecated - public K key() { - return getKey(); - } /** * Returns the associated key or null if it does not have one. @@ -658,13 +644,6 @@ public Blob getBlob(String name) { return ((Value) getValue(name)).get(); } - /** - * Returns the properties name. - */ - @Deprecated - public Set names() { - return getNames(); - } /** * Returns the properties name. diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BaseKey.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BaseKey.java index 7736660b56a5..5e3dec8aba6f 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BaseKey.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BaseKey.java @@ -76,13 +76,6 @@ B self() { return (B) this; } - /** - * Adds an ancestor for this key. - */ - @Deprecated - public B ancestors(PathElement ancestor) { - return addAncestor(ancestor); - } /** * Adds an ancestor for this key. @@ -93,13 +86,6 @@ public B addAncestor(PathElement ancestor) { return self(); } - /** - * Adds an ancestor to the key. - */ - @Deprecated - public B ancestors(PathElement ancestor, PathElement... other) { - return addAncestors(ancestor, other); - } /** * Adds the provided ancestors to the key. @@ -108,13 +94,6 @@ public B addAncestors(PathElement ancestor, PathElement... other) { return addAncestors(ImmutableList.builder().add(ancestor).add(other).build()); } - /** - * Adds the provided ancestors to the key. - */ - @Deprecated - public B ancestors(Iterable ancestors) { - return addAncestors(ancestors); - } /** * Adds the provided ancestors to the key. @@ -127,13 +106,6 @@ public B addAncestors(Iterable ancestors) { return self(); } - /** - * Sets the kind of the key. - */ - @Deprecated - public B kind(String kind) { - return setKind(kind); - } /** * Sets the kind of the key. @@ -143,13 +115,6 @@ public B setKind(String kind) { return self(); } - /** - * Sets the project ID of the key. - */ - @Deprecated - public B projectId(String projectId) { - return setProjectId(projectId); - } /** * Sets the project ID of the key. @@ -159,13 +124,6 @@ public B setProjectId(String projectId) { return self(); } - /** - * Sets the namespace of the key. - */ - @Deprecated - public B namespace(String namespace) { - return setNamespace(namespace); - } /** * Sets the namespace of the key. @@ -185,13 +143,6 @@ public B setNamespace(String namespace) { this.path = path; } - /** - * Returns the key's projectId. - */ - @Deprecated - public String projectId() { - return getProjectId(); - } /** * Returns the key's projectId. @@ -200,13 +151,6 @@ public String getProjectId() { return projectId; } - /** - * Returns the key's namespace or {@code null} if not provided. - */ - @Deprecated - public String namespace() { - return getNamespace(); - } /** * Returns the key's namespace or {@code null} if not provided. @@ -215,13 +159,6 @@ public String getNamespace() { return namespace; } - /** - * Returns an immutable list with the key's ancestors. - */ - @Deprecated - public List ancestors() { - return getAncestors(); - } /** * Returns an immutable list with the key's ancestors. @@ -230,13 +167,6 @@ public List getAncestors() { return getPath().subList(0, getPath().size() - 1); } - /** - * Returns an immutable list of the key's path (ancestors + self). - */ - @Deprecated - List path() { - return getPath(); - } /** * Returns an immutable list of the key's path (ancestors + self). @@ -249,13 +179,6 @@ PathElement getLeaf() { return getPath().get(getPath().size() - 1); } - /** - * Returns the key's kind. - */ - @Deprecated - public String kind() { - return getKind(); - } /** * Returns the key's kind. @@ -264,8 +187,6 @@ public String getKind() { return getLeaf().getKind(); } - @Deprecated - abstract BaseKey parent(); abstract BaseKey getParent(); diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Batch.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Batch.java index 62d45aeb58d8..eca4c6f41c5b 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Batch.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Batch.java @@ -37,11 +37,6 @@ public interface Batch extends DatastoreBatchWriter { interface Response { - /** - * Returns a list of keys generated by a batch. - */ - @Deprecated - List generatedKeys(); /** * Returns a list of keys generated by a batch. @@ -77,11 +72,6 @@ interface Response { */ Response submit(); - /** - * Returns the batch associated {@link Datastore}. - */ - @Deprecated - Datastore datastore(); /** * Returns the batch associated {@link Datastore}. diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BatchImpl.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BatchImpl.java index e979b54f4d20..0492389eef49 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BatchImpl.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BatchImpl.java @@ -34,17 +34,6 @@ static class ResponseImpl implements Batch.Response { this.numAutoAllocatedIds = numAutoAllocatedIds; } - @Override - @Deprecated - public List generatedKeys() { - Iterator results = - response.getMutationResultsList().iterator(); - List generated = new ArrayList<>(numAutoAllocatedIds); - for (int i = 0; i < numAutoAllocatedIds; i++) { - generated.add(Key.fromPb(results.next().getKey())); - } - return generated; - } @Override public List getGeneratedKeys() { @@ -76,11 +65,6 @@ public Batch.Response submit() { return new ResponseImpl(responsePb, toAddAutoId().size()); } - @Override - @Deprecated - public Datastore datastore() { - return getDatastore(); - } @Override public Datastore getDatastore() { diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Blob.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Blob.java index 3d5ad6ff374b..5c218c958821 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Blob.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Blob.java @@ -69,13 +69,6 @@ public boolean equals(Object obj) { return obj == this || obj instanceof Blob && byteString.equals(((Blob) obj).byteString); } - /** - * Returns the size of this blob. - */ - @Deprecated - public int length() { - return getLength(); - } /** * Returns the size of this blob. diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BlobValue.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BlobValue.java index 1023ddfbee29..25342ddebe7c 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BlobValue.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BlobValue.java @@ -77,10 +77,6 @@ public static BlobValue of(Blob blob) { return new BlobValue(blob); } - @Deprecated - public static Builder builder(Blob blob) { - return newBuilder(blob); - } public static Builder newBuilder(Blob blob) { return new Builder().set(blob); diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BooleanValue.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BooleanValue.java index c0339df6ab17..38c175d0e866 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BooleanValue.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/BooleanValue.java @@ -77,10 +77,6 @@ public static BooleanValue of(boolean value) { return new BooleanValue(value); } - @Deprecated - public static Builder builder(boolean value) { - return newBuilder(value); - } public static Builder newBuilder(boolean value) { return new Builder().set(value); diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreBatchWriter.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreBatchWriter.java index 74a9f13b72c3..0b6d17233b3c 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreBatchWriter.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreBatchWriter.java @@ -109,11 +109,6 @@ interface DatastoreBatchWriter extends DatastoreWriter { @Override List put(FullEntity... entities); - /** - * Returns {@code true} if still active (write operations were not sent to the Datastore). - */ - @Deprecated - boolean active(); /** * Returns {@code true} if still active (write operations were not sent to the Datastore). diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreOptions.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreOptions.java index db65213f268b..e874a5e3264e 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreOptions.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreOptions.java @@ -79,13 +79,6 @@ public DatastoreOptions build() { return new DatastoreOptions(this); } - /** - * Sets the default namespace to be used by the datastore service. - */ - @Deprecated - public Builder namespace(String namespace) { - return setNamespace(namespace); - } /** * Sets the default namespace to be used by the datastore service. @@ -139,13 +132,6 @@ protected DatastoreRpcFactory getDefaultRpcFactory() { return DefaultDatastoreRpcFactory.INSTANCE; } - /** - * Returns the default namespace to be used by the datastore service. - */ - @Deprecated - public String namespace() { - return getNamespace(); - } /** * Returns the default namespace to be used by the datastore service. @@ -154,13 +140,6 @@ public String getNamespace() { return namespace; } - /** - * Returns a default {@code DatastoreOptions} instance. - */ - @Deprecated - public static DatastoreOptions defaultInstance() { - return getDefaultInstance(); - } /** * Returns a default {@code DatastoreOptions} instance. @@ -206,10 +185,6 @@ public boolean equals(Object obj) { return baseEquals(other) && Objects.equals(namespace, other.namespace); } - @Deprecated - public static Builder builder() { - return newBuilder(); - } public static Builder newBuilder() { return new Builder(); diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DateTime.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DateTime.java index 666b4b948ae5..afd06c52c6cb 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DateTime.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DateTime.java @@ -63,13 +63,6 @@ public boolean equals(Object obj) { && timestampMicroseconds == ((DateTime) obj).timestampMicroseconds); } - /** - * Returns the value of this timestamp in microseconds. - */ - @Deprecated - public long timestampMicroseconds() { - return getTimestampMicroseconds(); - } /** * Returns the value of this timestamp in microseconds. @@ -78,13 +71,6 @@ public long getTimestampMicroseconds() { return timestampMicroseconds; } - /** - * Returns the value of this timestamp in milliseconds. - */ - @Deprecated - public long timestampMillis() { - return getTimestampMillis(); - } /** * Returns the value of this timestamp in milliseconds. diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DateTimeValue.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DateTimeValue.java index 04226cc1e638..4e0d4cd9ba62 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DateTimeValue.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DateTimeValue.java @@ -78,10 +78,6 @@ public static DateTimeValue of(DateTime dateTime) { return new DateTimeValue(dateTime); } - @Deprecated - public static Builder builder(DateTime dateTime) { - return newBuilder(dateTime); - } public static Builder newBuilder(DateTime dateTime) { return new Builder().set(dateTime); diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DoubleValue.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DoubleValue.java index 4d94be69190c..e05589038b29 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DoubleValue.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DoubleValue.java @@ -77,10 +77,6 @@ public static DoubleValue of(double value) { return new DoubleValue(value); } - @Deprecated - public static Builder builder(double value) { - return newBuilder(value); - } public static Builder newBuilder(double value) { return new Builder().set(value); diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Entity.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Entity.java index 2fa562794e3f..bee2ae9dc243 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Entity.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Entity.java @@ -46,11 +46,6 @@ private Builder(Key key, FullEntity entity) { setKey(key); } - @Override - @Deprecated - public Builder key(Key key) { - return setKey(key); - } @Override public Builder setKey(Key key) { @@ -81,28 +76,16 @@ static Entity convert(FullEntity from) { return new Entity(from); } - @Deprecated - public static Builder builder(Key key) { - return newBuilder(key); - } public static Builder newBuilder(Key key) { return new Builder(key); } - @Deprecated - public static Builder builder(Entity copyFrom) { - return newBuilder(copyFrom); - } public static Builder newBuilder(Entity copyFrom) { return new Builder(copyFrom); } - @Deprecated - public static Builder builder(Key key, FullEntity copyFrom) { - return newBuilder(key, copyFrom); - } public static Builder newBuilder(Key key, FullEntity copyFrom) { return new Builder(key, copyFrom); diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/EntityValue.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/EntityValue.java index b6d0e560e5bd..ae716628ef39 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/EntityValue.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/EntityValue.java @@ -77,10 +77,6 @@ public static EntityValue of(FullEntity entity) { return new EntityValue(entity); } - @Deprecated - public static Builder builder(FullEntity entity) { - return newBuilder(entity); - } public static Builder newBuilder(FullEntity entity) { return new Builder().set(entity); diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/FullEntity.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/FullEntity.java index 49793c13538e..2c9b0424fcbe 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/FullEntity.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/FullEntity.java @@ -51,28 +51,16 @@ public FullEntity build() { super(from); } - @Deprecated - public static Builder builder() { - return newBuilder(); - } public static Builder newBuilder() { return new Builder<>(); } - @Deprecated - public static Builder builder(K key) { - return newBuilder(key); - } public static Builder newBuilder(K key) { return new Builder<>(key); } - @Deprecated - public static Builder builder(FullEntity copyFrom) { - return newBuilder(copyFrom); - } public static Builder newBuilder(FullEntity copyFrom) { return new Builder<>(copyFrom); diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/GqlQuery.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/GqlQuery.java index a736fdb10432..25fb897ac76a 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/GqlQuery.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/GqlQuery.java @@ -161,13 +161,6 @@ public static final class Builder { queryString = checkNotNull(query); } - /** - * Sets the GQL query string. - */ - @Deprecated - public Builder query(String query) { - return setQuery(query); - } /** * Sets the GQL query. @@ -177,13 +170,6 @@ public Builder setQuery(String query) { return this; } - /** - * Sets the namespace for the GQL query. - */ - @Deprecated - public Builder namespace(String namespace) { - return setNamespace(namespace); - } /** * Sets the namespace for the GQL query. @@ -193,14 +179,6 @@ public Builder setNamespace(String namespace) { return this; } - /** - * Sets whether the query string can contain literals. When {@code false}, the query string - * must not contain any literals and instead must bind all values. - */ - @Deprecated - public Builder allowLiteral(boolean allowLiteral) { - return setAllowLiteral(allowLiteral); - } /** * Sets whether the query string can contain literals. When {@code false}, the query string @@ -339,13 +317,6 @@ private GqlQuery(Builder builder) { positionalBindings = ImmutableList.copyOf(builder.positionalBindings); } - /** - * Returns the query string for this query. - */ - @Deprecated - public String queryString() { - return getQueryString(); - } /** * Returns the query string for this query. @@ -362,13 +333,6 @@ public boolean allowLiteral() { return allowLiteral; } - /** - * Returns an immutable map of named bindings. - */ - @Deprecated - public Map namedBindings() { - return getNamedBindings(); - } /** * Returns an immutable map of named bindings. @@ -381,13 +345,6 @@ public Map getNamedBindings() { return builder.build(); } - /** - * Returns an immutable list of positional bindings (using original order). - */ - @Deprecated - public List numberArgs() { - return getNumberArgs(); - } /** * Returns an immutable list of positional bindings (using original order). diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/IncompleteKey.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/IncompleteKey.java index 332642b4846a..ceaa3c0bdd7b 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/IncompleteKey.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/IncompleteKey.java @@ -73,14 +73,6 @@ static IncompleteKey fromPb(com.google.datastore.v1.Key keyPb) { return new IncompleteKey(projectId, namespace, path); } - /** - * Returns the key's parent. - */ - @Override - @Deprecated - public Key parent() { - return getParent(); - } /** * Returns the key's parent. @@ -105,28 +97,16 @@ public Key getParent() { return keyBuilder.addAncestors(ancestors.subList(0, ancestors.size() - 1)).build(); } - @Deprecated - public static Builder builder(String projectId, String kind) { - return newBuilder(projectId, kind); - } public static Builder newBuilder(String projectId, String kind) { return new Builder(projectId, kind); } - @Deprecated - public static Builder builder(IncompleteKey copyFrom) { - return newBuilder(copyFrom); - } public static Builder newBuilder(IncompleteKey copyFrom) { return new Builder(copyFrom); } - @Deprecated - public static Builder builder(Key parent, String kind) { - return newBuilder(parent, kind); - } public static Builder newBuilder(Key parent, String kind) { return newBuilder(parent.getProjectId(), kind) diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Key.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Key.java index 4bc216d88581..6124be89543e 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Key.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Key.java @@ -72,13 +72,6 @@ private Builder(Key copyFrom) { } } - /** - * Sets the name of this key. - */ - @Deprecated - public Builder name(String name) { - return setName(name); - } /** * Sets the name of this key. @@ -89,13 +82,6 @@ public Builder setName(String name) { return this; } - /** - * Sets the ID of this key. - */ - @Deprecated - public Builder id(long id) { - return setId(id); - } /** * Sets the ID of this key. @@ -128,13 +114,6 @@ public boolean hasId() { return getLeaf().hasId(); } - /** - * Returns the key's id or {@code null} if it has a name instead. - */ - @Deprecated - public Long id() { - return getId(); - } /** * Returns the key's id or {@code null} if it has a name instead. @@ -147,13 +126,6 @@ public boolean hasName() { return getLeaf().hasName(); } - /** - * Returns the key's name or {@code null} if it has an id instead. - */ - @Deprecated - public String name() { - return getName(); - } /** * Returns the key's name or {@code null} if it has an id instead. @@ -162,13 +134,6 @@ public String getName() { return getLeaf().getName(); } - /** - * Returns the key's ID (as {@link Long}) or name (as {@link String}). Never {@code null}. - */ - @Deprecated - public Object nameOrId() { - return getLeaf().getNameOrId(); - } /** * Returns the key's ID (as {@link Long}) or name (as {@link String}). Never {@code null}. @@ -212,55 +177,31 @@ static Key fromPb(com.google.datastore.v1.Key keyPb) { return (Key) key; } - @Deprecated - public static Builder builder(String projectId, String kind, String name) { - return newBuilder(projectId, kind, name); - } public static Builder newBuilder(String projectId, String kind, String name) { return new Builder(projectId, kind, name); } - @Deprecated - public static Builder builder(String projectId, String kind, long id) { - return newBuilder(projectId, kind, id); - } public static Builder newBuilder(String projectId, String kind, long id) { return new Builder(projectId, kind, id); } - @Deprecated - public static Builder builder(Key copyFrom) { - return newBuilder(copyFrom); - } public static Builder newBuilder(Key copyFrom) { return new Builder(copyFrom); } - @Deprecated - public static Builder builder(IncompleteKey copyFrom, String name) { - return newBuilder(copyFrom, name); - } public static Builder newBuilder(IncompleteKey copyFrom, String name) { return new Builder(copyFrom, name); } - @Deprecated - public static Builder builder(IncompleteKey copyFrom, long id) { - return newBuilder(copyFrom, id); - } public static Builder newBuilder(IncompleteKey copyFrom, long id) { return new Builder(copyFrom, id); } - @Deprecated - public static Builder builder(Key parent, String kind, String name) { - return newBuilder(parent, kind, name); - } public static Builder newBuilder(Key parent, String kind, String name) { Builder builder = newBuilder(parent.getProjectId(), kind, name); @@ -268,10 +209,6 @@ public static Builder newBuilder(Key parent, String kind, String name) { return builder; } - @Deprecated - public static Builder builder(Key parent, String kind, long id) { - return newBuilder(parent, kind, id); - } public static Builder newBuilder(Key parent, String kind, long id) { Builder builder = newBuilder(parent.getProjectId(), kind, id); diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/KeyValue.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/KeyValue.java index 42131447289f..ea5707eafe79 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/KeyValue.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/KeyValue.java @@ -77,10 +77,6 @@ public static KeyValue of(Key key) { return new KeyValue(key); } - @Deprecated - public static Builder builder(Key key) { - return newBuilder(key); - } public static Builder newBuilder(Key key) { return new Builder().set(key); diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/LatLng.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/LatLng.java index 0e659377fbac..60a971f86876 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/LatLng.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/LatLng.java @@ -45,13 +45,6 @@ public final class LatLng implements Serializable { this.longitude = longitude; } - /** - * Returns the latitude. - */ - @Deprecated - public double latitude() { - return getLatitude(); - } /** * Returns the latitude. @@ -60,13 +53,6 @@ public double getLatitude() { return latitude; } - /** - * Returns the longitude. - */ - @Deprecated - public double longitude() { - return getLongitude(); - } /** * Returns the longitude. diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/LatLngValue.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/LatLngValue.java index cf17dc3f5b30..3c32db704074 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/LatLngValue.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/LatLngValue.java @@ -78,10 +78,6 @@ public static LatLngValue of(LatLng value) { return new LatLngValue(value); } - @Deprecated - public static Builder builder(LatLng value) { - return newBuilder(value); - } public static Builder newBuilder(LatLng value) { return new Builder().set(value); diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ListValue.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ListValue.java index eacc33906739..243f0d11259f 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ListValue.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ListValue.java @@ -317,13 +317,6 @@ public static ListValue of(Blob first, Blob... other) { return newBuilder().addValue(first, other).build(); } - /** - * Returns a builder for {@code ListValue} objects. - */ - @Deprecated - public static Builder builder() { - return newBuilder(); - } /** * Returns a builder for {@code ListValue} objects. diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/LongValue.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/LongValue.java index 236f1c4f734a..a7f379a42d76 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/LongValue.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/LongValue.java @@ -77,10 +77,6 @@ public static LongValue of(long value) { return new LongValue(value); } - @Deprecated - public static Builder builder(long value) { - return newBuilder(value); - } public static Builder newBuilder(long value) { return new Builder().set(value); diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/NullValue.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/NullValue.java index fe47e122b54b..77285b82a51c 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/NullValue.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/NullValue.java @@ -85,10 +85,6 @@ public static NullValue of() { return new NullValue(); } - @Deprecated - public static Builder builder() { - return newBuilder(); - } public static Builder newBuilder() { return new Builder(); diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/PathElement.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/PathElement.java index 34a5bfce227f..e4b64e0a06f2 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/PathElement.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/PathElement.java @@ -42,13 +42,6 @@ private PathElement(String kind, String name, Long id) { this.id = id; } - /** - * Returns the kind of this path element. - */ - @Deprecated - public String kind() { - return getKind(); - } /** * Returns the kind of this path element. @@ -61,13 +54,6 @@ public boolean hasId() { return id != null; } - /** - * Returns the ID of this path element. - */ - @Deprecated - public Long id() { - return getId(); - } /** * Returns the ID of this path element. @@ -80,13 +66,6 @@ public boolean hasName() { return name != null; } - /** - * Returns the name of this path element. - */ - @Deprecated - public String name() { - return getName(); - } /** * Returns the name of this path element. @@ -95,14 +74,6 @@ public String getName() { return name; } - /** - * Returns the path element's ID (as {@link Long}) or name (as {@link String}). Never - * {@code null}. - */ - @Deprecated - public Object nameOrId() { - return getNameOrId(); - } /** * Returns the path element's ID (as {@link Long}) or name (as {@link String}). Never diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ProjectionEntity.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ProjectionEntity.java index 6538770085fb..f29975f30fbd 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ProjectionEntity.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ProjectionEntity.java @@ -55,7 +55,7 @@ public ProjectionEntity build() { @Override public DateTime getDateTime(String name) { Value value = getValue(name); - if (value.meaning() == 18 && value instanceof LongValue) { + if (value.getMeaning() == 18 && value instanceof LongValue) { return new DateTime(getLong(name)); } return ((Value) value).get(); @@ -75,10 +75,6 @@ static ProjectionEntity fromPb(com.google.datastore.v1.Entity entityPb) { return new Builder().fill(entityPb).build(); } - @Deprecated - public static Builder builder(ProjectionEntity copyFrom) { - return newBuilder(copyFrom); - } public static Builder newBuilder(ProjectionEntity copyFrom) { return new Builder(copyFrom); diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ProjectionEntityQuery.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ProjectionEntityQuery.java index e5d32d2bc333..e73fcf9bc693 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ProjectionEntityQuery.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ProjectionEntityQuery.java @@ -50,14 +50,6 @@ public Builder clearProjection() { return this; } - /** - * Sets the query's projection clause (clearing any previously specified Projection settings). - */ - @Override - @Deprecated - public Builder projection(String projection, String... others) { - return setProjection(projection, others); - } /** * Sets the query's projection clause (clearing any previously specified Projection settings). @@ -86,14 +78,6 @@ public Builder clearDistinctOn() { return this; } - /** - * Sets the query's distinct on clause (clearing any previously specified distinct on settings). - */ - @Override - @Deprecated - public Builder distinctOn(String property, String... others) { - return setDistinctOn(property, others); - } /** * Sets the query's distinct on clause (clearing any previously specified distinct on settings). diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Query.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Query.java index 0b8a8d266daf..625a50afc3cd 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Query.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Query.java @@ -167,10 +167,6 @@ ResultType getType() { return resultType; } - @Deprecated - public String namespace() { - return getNamespace(); - } public String getNamespace() { return namespace; @@ -184,24 +180,6 @@ ToStringHelper toStringHelper() { abstract Query nextQuery(com.google.datastore.v1.RunQueryResponse responsePb); - /** - * Returns a new {@link GqlQuery} builder. - * - *

Example of creating and running a GQL query. - *

 {@code
-   * String kind = "my_kind";
-   * String gqlQuery = "select * from " + kind;
-   * Query query = Query.gqlQueryBuilder(gqlQuery).build();
-   * QueryResults results = datastore.run(query);
-   * // Use results
-   * }
- * - * @see GQL Reference - */ - @Deprecated - public static GqlQuery.Builder gqlQueryBuilder(String gql) { - return newGqlQueryBuilder(ResultType.UNKNOWN, gql); - } /** * Returns a new {@link GqlQuery} builder. @@ -221,24 +199,6 @@ public static GqlQuery.Builder newGqlQueryBuilder(String gql) { return newGqlQueryBuilder(ResultType.UNKNOWN, gql); } - /** - * Returns a new {@link GqlQuery} builder. - * - *

Example of creating and running a typed GQL query. - *

 {@code
-   * String kind = "my_kind";
-   * String gqlQuery = "select * from " + kind;
-   * Query query = Query.gqlQueryBuilder(Query.ResultType.ENTITY, gqlQuery).build();
-   * QueryResults results = datastore.run(query);
-   * // Use results
-   * }
- * - * @see GQL Reference - */ - @Deprecated - public static GqlQuery.Builder gqlQueryBuilder(ResultType resultType, String gql) { - return new GqlQuery.Builder<>(resultType, gql); - } /** * Returns a new {@link GqlQuery} builder. @@ -258,22 +218,6 @@ public static GqlQuery.Builder newGqlQueryBuilder(ResultType resultTyp return new GqlQuery.Builder<>(resultType, gql); } - /** - * Returns a new {@link StructuredQuery} builder for full (complete entities) queries. - * - *

Example of creating and running an entity query. - *

 {@code
-   * String kind = "my_kind";
-   * Query query = Query.entityQueryBuilder().setKind(kind).build();
-   * QueryResults results = datastore.run(query);
-   * // Use results
-   * }
- * - */ - @Deprecated - public static EntityQuery.Builder entityQueryBuilder() { - return new EntityQuery.Builder(); - } /** * Returns a new {@link StructuredQuery} builder for full (complete entities) queries. @@ -291,22 +235,6 @@ public static EntityQuery.Builder newEntityQueryBuilder() { return new EntityQuery.Builder(); } - /** - * Returns a new {@link StructuredQuery} builder for key only queries. - * - *

Example of creating and running a key query. - *

 {@code
-   * String kind = "my_kind";
-   * Query query = Query.keyQueryBuilder().setKind(kind).build();
-   * QueryResults results = datastore.run(query);
-   * // Use results
-   * }
- * - */ - @Deprecated - public static KeyQuery.Builder keyQueryBuilder() { - return new KeyQuery.Builder(); - } /** * Returns a new {@link StructuredQuery} builder for key only queries. @@ -324,26 +252,6 @@ public static KeyQuery.Builder newKeyQueryBuilder() { return new KeyQuery.Builder(); } - /** - * Returns a new {@link StructuredQuery} builder for projection queries. - * - *

Example of creating and running a projection entity query. - *

 {@code
-   * String kind = "my_kind";
-   * String property = "my_property";
-   * Query query = Query.projectionEntityQueryBuilder()
-   *     .setKind(kind)
-   *     .addProjection(property)
-   *     .build();
-   * QueryResults results = datastore.run(query);
-   * // Use results
-   * }
- * - */ - @Deprecated - public static ProjectionEntityQuery.Builder projectionEntityQueryBuilder() { - return new ProjectionEntityQuery.Builder(); - } /** * Returns a new {@link StructuredQuery} builder for projection queries. diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/QueryResults.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/QueryResults.java index 9e50dc464abe..19c412b599cd 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/QueryResults.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/QueryResults.java @@ -21,7 +21,7 @@ /** * The result of a Google Cloud Datastore query submission. * When the result is not typed it is possible to cast it to its appropriate type according to - * the {@link #resultClass} value. + * the {@link #getResultClass} value. * Results are loaded lazily in batches, where batch size is set by Cloud Datastore. As a result, it * is possible to get a {@code DatastoreException} upon {@link Iterator#hasNext hasNext} or * {@link Iterator#next next} calls. @@ -30,36 +30,12 @@ */ public interface QueryResults extends Iterator { - /** - * Returns the actual class of the result's values. - */ - @Deprecated - Class resultClass(); /** * Returns the actual class of the result's values. */ Class getResultClass(); - /** - * Returns the Cursor for the point after the value returned in the last {@link #next} call. This - * cursor can be used to issue subsequent queries (with the same constraints) that may return - * additional results. - * - *

A simple use case: - *

 {@code
-   * Query query = Query.newEntityQueryBuilder()
-   *     .setKind("Person")
-   *     .setFilter(PropertyFilter.eq("favoriteFood", "pizza"))
-   *     .build();
-   * QueryResults results = datastore.run(query);
-   * // Consume some results (using results.next()) and do any other actions as necessary.
-   * query = query.toBuilder().setStartCursor(results.getCursorAfter()).build();
-   * results = datastore.run(query); // now we will iterate over all entities not yet consumed
-   * }
- */ - @Deprecated - Cursor cursorAfter(); /** * Returns the Cursor for the point after the value returned in the last {@link #next} call. This diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/QueryResultsImpl.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/QueryResultsImpl.java index f6b001e52bbc..ebbd4a7bcfa6 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/QueryResultsImpl.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/QueryResultsImpl.java @@ -103,22 +103,12 @@ protected T computeNext() { return result; } - @Override - @Deprecated - public Class resultClass() { - return getResultClass(); - } @Override public Class getResultClass() { return actualResultType.resultClass(); } - @Override - @Deprecated - public Cursor cursorAfter() { - return getCursorAfter(); - } @Override public Cursor getCursorAfter() { diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/StringValue.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/StringValue.java index 92dc0e981e7e..f168e9616298 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/StringValue.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/StringValue.java @@ -77,10 +77,6 @@ public static StringValue of(String value) { return new StringValue(value); } - @Deprecated - public static Builder builder(String value) { - return newBuilder(value); - } public static Builder newBuilder(String value) { return new Builder().set(value); diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/StructuredQuery.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/StructuredQuery.java index d21b42f78e25..97cc2ef24a52 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/StructuredQuery.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/StructuredQuery.java @@ -497,13 +497,6 @@ public boolean equals(Object obj) { && direction == other.direction; } - /** - * Returns the property according to which the query result should be ordered. - */ - @Deprecated - public String property() { - return getProperty(); - } /** * Returns the property according to which the query result should be ordered. @@ -512,13 +505,6 @@ public String getProperty() { return property; } - /** - * Returns the order's direction. - */ - @Deprecated - public Direction direction() { - return getDirection(); - } /** * Returns the order's direction. @@ -557,77 +543,42 @@ static OrderBy fromPb(com.google.datastore.v1.PropertyOrder propertyOrderPb) { */ public interface Builder { - /** - * Sets the namespace for the query. - */ - @Deprecated - Builder namespace(String namespace); /** * Sets the namespace for the query. */ Builder setNamespace(String namespace); - /** - * Sets the kind for the query. - */ - @Deprecated - Builder kind(String kind); /** * Sets the kind for the query. */ Builder setKind(String kind); - /** - * Sets the start cursor for the query. - */ - @Deprecated - Builder startCursor(Cursor startCursor); /** * Sets the start cursor for the query. */ Builder setStartCursor(Cursor startCursor); - /** - * Sets the end cursor for the query. - */ - @Deprecated - Builder endCursor(Cursor endCursor); /** * Sets the end cursor for the query. */ Builder setEndCursor(Cursor endCursor); - /** - * Sets the offset for the query. - */ - @Deprecated - Builder offset(int offset); /** * Sets the offset for the query. */ Builder setOffset(int offset); - /** - * Sets the limit for the query. - */ - @Deprecated - Builder limit(Integer limit); /** * Sets the limit for the query. */ Builder setLimit(Integer limit); - /** - * Sets a filter for the query. - */ - @Deprecated - Builder filter(Filter filter); Builder setFilter(Filter filter); @@ -636,11 +587,6 @@ public interface Builder { */ Builder clearOrderBy(); - /** - * Sets the query's order by clause (clearing any previously specified order by settings). - */ - @Deprecated - Builder orderBy(OrderBy orderBy, OrderBy... others); /** * Sets the query's order by clause (clearing any previously specified order by settings). @@ -698,11 +644,6 @@ B self() { return (B) this; } - @Override - @Deprecated - public B namespace(String namespace) { - return setNamespace(namespace); - } @Override public B setNamespace(String namespace) { @@ -710,11 +651,6 @@ public B setNamespace(String namespace) { return self(); } - @Override - @Deprecated - public B kind(String kind) { - return setKind(kind); - } @Override public B setKind(String kind) { @@ -722,11 +658,6 @@ public B setKind(String kind) { return self(); } - @Override - @Deprecated - public B startCursor(Cursor startCursor) { - return setStartCursor(startCursor); - } @Override public B setStartCursor(Cursor startCursor) { @@ -734,11 +665,6 @@ public B setStartCursor(Cursor startCursor) { return self(); } - @Override - @Deprecated - public B endCursor(Cursor endCursor) { - return setEndCursor(endCursor); - } @Override public B setEndCursor(Cursor endCursor) { @@ -746,11 +672,6 @@ public B setEndCursor(Cursor endCursor) { return self(); } - @Override - @Deprecated - public B offset(int offset) { - return setOffset(offset); - } @Override public B setOffset(int offset) { @@ -759,11 +680,6 @@ public B setOffset(int offset) { return self(); } - @Override - @Deprecated - public B limit(Integer limit) { - return setLimit(limit); - } @Override public B setLimit(Integer limit) { @@ -772,11 +688,6 @@ public B setLimit(Integer limit) { return self(); } - @Override - @Deprecated - public B filter(Filter filter) { - return setFilter(filter); - } @Override public B setFilter(Filter filter) { @@ -790,11 +701,6 @@ public B clearOrderBy() { return self(); } - @Override - @Deprecated - public B orderBy(OrderBy orderBy, OrderBy... others) { - return setOrderBy(orderBy, others); - } @Override public B setOrderBy(OrderBy orderBy, OrderBy... others) { @@ -815,10 +721,6 @@ B clearProjection() { return self(); } - @Deprecated - B projection(String projection, String... others) { - return setProjection(projection, others); - } B setProjection(String projection, String... others) { clearProjection(); @@ -837,10 +739,6 @@ B clearDistinctOn() { return self(); } - @Deprecated - B distinctOn(String property, String... others) { - return setDistinctOn(property, others); - } B setDistinctOn(String property, String... others) { clearDistinctOn(); @@ -943,13 +841,6 @@ public boolean equals(Object obj) { } - /** - * Returns the kind for this query. - */ - @Deprecated - public String kind() { - return getKind(); - } /** * Returns the kind for this query. @@ -962,13 +853,6 @@ boolean isKeyOnly() { return projection.size() == 1 && KEY_PROPERTY_NAME.equals(projection.get(0)); } - /** - * Returns the projection for this query. - */ - @Deprecated - public List projection() { - return getProjection(); - } /** * Returns the projection for this query. @@ -977,13 +861,6 @@ public List getProjection() { return projection; } - /** - * Returns the filter for this query. - */ - @Deprecated - public Filter filter() { - return getFilter(); - } /** * Returns the filter for this query. @@ -992,13 +869,6 @@ public Filter getFilter() { return filter; } - /** - * Returns the distinct on clause for this query. - */ - @Deprecated - public List distinctOn() { - return getDistinctOn(); - } /** * Returns the distinct on clause for this query. @@ -1007,13 +877,6 @@ public List getDistinctOn() { return distinctOn; } - /** - * Returns the order by clause for this query. - */ - @Deprecated - public ImmutableList orderBy() { - return getOrderBy(); - } /** * Returns the order by clause for this query. @@ -1022,13 +885,6 @@ public ImmutableList getOrderBy() { return orderBy; } - /** - * Returns the start cursor for this query. - */ - @Deprecated - public Cursor startCursor() { - return getStartCursor(); - } /** * Returns the start cursor for this query. @@ -1037,13 +893,6 @@ public Cursor getStartCursor() { return startCursor; } - /** - * Returns the end cursor for this query. - */ - @Deprecated - public Cursor endCursor() { - return getEndCursor(); - } /** * Returns the end cursor for this query. @@ -1052,13 +901,6 @@ public Cursor getEndCursor() { return endCursor; } - /** - * Returns the offset for this query. - */ - @Deprecated - public int offset() { - return getOffset(); - } /** * Returns the offset for this query. @@ -1067,13 +909,6 @@ public int getOffset() { return offset; } - /** - * Returns the limit for this query. - */ - @Deprecated - public Integer limit() { - return getLimit(); - } /** * Returns the limit for this query. diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Transaction.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Transaction.java index f890658e6fda..d9c74ca2a20a 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Transaction.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Transaction.java @@ -57,11 +57,6 @@ public interface Transaction extends DatastoreBatchWriter, DatastoreReaderWriter { interface Response { - /** - * Returns a list of keys generated by a transaction. - */ - @Deprecated - List generatedKeys(); /** * Returns a list of keys generated by a transaction. @@ -416,34 +411,6 @@ interface Response { */ void rollback(); - /** - * Returns {@code true} if the transaction is still active (was not committed or rolledback). - * - *

Example of verifying if a transaction is active. - *

 {@code
-   * // create an entity
-   * KeyFactory keyFactory = datastore.newKeyFactory().setKind("MyKind");
-   * Key key = datastore.allocateId(keyFactory.newKey());
-   * Entity entity = Entity.newBuilder(key).set("description", "active()").build();
-   * // calling transaction.active() now would return true
-   * try {
-   *   // add the entity and commit
-   *   transaction.put(entity);
-   *   transaction.commit();
-   * } finally {
-   *   // if committing succeeded
-   *   // then transaction.active() will be false
-   *   if (transaction.active()) {
-   *     // otherwise it's true and we need to rollback
-   *     transaction.rollback();
-   *   }
-   * }
-   * }
- * - */ - @Override - @Deprecated - boolean active(); /** * Returns {@code true} if the transaction is still active (was not committed or rolledback). @@ -473,11 +440,6 @@ interface Response { @Override boolean isActive(); - /** - * Returns the transaction associated {@link Datastore}. - */ - @Deprecated - Datastore datastore(); /** * Returns the transaction associated {@link Datastore}. diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/TransactionImpl.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/TransactionImpl.java index 150799932591..9c97fa2fc0da 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/TransactionImpl.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/TransactionImpl.java @@ -38,17 +38,6 @@ static class ResponseImpl implements Transaction.Response { this.numAutoAllocatedIds = numAutoAllocatedIds; } - @Override - @Deprecated - public List generatedKeys() { - Iterator results = - response.getMutationResultsList().iterator(); - List generated = new ArrayList<>(numAutoAllocatedIds); - for (int i = 0; i < numAutoAllocatedIds; i++) { - generated.add(Key.fromPb(results.next().getKey())); - } - return generated; - } @Override public List getGeneratedKeys() { @@ -124,11 +113,6 @@ public void rollback() { rolledback = true; } - @Override - @Deprecated - public Datastore datastore() { - return getDatastore(); - } @Override public Datastore getDatastore() { diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Value.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Value.java index 92543d9522c3..553906ef4ea8 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Value.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Value.java @@ -55,7 +55,7 @@ abstract static class BaseMarshaller, B extends ValueBuild @Override public final B fromProto(com.google.datastore.v1.Value proto) { B builder = newBuilder(getValue(proto)); - builder.excludeFromIndexes(proto.getExcludeFromIndexes()); + builder.setExcludeFromIndexes(proto.getExcludeFromIndexes()); builder.meaning(proto.getMeaning()); return builder; } @@ -101,22 +101,10 @@ public B mergeFrom(P other) { } @Override - @Deprecated public boolean getExcludeFromIndexes() { - return excludeFromIndexes(); - } - - @Override - public boolean excludeFromIndexes() { return excludeFromIndexes; } - @Override - @Deprecated - public B excludeFromIndexes(boolean excludeFromIndexes) { - return setExcludeFromIndexes(excludeFromIndexes); - } - @Override public B setExcludeFromIndexes(boolean excludeFromIndexes) { this.excludeFromIndexes = excludeFromIndexes; @@ -165,7 +153,7 @@ private B self() { @SuppressWarnings("deprecation")

, B extends BaseBuilder> Value(ValueBuilder builder) { valueType = builder.getValueType(); - excludeFromIndexes = builder.excludeFromIndexes(); + excludeFromIndexes = builder.getExcludeFromIndexes(); meaning = builder.getMeaning(); value = builder.get(); } diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ValueBuilder.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ValueBuilder.java index 7a8065b54523..948f4a4b3feb 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ValueBuilder.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ValueBuilder.java @@ -29,14 +29,8 @@ public interface ValueBuilder, B extends ValueBuilder names = - ImmutableSet.builder() - .add("string", "stringValue", "boolean", "double", "long", "list1", "list2", "list3") - .add("entity", "partialEntity", "null", "dateTime", "blob", "key", "blobList") - .add("booleanList", "dateTimeList", "doubleList", "keyList", "entityList", "stringList") - .add("longList", "latLng", "latLngList") - .build(); - BaseEntity entity = builder.build(); - assertEquals(names, entity.names()); - } @Test public void testKey() throws Exception { @@ -250,11 +238,5 @@ public void testKey() throws Exception { BaseEntity entity = builder.build(); assertEquals(KEY, entity.getKey()); } - - @Test - public void testKeyDeprecated() throws Exception { - builder.key(KEY); - BaseEntity entity = builder.build(); - assertEquals(KEY, entity.key()); - } } + diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BaseKeyTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BaseKeyTest.java index aa5302d15d62..512879c2bd90 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BaseKeyTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BaseKeyTest.java @@ -46,11 +46,6 @@ protected BaseKey build() { path.add(PathElement.of(kind)); return new BaseKey(projectId, namespace, path.build()) { - @Override - @Deprecated - protected BaseKey parent() { - return null; - } @Override protected BaseKey getParent() { @@ -69,14 +64,6 @@ public void testProjectId() throws Exception { assertEquals("ds2", key.getProjectId()); } - @Test - public void testProjectIdDeprecated() throws Exception { - Builder builder = new Builder("ds1", "k"); - BaseKey key = builder.build(); - assertEquals("ds1", key.projectId()); - key = builder.projectId("ds2").build(); - assertEquals("ds2", key.projectId()); - } @Test(expected = IllegalArgumentException.class) public void testBadDatasetInConstructor() throws Exception { @@ -89,11 +76,6 @@ public void testBadDatasetInSetter() throws Exception { builder.setProjectId(" "); } - @Test(expected = IllegalArgumentException.class) - public void testBadDatasetInSetterDeprecated() throws Exception { - Builder builder = new Builder("d", "k"); - builder.projectId(" "); - } @Test public void testNamespace() throws Exception { @@ -105,15 +87,6 @@ public void testNamespace() throws Exception { assertEquals("ns", key.getNamespace()); } - @Test - public void testNamespaceDeprecated() throws Exception { - Builder builder = new Builder("ds", "k"); - BaseKey key = builder.build(); - assertTrue(key.namespace() != null); - assertTrue(key.namespace().isEmpty()); - key = builder.namespace("ns").build(); - assertEquals("ns", key.namespace()); - } @Test public void testKind() throws Exception { @@ -124,14 +97,6 @@ public void testKind() throws Exception { assertEquals("k2", key.getKind()); } - @Test - public void testKindDeprecated() throws Exception { - Builder builder = new Builder("ds", "k1"); - BaseKey key = builder.build(); - assertEquals("k1", key.kind()); - key = builder.kind("k2").build(); - assertEquals("k2", key.kind()); - } @Test(expected = NullPointerException.class) public void testNoKind() throws Exception { @@ -150,11 +115,6 @@ public void testBadKindInSetter() throws Exception { builder.setKind(""); } - @Test(expected = IllegalArgumentException.class) - public void testBadKindInSetterDeprecated() throws Exception { - Builder builder = new Builder("ds", "k1"); - builder.kind(""); - } @Test public void testAncestors() throws Exception { @@ -169,18 +129,5 @@ public void testAncestors() throws Exception { key = builder.addAncestor(path.get(1)).build(); assertEquals(path, key.getAncestors()); } - - @Test - public void testAncestorsDeprecated() throws Exception { - Builder builder = new Builder("ds", "k"); - BaseKey key = builder.build(); - assertTrue(key.ancestors().isEmpty()); - List path = new ArrayList<>(); - path.add(PathElement.of("p1", "v1")); - key = builder.ancestors(path.get(0)).build(); - assertEquals(path, key.ancestors()); - path.add(PathElement.of("p2", "v2")); - key = builder.ancestors(path.get(1)).build(); - assertEquals(path, key.ancestors()); - } } + diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BlobTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BlobTest.java index 2746880f7735..8a8e1924d80f 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BlobTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BlobTest.java @@ -59,11 +59,6 @@ public void testLength() throws Exception { assertEquals(bytes2.length, blob2.getLength()); } - @Test - public void testLengthDeprecated() throws Exception { - assertEquals(bytes1.length, blob1.length()); - assertEquals(bytes2.length, blob2.length()); - } @Test public void testToByteArray() throws Exception { diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BlobValueTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BlobValueTest.java index 2232cfb55a54..25617b66400d 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BlobValueTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BlobValueTest.java @@ -48,13 +48,4 @@ public void testBuilder() throws Exception { assertEquals(1, value.getMeaning()); assertTrue(value.excludeFromIndexes()); } - - @Test - public void testBuilderDeprecated() throws Exception { - BlobValue.Builder builder = BlobValue.builder(CONTENT); - BlobValue value = builder.meaning(1).excludeFromIndexes(true).build(); - assertEquals(CONTENT, value.get()); - assertEquals(1, value.meaning()); - assertTrue(value.excludeFromIndexes()); - } } diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BooleanValueTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BooleanValueTest.java index 983be5db7a62..a818dda3adb6 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BooleanValueTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/BooleanValueTest.java @@ -46,13 +46,5 @@ public void testBuilder() throws Exception { assertEquals(1, value.getMeaning()); assertTrue(value.excludeFromIndexes()); } - - @Test - public void testBuilderDeprecated() throws Exception { - BooleanValue.Builder builder = BooleanValue.builder(true); - BooleanValue value = builder.meaning(1).excludeFromIndexes(true).build(); - assertTrue(value.get()); - assertEquals(1, value.meaning()); - assertTrue(value.excludeFromIndexes()); - } } + diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DateTimeTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DateTimeTest.java index 3131ea54747b..8e4a2e219734 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DateTimeTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DateTimeTest.java @@ -33,13 +33,6 @@ public void testTimestampMicroseconds() throws Exception { assertEquals(cal.getTimeInMillis() * 1000, date.getTimestampMicroseconds()); } - @Test - public void testTimestampMicrosecondsDepreated() throws Exception { - Calendar cal = Calendar.getInstance(); - DateTime date = DateTime.copyFrom(cal); - assertEquals(cal.getTimeInMillis() * 1000, date.timestampMicroseconds()); - } - @Test public void testTimestampMillis() throws Exception { Calendar cal = Calendar.getInstance(); @@ -47,13 +40,6 @@ public void testTimestampMillis() throws Exception { assertEquals(cal.getTimeInMillis(), date.getTimestampMillis()); } - @Test - public void testTimestampMillisDepreated() throws Exception { - Calendar cal = Calendar.getInstance(); - DateTime date = DateTime.copyFrom(cal); - assertEquals(cal.getTimeInMillis(), date.timestampMillis()); - } - @Test public void testToDate() throws Exception { Calendar cal = Calendar.getInstance(); diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DateTimeValueTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DateTimeValueTest.java index 501f7c46cba8..56324631d3d9 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DateTimeValueTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DateTimeValueTest.java @@ -48,13 +48,4 @@ public void testBuilder() throws Exception { assertEquals(1, value.getMeaning()); assertTrue(value.excludeFromIndexes()); } - - @Test - public void testBuilderDeprecated() throws Exception { - DateTimeValue.Builder builder = DateTimeValue.builder(CONTENT); - DateTimeValue value = builder.meaning(1).excludeFromIndexes(true).build(); - assertEquals(CONTENT, value.get()); - assertEquals(1, value.meaning()); - assertTrue(value.excludeFromIndexes()); - } } diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DoubleValueTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DoubleValueTest.java index d3e7f8b76e56..034eb994b091 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DoubleValueTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DoubleValueTest.java @@ -49,13 +49,4 @@ public void testBuilder() throws Exception { assertEquals(1, value.getMeaning()); assertTrue(value.excludeFromIndexes()); } - - @Test - public void testBuilderDeprecated() throws Exception { - DoubleValue.Builder builder = DoubleValue.builder(CONTENT); - DoubleValue value = builder.meaning(1).excludeFromIndexes(true).build(); - assertEquals(CONTENT, value.get()); - assertEquals(1, value.meaning()); - assertTrue(value.excludeFromIndexes()); - } } diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/EntityTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/EntityTest.java index 470c58243567..5557821221a1 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/EntityTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/EntityTest.java @@ -28,7 +28,6 @@ public class EntityTest { private static final Key KEY2 = Key.newBuilder("ds1", "k2", 1).build(); private static final IncompleteKey INCOMPLETE_KEY = IncompleteKey.newBuilder("ds1", "k2").build(); private static final Entity ENTITY = Entity.newBuilder(KEY1).set("foo", "bar").build(); - private static final Entity DEPRECATED_ENTITY = Entity.builder(KEY1).set("foo", "bar").build(); private static final FullEntity INCOMPLETE_ENTITY = Entity.newBuilder(INCOMPLETE_KEY).set("a", "b").build(); @@ -39,12 +38,6 @@ public void testEntity() throws Exception { assertEquals("bar", ENTITY.getString("foo")); } - @Test - public void testEntityDeprecated() throws Exception { - assertTrue(ENTITY.hasKey()); - assertEquals(KEY1, DEPRECATED_ENTITY.key()); - assertEquals("bar", DEPRECATED_ENTITY.getString("foo")); - } @Test public void testCopyFrom() throws Exception { @@ -56,15 +49,6 @@ public void testCopyFrom() throws Exception { assertEquals(ENTITY.getProperties(), entity.getProperties()); } - @Test - public void testCopyFromDeprecated() throws Exception { - Entity.Builder builder = Entity.builder(ENTITY); - assertEquals(ENTITY, builder.build()); - Entity entity = builder.key(KEY2).build(); - assertNotEquals(ENTITY, entity); - assertEquals(KEY2, entity.key()); - assertEquals(ENTITY.getProperties(), entity.getProperties()); - } @Test public void testCopyFromIncompleteEntity() throws Exception { @@ -73,12 +57,4 @@ public void testCopyFromIncompleteEntity() throws Exception { assertNotEquals(INCOMPLETE_ENTITY, entity); assertEquals(INCOMPLETE_ENTITY.getProperties(), entity.getProperties()); } - - @Test - public void testCopyFromIncompleteEntityDeprecated() throws Exception { - Entity.Builder builder = Entity.builder(KEY2, INCOMPLETE_ENTITY); - Entity entity = builder.build(); - assertNotEquals(INCOMPLETE_ENTITY, entity); - assertEquals(INCOMPLETE_ENTITY.getProperties(), entity.getProperties()); - } } diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/EntityValueTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/EntityValueTest.java index ca50ddefeb5e..6b093e9a9582 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/EntityValueTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/EntityValueTest.java @@ -50,13 +50,4 @@ public void testBuilder() throws Exception { assertEquals(1, value.getMeaning()); assertTrue(value.excludeFromIndexes()); } - - @Test - public void testBuilderDeprecated() throws Exception { - EntityValue.Builder builder = EntityValue.builder(CONTENT); - EntityValue value = builder.meaning(1).excludeFromIndexes(true).build(); - assertEquals(CONTENT, value.get()); - assertEquals(1, value.meaning()); - assertTrue(value.excludeFromIndexes()); - } } diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/FullEntityTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/FullEntityTest.java index c48ea5aad7fc..e587dad4f705 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/FullEntityTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/FullEntityTest.java @@ -58,18 +58,6 @@ public void testNoKey() throws Exception { assertNull(entity.getKey()); } - @Test - public void testNoKeyDeprecated() throws Exception { - FullEntity entity = FullEntity.builder().set("foo", "bar").build(); - assertFalse(entity.hasKey()); - assertNull(entity.key()); - assertEquals("bar", entity.getString("foo")); - - entity = FullEntity.builder((IncompleteKey) null).build(); - assertFalse(entity.hasKey()); - assertNull(entity.key()); - } - @Test public void testCopyFrom() throws Exception { FullEntity.Builder builder1 = FullEntity.newBuilder(ENTITY); @@ -81,16 +69,4 @@ public void testCopyFrom() throws Exception { FullEntity.Builder builder2 = FullEntity.newBuilder(INCOMPLETE_ENTITY); assertEquals(INCOMPLETE_ENTITY, builder2.build()); } - - @Test - public void testCopyFromDeprected() throws Exception { - FullEntity.Builder builder1 = FullEntity.builder(ENTITY); - assertEquals(ENTITY, builder1.build()); - - builder1 = FullEntity.builder(COMPLETE_ENTITY1); - assertEquals(COMPLETE_ENTITY1, builder1.build()); - - FullEntity.Builder builder2 = FullEntity.builder(INCOMPLETE_ENTITY); - assertEquals(INCOMPLETE_ENTITY, builder2.build()); - } } diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/IncompleteKeyTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/IncompleteKeyTest.java index bb5531106603..fcbe51f2a2c2 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/IncompleteKeyTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/IncompleteKeyTest.java @@ -34,8 +34,6 @@ public void setUp() { pk1 = IncompleteKey.newBuilder("ds", "kind1").build(); parent1 = Key.newBuilder("ds", "kind2", 10).setNamespace("ns").build(); pk2 = IncompleteKey.newBuilder(parent1, "kind3").build(); - deprecatedPk1 = IncompleteKey.builder("ds", "kind1").build(); - deprecatedPk2 = IncompleteKey.builder(parent1, "kind3").build(); } @Test @@ -55,23 +53,6 @@ public void testBuilders() throws Exception { assertEquals(parent1.getPath(), pk3.getAncestors()); } - @Test - public void testBuildersDeprecated() throws Exception { - assertEquals("ds", deprecatedPk1.projectId()); - assertEquals("kind1", deprecatedPk1.kind()); - assertTrue(deprecatedPk1.ancestors().isEmpty()); - - assertEquals("ds", deprecatedPk2.projectId()); - assertEquals("kind3", deprecatedPk2.kind()); - assertEquals(parent1.path(), deprecatedPk2.ancestors()); - - assertEquals(deprecatedPk2, IncompleteKey.builder(deprecatedPk2).build()); - IncompleteKey deprecatedPk3 = IncompleteKey.builder(deprecatedPk2).kind("kind4").build(); - assertEquals("ds", deprecatedPk3.projectId()); - assertEquals("kind4", deprecatedPk3.kind()); - assertEquals(parent1.path(), deprecatedPk3.ancestors()); - } - @Test public void testParent() { assertNull(pk1.getParent()); @@ -80,13 +61,4 @@ public void testParent() { IncompleteKey pk3 = IncompleteKey.newBuilder(parent2, "kind3").build(); assertEquals(parent2, pk3.getParent()); } - - @Test - public void testParentDeprecated() { - assertNull(deprecatedPk1.parent()); - assertEquals(parent1, deprecatedPk2.parent()); - Key parent2 = Key.newBuilder("ds", "kind3", "name").setName("ns").build(); - IncompleteKey deprecatedPk3 = IncompleteKey.builder(parent2, "kind3").build(); - assertEquals(parent2, deprecatedPk3.parent()); - } } diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/KeyFactoryTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/KeyFactoryTest.java index 45aec369d9b3..05bafac986d5 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/KeyFactoryTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/KeyFactoryTest.java @@ -34,7 +34,6 @@ public class KeyFactoryTest { @Before public void setUp() { keyFactory = new KeyFactory(PROJECT_ID).setKind("k"); - deprecatedKeyFactory = new KeyFactory(PROJECT_ID).kind("k"); } @Test @@ -76,45 +75,6 @@ public void testReset() { assertEquals("kind", key.getKind()); } - @Test - public void testResetDeprecated() { - IncompleteKey key = deprecatedKeyFactory - .projectId("ds1") - .namespace("ns1") - .ancestors(PathElement.of("p", 1)) - .build(); - assertEquals("k", key.kind()); - assertEquals("ds1", key.projectId()); - assertEquals("ns1", key.namespace()); - assertEquals(1, key.ancestors().size()); - - deprecatedKeyFactory.reset(); - try { - deprecatedKeyFactory.newKey(1); - } catch (NullPointerException ex) { - assertEquals("kind must not be null", ex.getMessage()); - } - deprecatedKeyFactory.kind("k1"); - key = deprecatedKeyFactory.newKey(); - assertEquals("k1", key.kind()); - assertEquals(PROJECT_ID, key.projectId()); - assertTrue(key.namespace().isEmpty()); - assertTrue(key.ancestors().isEmpty()); - - deprecatedKeyFactory = new KeyFactory(PROJECT_ID, "ns1").kind("k"); - key = deprecatedKeyFactory.newKey(); - assertEquals(PROJECT_ID, key.projectId()); - assertEquals("ns1", key.namespace()); - key = deprecatedKeyFactory.projectId("bla1").namespace("bla2").build(); - assertEquals("bla1", key.projectId()); - assertEquals("bla2", key.namespace()); - deprecatedKeyFactory.reset().kind("kind"); - key = deprecatedKeyFactory.newKey(); - assertEquals(PROJECT_ID, key.projectId()); - assertEquals("ns1", key.namespace()); - assertEquals("kind", key.kind()); - } - @Test public void testNewKey() throws Exception { Key key = keyFactory.newKey(1); @@ -127,17 +87,6 @@ public void testNewKey() throws Exception { verifyKey(key, "k3", "ns", p1, p2); } - @Test - public void testNewKeyDeprecated() throws Exception { - Key key = keyFactory.newKey(1); - verifyKey(key, 1L, ""); - key = deprecatedKeyFactory.newKey("n"); - verifyKey(key, "n", ""); - PathElement p1 = PathElement.of("k1", "n"); - PathElement p2 = PathElement.of("k2", 10); - key = deprecatedKeyFactory.namespace("ns").ancestors(p1, p2).newKey("k3"); - verifyKey(key, "k3", "ns", p1, p2); - } @Test public void testNewIncompleteKey() throws Exception { @@ -149,15 +98,6 @@ public void testNewIncompleteKey() throws Exception { verifyIncompleteKey(key, "ns", p1, p2); } - @Test - public void testNewIncompleteKeyDeprecated() throws Exception { - IncompleteKey key = deprecatedKeyFactory.newKey(); - verifyIncompleteKey(key, ""); - PathElement p1 = PathElement.of("k1", "n"); - PathElement p2 = PathElement.of("k2", 10); - key = deprecatedKeyFactory.namespace("ns").ancestors(p1, p2).newKey(); - verifyIncompleteKey(key, "ns", p1, p2); - } @Test(expected = NullPointerException.class) public void testNewIncompleteWithNoKind() { diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/KeyTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/KeyTest.java index aaa50130da0c..979d68936f70 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/KeyTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/KeyTest.java @@ -33,14 +33,6 @@ public void testHasId() throws Exception { assertFalse(key.hasId()); } - @Test - public void testHasIdDeprecated() throws Exception { - Key.Builder builder = Key.builder("d", "k", 10); - Key key = builder.build(); - assertTrue(key.hasId()); - key = builder.name("bla").build(); - assertFalse(key.hasId()); - } @Test public void testId() throws Exception { @@ -51,14 +43,6 @@ public void testId() throws Exception { assertEquals(Long.valueOf(100), key.getId()); } - @Test - public void testIdDeprecated() throws Exception { - Key.Builder builder = Key.builder("d", "k", 10); - Key key = builder.build(); - assertEquals(Long.valueOf(10), key.id()); - key = builder.id(100).build(); - assertEquals(Long.valueOf(100), key.id()); - } @Test public void testHasName() throws Exception { @@ -69,14 +53,6 @@ public void testHasName() throws Exception { assertFalse(key.hasName()); } - @Test - public void testHasNameDeprecated() throws Exception { - Key.Builder builder = Key.builder("d", "k", "n"); - Key key = builder.build(); - assertTrue(key.hasName()); - key = builder.id(1).build(); - assertFalse(key.hasName()); - } @Test public void testName() throws Exception { @@ -87,14 +63,6 @@ public void testName() throws Exception { assertEquals("o", key.getName()); } - @Test - public void testNameDeprecated() throws Exception { - Key.Builder builder = Key.builder("d", "k", "n"); - Key key = builder.build(); - assertEquals("n", key.name()); - key = builder.name("o").build(); - assertEquals("o", key.name()); - } @Test public void testNameOrId() throws Exception { @@ -105,14 +73,6 @@ public void testNameOrId() throws Exception { assertEquals(Long.valueOf(1), key.getNameOrId()); } - @Test - public void testNameOrIdDeprecated() throws Exception { - Key.Builder builder = Key.builder("d", "k", "n"); - Key key = builder.build(); - assertEquals("n", key.nameOrId()); - key = builder.id(1).build(); - assertEquals(Long.valueOf(1), key.nameOrId()); - } @Test public void testToAndFromUrlSafe() throws Exception { diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/KeyValueTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/KeyValueTest.java index 3f7d5d4a5af9..aa659835c629 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/KeyValueTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/KeyValueTest.java @@ -49,13 +49,4 @@ public void testBuilder() throws Exception { assertEquals(1, value.getMeaning()); assertTrue(value.excludeFromIndexes()); } - - @Test - public void testBuilderDeprecated() throws Exception { - KeyValue.Builder builder = KeyValue.newBuilder(CONTENT); - KeyValue value = builder.meaning(1).excludeFromIndexes(true).build(); - assertEquals(CONTENT, value.get()); - assertEquals(1, value.meaning()); - assertTrue(value.excludeFromIndexes()); - } } diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/LatLngTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/LatLngTest.java index f693808263c3..85dffb3b4541 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/LatLngTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/LatLngTest.java @@ -42,11 +42,6 @@ public void testLatLng() { assertEquals(-122.084124, gp1.getLongitude(), 0); } - @Test - public void testLatLngDeprecated() { - assertEquals(37.422035, gp1.latitude(), 0); - assertEquals(-122.084124, gp1.longitude(), 0); - } @Test public void testEquals() { diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/LatLngValueTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/LatLngValueTest.java index ae3c36b50ad4..cb7d271466f2 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/LatLngValueTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/LatLngValueTest.java @@ -49,13 +49,4 @@ public void testBuilder() throws Exception { assertEquals(1, value.getMeaning()); assertTrue(value.excludeFromIndexes()); } - - @Test - public void testBuilderDeprecated() throws Exception { - LatLngValue.Builder builder = LatLngValue.builder(CONTENT); - LatLngValue value = builder.meaning(1).excludeFromIndexes(true).build(); - assertEquals(CONTENT, value.get()); - assertEquals(1, value.meaning()); - assertTrue(value.excludeFromIndexes()); - } } diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/ListValueTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/ListValueTest.java index d4d3a0ed8015..1743e18d6486 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/ListValueTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/ListValueTest.java @@ -199,19 +199,4 @@ public void testBuilder() throws Exception { builder = builder.addValue(BLOB1, BLOB2); assertEquals(ImmutableList.of(BlobValue.of(BLOB1), BlobValue.of(BLOB2)), builder.build().get()); } - - @Test - public void testBuilderDeprecated() throws Exception { - ListValue.Builder builder = ListValue.builder().set(CONTENT); - ListValue value = builder.meaning(1).excludeFromIndexes(true).build(); - assertEquals(CONTENT, value.get()); - assertEquals(1, value.meaning()); - assertTrue(value.excludeFromIndexes()); - - builder = ListValue.builder(); - for (Value v : CONTENT) { - builder.addValue(v); - } - assertEquals(CONTENT, builder.build().get()); - } } diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/LongValueTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/LongValueTest.java index 5765cf5f4182..71d62f7647fa 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/LongValueTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/LongValueTest.java @@ -49,13 +49,4 @@ public void testBuilder() throws Exception { assertEquals(1, value.getMeaning()); assertTrue(value.excludeFromIndexes()); } - - @Test - public void testBuilderDeprecated() throws Exception { - LongValue.Builder builder = LongValue.builder(CONTENT); - LongValue value = builder.meaning(1).excludeFromIndexes(true).build(); - assertEquals(CONTENT, value.get()); - assertEquals(1, value.meaning()); - assertTrue(value.excludeFromIndexes()); - } } diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/NullValueTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/NullValueTest.java index e49c8e429735..f5a7b419a0db 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/NullValueTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/NullValueTest.java @@ -47,13 +47,4 @@ public void testBuilder() throws Exception { assertEquals(1, value.getMeaning()); assertTrue(value.excludeFromIndexes()); } - - @Test - public void testBuilderDeprecated() throws Exception { - NullValue.Builder builder = NullValue.builder(); - NullValue value = builder.meaning(1).excludeFromIndexes(true).build(); - assertNull(value.get()); - assertEquals(1, value.meaning()); - assertTrue(value.excludeFromIndexes()); - } } diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/PathElementTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/PathElementTest.java index 3d69c10d8048..e0ffccabb721 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/PathElementTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/PathElementTest.java @@ -36,13 +36,6 @@ public void testKind() throws Exception { assertEquals("k3", PE_3.getKind()); } - @Test - public void testKindDeprected() throws Exception { - assertEquals("k1", PE_1.kind()); - assertEquals("k2", PE_2.kind()); - assertEquals("k3", PE_3.kind()); - } - @Test public void testHasId() throws Exception { assertFalse(PE_1.hasId()); @@ -57,12 +50,6 @@ public void testId() throws Exception { assertEquals(Long.valueOf(1), PE_3.getId()); } - @Test - public void testIdDeprecated() throws Exception { - assertNull(PE_1.id()); - assertNull(PE_2.id()); - assertEquals(Long.valueOf(1), PE_3.id()); - } @Test public void testHasName() throws Exception { @@ -78,12 +65,6 @@ public void testName() throws Exception { assertNull(PE_3.getName()); } - @Test - public void testNameDeprecated() throws Exception { - assertNull(PE_1.name()); - assertEquals("n", PE_2.name()); - assertNull(PE_3.name()); - } @Test public void testNameOrId() throws Exception { @@ -91,11 +72,4 @@ public void testNameOrId() throws Exception { assertEquals("n", PE_2.getNameOrId()); assertEquals(Long.valueOf(1), PE_3.getNameOrId()); } - - @Test - public void testNameOrIdDeprecated() throws Exception { - assertNull(PE_1.nameOrId()); - assertEquals("n", PE_2.nameOrId()); - assertEquals(Long.valueOf(1), PE_3.nameOrId()); - } } diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/StringValueTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/StringValueTest.java index ee26ea0103b7..706a39769b7b 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/StringValueTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/StringValueTest.java @@ -48,13 +48,4 @@ public void testBuilder() throws Exception { assertEquals(1, value.getMeaning()); assertTrue(value.excludeFromIndexes()); } - - @Test - public void testBuilderDeprecated() throws Exception { - StringValue.Builder builder = StringValue.builder(CONTENT); - StringValue value = builder.meaning(1).excludeFromIndexes(true).build(); - assertEquals(CONTENT, value.get()); - assertEquals(1, value.meaning()); - assertTrue(value.excludeFromIndexes()); - } } diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/StructuredQueryTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/StructuredQueryTest.java index 61c851c728a1..4664d4f5631d 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/StructuredQueryTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/StructuredQueryTest.java @@ -83,39 +83,6 @@ public class StructuredQueryTest { .setProjection(PROJECTION1, PROJECTION2) .setDistinctOn(DISTINCT_ON1, DISTINCT_ON2) .build(); - private static final EntityQuery DEPRECATED_ENTITY_QUERY = Query.entityQueryBuilder() - .namespace(NAMESPACE) - .kind(KIND) - .startCursor(START_CURSOR) - .endCursor(END_CURSOR) - .offset(OFFSET) - .limit(LIMIT) - .filter(FILTER) - .orderBy(ORDER_BY_1, ORDER_BY_2) - .build(); - private static final KeyQuery DEPRECATED_KEY_QUERY = Query.keyQueryBuilder() - .namespace(NAMESPACE) - .kind(KIND) - .startCursor(START_CURSOR) - .endCursor(END_CURSOR) - .offset(OFFSET) - .limit(LIMIT) - .filter(FILTER) - .orderBy(ORDER_BY_1, ORDER_BY_2) - .build(); - private static final ProjectionEntityQuery DEPRECATED_PROJECTION_QUERY = - Query.projectionEntityQueryBuilder() - .namespace(NAMESPACE) - .kind(KIND) - .startCursor(START_CURSOR) - .endCursor(END_CURSOR) - .offset(OFFSET) - .limit(LIMIT) - .filter(FILTER) - .orderBy(ORDER_BY_1, ORDER_BY_2) - .projection(PROJECTION1, PROJECTION2) - .distinctOn(DISTINCT_ON1, DISTINCT_ON2) - .build(); @Test public void testEntityQueryBuilder() { @@ -124,12 +91,6 @@ public void testEntityQueryBuilder() { assertTrue(ENTITY_QUERY.getDistinctOn().isEmpty()); } - @Test - public void testEntityQueryBuilderDeprecated() { - compareBaseBuilderFieldsDeprecated(ENTITY_QUERY); - assertTrue(DEPRECATED_ENTITY_QUERY.projection().isEmpty()); - assertTrue(DEPRECATED_ENTITY_QUERY.distinctOn().isEmpty()); - } @Test public void testKeyQueryBuilder() { @@ -138,13 +99,6 @@ public void testKeyQueryBuilder() { assertTrue(KEY_QUERY.getDistinctOn().isEmpty()); } - @Test - public void testKeyQueryBuilderDeprecated() { - compareBaseBuilderFieldsDeprecated(DEPRECATED_KEY_QUERY); - assertEquals(ImmutableList.of(StructuredQuery.KEY_PROPERTY_NAME), - DEPRECATED_KEY_QUERY.projection()); - assertTrue(DEPRECATED_KEY_QUERY.distinctOn().isEmpty()); - } @Test public void testProjectionEntityQueryBuilder() { @@ -153,12 +107,6 @@ public void testProjectionEntityQueryBuilder() { assertEquals(DISTINCT_ON, PROJECTION_QUERY.getDistinctOn()); } - @Test - public void testProjectionEntityQueryBuilderDeprecated() { - compareBaseBuilderFieldsDeprecated(DEPRECATED_PROJECTION_QUERY); - assertEquals(PROJECTION, DEPRECATED_PROJECTION_QUERY.projection()); - assertEquals(DISTINCT_ON, DEPRECATED_PROJECTION_QUERY.distinctOn()); - } private void compareBaseBuilderFields(StructuredQuery query) { assertEquals(NAMESPACE, query.getNamespace()); @@ -171,16 +119,6 @@ private void compareBaseBuilderFields(StructuredQuery query) { assertEquals(ORDER_BY, query.getOrderBy()); } - private void compareBaseBuilderFieldsDeprecated(StructuredQuery query) { - assertEquals(NAMESPACE, query.getNamespace()); - assertEquals(KIND, query.kind()); - assertEquals(START_CURSOR, query.startCursor()); - assertEquals(END_CURSOR, query.endCursor()); - assertEquals(OFFSET, query.offset()); - assertEquals(LIMIT, query.limit()); - assertEquals(FILTER, query.filter()); - assertEquals(ORDER_BY, query.orderBy()); - } @Test public void mergeFrom() { diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/ValueTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/ValueTest.java index e36d69657b6d..f35675fd35c4 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/ValueTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/ValueTest.java @@ -120,12 +120,6 @@ public void testType() throws Exception { } } - @Test - public void testTypeDeprecated() throws Exception { - for (Map.Entry> entry : typeToValue.entrySet()) { - assertEquals(entry.getKey(), entry.getValue().type()); - } - } @Test public void testExcludeFromIndexes() throws Exception { @@ -138,16 +132,6 @@ public void testExcludeFromIndexes() throws Exception { assertFalse(builder.setExcludeFromIndexes(false).build().excludeFromIndexes()); } - @Test - public void testExcludeFromIndexesDeprecated() throws Exception { - for (Map.Entry> entry : typeToValue.entrySet()) { - assertFalse(entry.getValue().excludeFromIndexes()); - } - TestBuilder builder = new TestBuilder(); - assertFalse(builder.build().excludeFromIndexes()); - assertTrue(builder.excludeFromIndexes(true).build().excludeFromIndexes()); - assertFalse(builder.excludeFromIndexes(false).build().excludeFromIndexes()); - } @SuppressWarnings("deprecation") @Test @@ -156,11 +140,6 @@ public void testMeaning() throws Exception { assertEquals(10, builder.setMeaning(10).build().getMeaning()); } - @Test - public void testMeaningDeprecated() throws Exception { - TestBuilder builder = new TestBuilder(); - assertEquals(10, builder.meaning(10).build().meaning()); - } @Test public void testGet() throws Exception { diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/testing/LocalDatastoreHelperTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/testing/LocalDatastoreHelperTest.java index ef223decc898..06821fb35cbd 100644 --- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/testing/LocalDatastoreHelperTest.java +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/testing/LocalDatastoreHelperTest.java @@ -59,15 +59,6 @@ public void testCreate() { assertTrue(helper.getProjectId().startsWith(PROJECT_ID_PREFIX)); } - @Test - public void testCreateDeprecated() { - LocalDatastoreHelper helper = LocalDatastoreHelper.create(0.75); - assertTrue(Math.abs(0.75 - helper.consistency()) < TOLERANCE); - assertTrue(helper.projectId().startsWith(PROJECT_ID_PREFIX)); - helper = LocalDatastoreHelper.create(); - assertTrue(Math.abs(0.9 - helper.consistency()) < TOLERANCE); - assertTrue(helper.projectId().startsWith(PROJECT_ID_PREFIX)); - } @Test public void testOptions() { diff --git a/google-cloud-dns/src/main/java/com/google/cloud/dns/ChangeRequest.java b/google-cloud-dns/src/main/java/com/google/cloud/dns/ChangeRequest.java index 2c9a89732d6d..1f6e7b0b9538 100644 --- a/google-cloud-dns/src/main/java/com/google/cloud/dns/ChangeRequest.java +++ b/google-cloud-dns/src/main/java/com/google/cloud/dns/ChangeRequest.java @@ -54,11 +54,6 @@ private Builder(ChangeRequest cr) { this.infoBuilder = new ChangeRequestInfo.BuilderImpl(cr); } - @Override - @Deprecated - public Builder additions(List additions) { - return setAdditions(additions); - } @Override public Builder setAdditions(List additions) { @@ -66,11 +61,6 @@ public Builder setAdditions(List additions) { return this; } - @Override - @Deprecated - public Builder deletions(List deletions) { - return setDeletions(deletions); - } @Override public Builder setDeletions(List deletions) { @@ -145,13 +135,6 @@ public ChangeRequest build() { this.options = dns.getOptions(); } - /** - * Returns the name of the {@link Zone} associated with this change request. - */ - @Deprecated - public String zone() { - return getZone(); - } /** * Returns the name of the {@link Zone} associated with this change request. @@ -160,13 +143,6 @@ public String getZone() { return this.zone; } - /** - * Returns the change request's {@code Dns} object used to issue requests. - */ - @Deprecated - public Dns dns() { - return getDns(); - } /** * Returns the change request's {@code Dns} object used to issue requests. diff --git a/google-cloud-dns/src/main/java/com/google/cloud/dns/ChangeRequestInfo.java b/google-cloud-dns/src/main/java/com/google/cloud/dns/ChangeRequestInfo.java index 78a529c1e8e6..85306e2fa4f7 100644 --- a/google-cloud-dns/src/main/java/com/google/cloud/dns/ChangeRequestInfo.java +++ b/google-cloud-dns/src/main/java/com/google/cloud/dns/ChangeRequestInfo.java @@ -70,12 +70,6 @@ public enum Status { */ public abstract static class Builder { - /** - * Sets a collection of {@link RecordSet}s which are to be added to the zone upon executing this - * {@code ChangeRequestInfo}. - */ - @Deprecated - public abstract Builder additions(List additions); /** * Sets a collection of {@link RecordSet}s which are to be added to the zone upon executing this @@ -83,12 +77,6 @@ public abstract static class Builder { */ public abstract Builder setAdditions(List additions); - /** - * Sets a collection of {@link RecordSet}s which are to be deleted from the zone upon executing - * this {@code ChangeRequestInfo}. - */ - @Deprecated - public abstract Builder deletions(List deletions); /** * Sets a collection of {@link RecordSet}s which are to be deleted from the zone upon executing @@ -174,11 +162,6 @@ static class BuilderImpl extends Builder { this.status = info.status; } - @Override - @Deprecated - public Builder additions(List additions) { - return setAdditions(additions); - } @Override public Builder setAdditions(List additions) { @@ -186,11 +169,6 @@ public Builder setAdditions(List additions) { return this; } - @Override - @Deprecated - public Builder deletions(List deletions) { - return setDeletions(deletions); - } @Override public Builder setDeletions(List deletions) { @@ -266,13 +244,6 @@ Builder setStatus(ChangeRequestInfo.Status status) { this.status = builder.status; } - /** - * Returns an empty builder for the {@code ChangeRequestInfo} class. - */ - @Deprecated - public static Builder builder() { - return newBuilder(); - } /** * Returns an empty builder for the {@code ChangeRequestInfo} class. @@ -288,14 +259,6 @@ public Builder toBuilder() { return new BuilderImpl(this); } - /** - * Returns the list of {@link RecordSet}s to be added to the zone upon submitting this change - * request. - */ - @Deprecated - public List additions() { - return getAdditions(); - } /** * Returns the list of {@link RecordSet}s to be added to the zone upon submitting this change @@ -305,14 +268,6 @@ public List getAdditions() { return additions; } - /** - * Returns the list of {@link RecordSet}s to be deleted from the zone upon submitting this change - * request. - */ - @Deprecated - public List deletions() { - return getDeletions(); - } /** * Returns the list of {@link RecordSet}s to be deleted from the zone upon submitting this change @@ -322,13 +277,6 @@ public List getDeletions() { return deletions; } - /** - * Returns the service-generated id for this change request. - */ - @Deprecated - public String generatedId() { - return getGeneratedId(); - } /** * Returns the service-generated id for this change request. @@ -337,13 +285,6 @@ public String getGeneratedId() { return generatedId; } - /** - * Returns the time when this change request was started by the server. - */ - @Deprecated - public Long startTimeMillis() { - return getStartTimeMillis(); - } /** * Returns the time when this change request was started by the server. diff --git a/google-cloud-dns/src/main/java/com/google/cloud/dns/Dns.java b/google-cloud-dns/src/main/java/com/google/cloud/dns/Dns.java index cbeb308b3a73..e4ea35be23b9 100644 --- a/google-cloud-dns/src/main/java/com/google/cloud/dns/Dns.java +++ b/google-cloud-dns/src/main/java/com/google/cloud/dns/Dns.java @@ -52,11 +52,6 @@ enum ProjectField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } @Override public String getSelector() { @@ -88,11 +83,6 @@ enum ZoneField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } @Override public String getSelector() { @@ -121,11 +111,6 @@ enum RecordSetField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } @Override public String getSelector() { @@ -155,11 +140,6 @@ enum ChangeRequestField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } @Override public String getSelector() { diff --git a/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsImpl.java b/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsImpl.java index c98ae4313ca6..aadcb0085b83 100644 --- a/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsImpl.java +++ b/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsImpl.java @@ -57,11 +57,6 @@ static class ZonePageFetcher implements PageImpl.NextPageFetcher { this.serviceOptions = serviceOptions; } - @Override - @Deprecated - public Page nextPage() { - return getNextPage(); - } @Override public Page getNextPage() { @@ -84,11 +79,6 @@ static class ChangeRequestPageFetcher implements PageImpl.NextPageFetcher nextPage() { - return getNextPage(); - } @Override public Page getNextPage() { @@ -111,11 +101,6 @@ static class RecordSetPageFetcher implements PageImpl.NextPageFetcher this.serviceOptions = serviceOptions; } - @Override - @Deprecated - public Page nextPage() { - return getNextPage(); - } @Override public Page getNextPage() { diff --git a/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsOptions.java b/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsOptions.java index 50d735209a54..9121fc1d2da7 100644 --- a/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsOptions.java +++ b/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsOptions.java @@ -90,23 +90,11 @@ public Builder toBuilder() { return new Builder(this); } - @Deprecated - public static Builder builder() { - return newBuilder(); - } public static Builder newBuilder() { return new Builder(); } - /** - * Creates a default instance of {@code DnsOptions} with the project ID and credentials inferred - * from the environment. - */ - @Deprecated - public static DnsOptions defaultInstance() { - return getDefaultInstance(); - } /** * Creates a default instance of {@code DnsOptions} with the project ID and credentials inferred diff --git a/google-cloud-dns/src/main/java/com/google/cloud/dns/ProjectInfo.java b/google-cloud-dns/src/main/java/com/google/cloud/dns/ProjectInfo.java index cf49fada0b77..a5ace1c24946 100644 --- a/google-cloud-dns/src/main/java/com/google/cloud/dns/ProjectInfo.java +++ b/google-cloud-dns/src/main/java/com/google/cloud/dns/ProjectInfo.java @@ -76,13 +76,6 @@ public static class Quota implements Serializable { this.totalRrdataSizePerChange = totalRrdataSizePerChange; } - /** - * Returns the maximum allowed number of zones in the project. - */ - @Deprecated - public int zones() { - return getZones(); - } /** * Returns the maximum allowed number of zones in the project. @@ -91,13 +84,6 @@ public int getZones() { return zones; } - /** - * Returns the maximum allowed number of records per {@link RecordSet}. - */ - @Deprecated - public int resourceRecordsPerRrset() { - return getResourceRecordsPerRrset(); - } /** * Returns the maximum allowed number of records per {@link RecordSet}. @@ -106,14 +92,6 @@ public int getResourceRecordsPerRrset() { return resourceRecordsPerRrset; } - /** - * Returns the maximum allowed number of {@link RecordSet}s to add per {@link - * ChangeRequest}. - */ - @Deprecated - public int rrsetAdditionsPerChange() { - return getRrsetAdditionsPerChange(); - } /** * Returns the maximum allowed number of {@link RecordSet}s to add per {@link @@ -123,14 +101,6 @@ public int getRrsetAdditionsPerChange() { return rrsetAdditionsPerChange; } - /** - * Returns the maximum allowed number of {@link RecordSet}s to delete per {@link - * ChangeRequest}. - */ - @Deprecated - public int rrsetDeletionsPerChange() { - return getRrsetDeletionsPerChange(); - } /** * Returns the maximum allowed number of {@link RecordSet}s to delete per {@link @@ -140,14 +110,6 @@ public int getRrsetDeletionsPerChange() { return rrsetDeletionsPerChange; } - /** - * Returns the maximum allowed number of {@link RecordSet}s per {@link ZoneInfo} in the - * project. - */ - @Deprecated - public int rrsetsPerZone() { - return getRrsetsPerZone(); - } /** * Returns the maximum allowed number of {@link RecordSet}s per {@link ZoneInfo} in the @@ -157,13 +119,6 @@ public int getRrsetsPerZone() { return rrsetsPerZone; } - /** - * Returns the maximum allowed size for total records in one ChangesRequest in bytes. - */ - @Deprecated - public int totalRrdataSizePerChange() { - return getTotalRrdataSizePerChange(); - } /** * Returns the maximum allowed size for total records in one ChangesRequest in bytes. @@ -273,13 +228,6 @@ static Builder newBuilder() { return new Builder(); } - /** - * Returns the {@code Quota} object which contains quotas assigned to this project. - */ - @Deprecated - public Quota quota() { - return getQuota(); - } /** * Returns the {@code Quota} object which contains quotas assigned to this project. @@ -295,13 +243,6 @@ BigInteger getNumber() { return number; } - /** - * Returns project id. For internal use only. - */ - @Deprecated - String id() { - return getId(); - } /** * Returns project id. For internal use only. diff --git a/google-cloud-dns/src/main/java/com/google/cloud/dns/RecordSet.java b/google-cloud-dns/src/main/java/com/google/cloud/dns/RecordSet.java index 5e6a47028ede..cc82d9f52e83 100644 --- a/google-cloud-dns/src/main/java/com/google/cloud/dns/RecordSet.java +++ b/google-cloud-dns/src/main/java/com/google/cloud/dns/RecordSet.java @@ -177,13 +177,6 @@ public Builder clearRecords() { return this; } - /** - * Replaces the current records with the provided list of records. - */ - @Deprecated - public Builder records(List records) { - return setRecords(records); - } /** * Replaces the current records with the provided list of records. @@ -193,13 +186,6 @@ public Builder setRecords(List records) { return this; } - /** - * Sets the name for this record set. For example, www.example.com. - */ - @Deprecated - public Builder name(String name) { - return setName(name); - } /** * Sets the name for this record set. For example, www.example.com. @@ -209,17 +195,6 @@ public Builder setName(String name) { return this; } - /** - * Sets the time that this record can be cached by resolvers. This number must be non-negative. - * The maximum duration must be equivalent to at most {@link Integer#MAX_VALUE} seconds. - * - * @param duration A non-negative number of time units - * @param unit The unit of the ttl parameter - */ - @Deprecated - public Builder ttl(int duration, TimeUnit unit) { - return setTtl(duration, unit); - } /** * Sets the time that this record can be cached by resolvers. This number must be non-negative. @@ -238,13 +213,6 @@ public Builder setTtl(int duration, TimeUnit unit) { return this; } - /** - * The identifier of a supported record type, for example, A, AAAA, MX, TXT, and so on. - */ - @Deprecated - public Builder type(Type type) { - return setType(type); - } /** * The identifier of a supported record type, for example, A, AAAA, MX, TXT, and so on. @@ -276,13 +244,6 @@ public Builder toBuilder() { return new Builder(this); } - /** - * Creates a {@code RecordSet} builder for the given {@code name} and {@code type}. - */ - @Deprecated - public static Builder builder(String name, Type type) { - return newBuilder(name, type); - } /** * Creates a {@code RecordSet} builder for the given {@code name} and {@code type}. @@ -291,13 +252,6 @@ public static Builder newBuilder(String name, Type type) { return new Builder(name, type); } - /** - * Returns the user-assigned name of this record set. - */ - @Deprecated - public String name() { - return getName(); - } /** * Returns the user-assigned name of this record set. @@ -306,13 +260,6 @@ public String getName() { return name; } - /** - * Returns a list of records stored in this record set. - */ - @Deprecated - public List records() { - return getRecords(); - } /** * Returns a list of records stored in this record set. @@ -321,13 +268,6 @@ public List getRecords() { return rrdatas; } - /** - * Returns the number of seconds that this record set can be cached by resolvers. - */ - @Deprecated - public Integer ttl() { - return getTtl(); - } /** * Returns the number of seconds that this record set can be cached by resolvers. @@ -336,13 +276,6 @@ public Integer getTtl() { return ttl; } - /** - * Returns the type of this record set. - */ - @Deprecated - public Type type() { - return getType(); - } /** * Returns the type of this record set. diff --git a/google-cloud-dns/src/main/java/com/google/cloud/dns/Zone.java b/google-cloud-dns/src/main/java/com/google/cloud/dns/Zone.java index 80c4f7c5daae..4dbbfc7b1b3e 100644 --- a/google-cloud-dns/src/main/java/com/google/cloud/dns/Zone.java +++ b/google-cloud-dns/src/main/java/com/google/cloud/dns/Zone.java @@ -55,11 +55,6 @@ private Builder(Zone zone) { this.infoBuilder = new ZoneInfo.BuilderImpl(zone); } - @Override - @Deprecated - public Builder name(String name) { - return setName(name); - } @Override public Builder setName(String name) { @@ -79,11 +74,6 @@ Builder setCreationTimeMillis(long creationTimeMillis) { return this; } - @Override - @Deprecated - public Builder dnsName(String dnsName) { - return setDnsName(dnsName); - } @Override public Builder setDnsName(String dnsName) { @@ -91,11 +81,6 @@ public Builder setDnsName(String dnsName) { return this; } - @Override - @Deprecated - public Builder description(String description) { - return setDescription(description); - } @Override public Builder setDescription(String description) { @@ -206,13 +191,6 @@ public Page listChangeRequests(Dns.ChangeRequestListOption... opt return dns.listChangeRequests(getName(), options); } - /** - * Returns the {@link Dns} service object associated with this zone. - */ - @Deprecated - public Dns dns() { - return getDns(); - } /** * Returns the {@link Dns} service object associated with this zone. diff --git a/google-cloud-dns/src/main/java/com/google/cloud/dns/ZoneInfo.java b/google-cloud-dns/src/main/java/com/google/cloud/dns/ZoneInfo.java index c4e494d33f09..b648c527097e 100644 --- a/google-cloud-dns/src/main/java/com/google/cloud/dns/ZoneInfo.java +++ b/google-cloud-dns/src/main/java/com/google/cloud/dns/ZoneInfo.java @@ -52,11 +52,6 @@ public class ZoneInfo implements Serializable { * Builder for {@code ZoneInfo}. */ public abstract static class Builder { - /** - * Sets a mandatory user-provided name for the zone. It must be unique within the project. - */ - @Deprecated - public abstract Builder name(String name); /** * Sets a mandatory user-provided name for the zone. It must be unique within the project. @@ -73,23 +68,12 @@ public abstract static class Builder { */ abstract Builder setCreationTimeMillis(long creationTimeMillis); - /** - * Sets a mandatory DNS name of this zone, for instance "example.com.". - */ - @Deprecated - public abstract Builder dnsName(String dnsName); /** * Sets a mandatory DNS name of this zone, for instance "example.com.". */ public abstract Builder setDnsName(String dnsName); - /** - * Sets a mandatory description for this zone. The value is a string of at most 1024 characters - * which has no effect on the zone's function. - */ - @Deprecated - public abstract Builder description(String description); /** * Sets a mandatory description for this zone. The value is a string of at most 1024 characters @@ -144,11 +128,6 @@ private BuilderImpl(String name) { } } - @Override - @Deprecated - public Builder name(String name) { - return setName(name); - } @Override public Builder setName(String name) { @@ -168,11 +147,6 @@ Builder setCreationTimeMillis(long creationTimeMillis) { return this; } - @Override - @Deprecated - public Builder dnsName(String dnsName) { - return setDnsName(dnsName); - } @Override public Builder setDnsName(String dnsName) { @@ -180,11 +154,6 @@ public Builder setDnsName(String dnsName) { return this; } - @Override - @Deprecated - public Builder description(String description) { - return setDescription(description); - } @Override public Builder setDescription(String description) { @@ -229,13 +198,6 @@ public static ZoneInfo of(String name, String dnsName, String description) { return new BuilderImpl(name).setDnsName(dnsName).setDescription(description).build(); } - /** - * Returns the user-defined name of the zone. - */ - @Deprecated - public String name() { - return getName(); - } /** * Returns the user-defined name of the zone. @@ -244,13 +206,6 @@ public String getName() { return name; } - /** - * Returns the service-generated id for this zone. - */ - @Deprecated - public String generatedId() { - return getGeneratedId(); - } /** * Returns the service-generated id for this zone. @@ -259,13 +214,6 @@ public String getGeneratedId() { return generatedId; } - /** - * Returns the time when this zone was created on the server. - */ - @Deprecated - public Long creationTimeMillis() { - return getCreationTimeMillis(); - } /** * Returns the time when this zone was created on the server. @@ -274,13 +222,6 @@ public Long getCreationTimeMillis() { return creationTimeMillis; } - /** - * Returns the DNS name of this zone, for instance "example.com.". - */ - @Deprecated - public String dnsName() { - return getDnsName(); - } /** * Returns the DNS name of this zone, for instance "example.com.". @@ -289,13 +230,6 @@ public String getDnsName() { return dnsName; } - /** - * Returns the description of this zone. - */ - @Deprecated - public String description() { - return getDescription(); - } /** * Returns the description of this zone. @@ -304,14 +238,6 @@ public String getDescription() { return description; } - /** - * Returns the optionally specified set of DNS name servers that all host this zone. This value is - * set only for specific use cases and is left empty for vast majority of users. - */ - @Deprecated - public String nameServerSet() { - return getNameServerSet(); - } /** * Returns the optionally specified set of DNS name servers that all host this zone. This value is @@ -321,13 +247,6 @@ public String getNameServerSet() { return nameServerSet; } - /** - * The nameservers that the zone should be delegated to. This is defined by the Google DNS cloud. - */ - @Deprecated - public List nameServers() { - return getNameServers(); - } /** * The nameservers that the zone should be delegated to. This is defined by the Google DNS cloud. diff --git a/google-cloud-dns/src/test/java/com/google/cloud/dns/ChangeRequestInfoTest.java b/google-cloud-dns/src/test/java/com/google/cloud/dns/ChangeRequestInfoTest.java index 9632ac475c09..691ad94cd71a 100644 --- a/google-cloud-dns/src/test/java/com/google/cloud/dns/ChangeRequestInfoTest.java +++ b/google-cloud-dns/src/test/java/com/google/cloud/dns/ChangeRequestInfoTest.java @@ -54,14 +54,6 @@ public class ChangeRequestInfoTest { .setStatus(STATUS) .setGeneratedId(GENERATED_ID) .build(); - private static final ChangeRequestInfo DEPRECATED_CHANGE = ChangeRequest.builder() - .add(RECORD1) - .add(RECORD2) - .delete(RECORD3) - .setStartTime(START_TIME_MILLIS) - .setStatus(STATUS) - .setGeneratedId(GENERATED_ID) - .build(); @Test public void testEmptyBuilder() { @@ -72,14 +64,6 @@ public void testEmptyBuilder() { assertTrue(cr.getAdditions().isEmpty()); } - @Test - public void testEmptyBuilderDeprecated() { - ChangeRequestInfo cr = ChangeRequest.builder().build(); - assertNotNull(cr.deletions()); - assertTrue(cr.deletions().isEmpty()); - assertNotNull(cr.additions()); - assertTrue(cr.additions().isEmpty()); - } @Test public void testBuilder() { @@ -97,21 +81,6 @@ public void testBuilder() { assertEquals(CHANGE.getAdditions(), another.getAdditions()); } - @Test - public void testBuilderDeprecated() { - assertEquals(GENERATED_ID, DEPRECATED_CHANGE.generatedId()); - assertEquals(STATUS, DEPRECATED_CHANGE.status()); - assertEquals(START_TIME_MILLIS, DEPRECATED_CHANGE.startTimeMillis()); - assertEquals(ADDITIONS, DEPRECATED_CHANGE.additions()); - assertEquals(DELETIONS, DEPRECATED_CHANGE.deletions()); - List recordList = ImmutableList.of(RECORD1); - ChangeRequestInfo another = DEPRECATED_CHANGE.toBuilder().additions(recordList).build(); - assertEquals(recordList, another.additions()); - assertEquals(DEPRECATED_CHANGE.deletions(), another.deletions()); - another = DEPRECATED_CHANGE.toBuilder().deletions(recordList).build(); - assertEquals(recordList, another.deletions()); - assertEquals(DEPRECATED_CHANGE.additions(), another.additions()); - } @Test public void testEqualsAndNotEquals() { diff --git a/google-cloud-dns/src/test/java/com/google/cloud/dns/ChangeRequestTest.java b/google-cloud-dns/src/test/java/com/google/cloud/dns/ChangeRequestTest.java index 5a3347890c00..22fed8aa95b7 100644 --- a/google-cloud-dns/src/test/java/com/google/cloud/dns/ChangeRequestTest.java +++ b/google-cloud-dns/src/test/java/com/google/cloud/dns/ChangeRequestTest.java @@ -85,17 +85,6 @@ public void testConstructor() { assertEquals(ZONE_NAME, changeRequestPartial.getZone()); } - @Test - public void testConstructorDeprecated() { - expect(dns.getOptions()).andReturn(OPTIONS); - replay(dns); - assertEquals(new ChangeRequest(dns, ZONE_NAME, - new ChangeRequestInfo.BuilderImpl(CHANGE_REQUEST_INFO)), changeRequestPartial); - assertNotNull(changeRequest.dns()); - assertEquals(ZONE_NAME, changeRequest.zone()); - assertSame(dns, changeRequestPartial.dns()); - assertEquals(ZONE_NAME, changeRequestPartial.zone()); - } @Test public void testFromPb() { @@ -146,32 +135,6 @@ public void testBuilder() { assertEquals(Long.valueOf(0), modified.getStartTimeMillis()); } - @Test - public void testBuilderDeprecated() { - // one for each build() call because it invokes a constructor - expect(dns.getOptions()).andReturn(OPTIONS).times(9); - replay(dns); - String id = changeRequest.generatedId() + "aaa"; - assertEquals(id, changeRequest.toBuilder().setGeneratedId(id).build().generatedId()); - ChangeRequest modified = - changeRequest.toBuilder().setStatus(ChangeRequest.Status.PENDING).build(); - assertEquals(ChangeRequest.Status.PENDING, modified.status()); - modified = changeRequest.toBuilder().clearDeletions().build(); - assertTrue(modified.deletions().isEmpty()); - modified = changeRequest.toBuilder().clearAdditions().build(); - assertTrue(modified.additions().isEmpty()); - modified = changeRequest.toBuilder().additions(ImmutableList.of()).build(); - assertTrue(modified.additions().isEmpty()); - modified = changeRequest.toBuilder().deletions(ImmutableList.of()).build(); - assertTrue(modified.deletions().isEmpty()); - RecordSet cname = RecordSet.builder("last", RecordSet.Type.CNAME).build(); - modified = changeRequest.toBuilder().add(cname).build(); - assertTrue(modified.additions().contains(cname)); - modified = changeRequest.toBuilder().delete(cname).build(); - assertTrue(modified.deletions().contains(cname)); - modified = changeRequest.toBuilder().setStartTime(0L).build(); - assertEquals(Long.valueOf(0), modified.startTimeMillis()); - } @Test public void testApplyTo() { diff --git a/google-cloud-dns/src/test/java/com/google/cloud/dns/ProjectInfoTest.java b/google-cloud-dns/src/test/java/com/google/cloud/dns/ProjectInfoTest.java index 1bef06d2d705..2b555cb0da09 100644 --- a/google-cloud-dns/src/test/java/com/google/cloud/dns/ProjectInfoTest.java +++ b/google-cloud-dns/src/test/java/com/google/cloud/dns/ProjectInfoTest.java @@ -51,24 +51,6 @@ public void testBuilder() { assertEquals(ID, PROJECT_INFO.getId()); } - @Test - public void testBuilderDeprecated() { - ProjectInfo withId = ProjectInfo.newBuilder().setId(ID).build(); - assertEquals(ID, withId.id()); - assertNull(withId.getNumber()); - assertNull(withId.quota()); - ProjectInfo withNumber = ProjectInfo.newBuilder().setNumber(NUMBER).build(); - assertEquals(NUMBER, withNumber.getNumber()); - assertNull(withNumber.quota()); - assertNull(withNumber.id()); - ProjectInfo withQuota = ProjectInfo.newBuilder().setQuota(QUOTA).build(); - assertEquals(QUOTA, withQuota.quota()); - assertNull(withQuota.id()); - assertNull(withQuota.getNumber()); - assertEquals(QUOTA, PROJECT_INFO.quota()); - assertEquals(NUMBER, PROJECT_INFO.getNumber()); - assertEquals(ID, PROJECT_INFO.id()); - } @Test public void testQuotaConstructor() { @@ -80,15 +62,6 @@ public void testQuotaConstructor() { assertEquals(6, QUOTA.getTotalRrdataSizePerChange()); } - @Test - public void testQuotaConstructorDeprecated() { - assertEquals(1, QUOTA.zones()); - assertEquals(2, QUOTA.resourceRecordsPerRrset()); - assertEquals(3, QUOTA.rrsetAdditionsPerChange()); - assertEquals(4, QUOTA.rrsetDeletionsPerChange()); - assertEquals(5, QUOTA.rrsetsPerZone()); - assertEquals(6, QUOTA.totalRrdataSizePerChange()); - } @Test public void testEqualsAndNotEqualsQuota() { diff --git a/google-cloud-dns/src/test/java/com/google/cloud/dns/RecordSetTest.java b/google-cloud-dns/src/test/java/com/google/cloud/dns/RecordSetTest.java index 2200e7844302..5150539c2352 100644 --- a/google-cloud-dns/src/test/java/com/google/cloud/dns/RecordSetTest.java +++ b/google-cloud-dns/src/test/java/com/google/cloud/dns/RecordSetTest.java @@ -35,9 +35,6 @@ public class RecordSetTest { private static final RecordSet RECORD_SET = RecordSet.newBuilder(NAME, TYPE) .setTtl(UNIT_TTL, UNIT) .build(); - private static final RecordSet DEPRECATED_RECORD_SET = RecordSet.builder(NAME, TYPE) - .ttl(UNIT_TTL, UNIT) - .build(); @Test public void testDefaultDnsRecord() { @@ -47,13 +44,6 @@ public void testDefaultDnsRecord() { assertEquals(NAME, recordSet.getName()); } - @Test - public void testDefaultDnsRecordDeprecated() { - RecordSet recordSet = RecordSet.builder(NAME, TYPE).build(); - assertEquals(0, recordSet.records().size()); - assertEquals(TYPE, recordSet.type()); - assertEquals(NAME, recordSet.name()); - } @Test public void testBuilder() { @@ -73,23 +63,6 @@ public void testBuilder() { assertTrue(anotherRecord.getRecords().contains(anotherTestingRecord)); } - @Test - public void testBuilderDeprecated() { - assertEquals(NAME, DEPRECATED_RECORD_SET.name()); - assertEquals(TTL, DEPRECATED_RECORD_SET.ttl()); - assertEquals(TYPE, DEPRECATED_RECORD_SET.type()); - assertEquals(0, DEPRECATED_RECORD_SET.records().size()); - // verify that one can add records to the record set - String testingRecord = "Testing recordSet"; - String anotherTestingRecord = "Another recordSet 123"; - RecordSet anotherRecord = RECORD_SET.toBuilder() - .addRecord(testingRecord) - .addRecord(anotherTestingRecord) - .build(); - assertEquals(2, anotherRecord.records().size()); - assertTrue(anotherRecord.records().contains(testingRecord)); - assertTrue(anotherRecord.records().contains(anotherTestingRecord)); - } @Test public void testValidTtl() { @@ -111,25 +84,6 @@ public void testValidTtl() { assertEquals(TTL, record.getTtl()); } - @Test - public void testValidTtlDeprecated() { - try { - RecordSet.builder(NAME, TYPE).ttl(-1, TimeUnit.SECONDS); - fail("A negative value is not acceptable for ttl."); - } catch (IllegalArgumentException e) { - // expected - } - RecordSet.builder(NAME, TYPE).ttl(0, TimeUnit.SECONDS); - RecordSet.builder(NAME, TYPE).ttl(Integer.MAX_VALUE, TimeUnit.SECONDS); - try { - RecordSet.builder(NAME, TYPE).ttl(Integer.MAX_VALUE, TimeUnit.HOURS); - fail("This value is too large for int."); - } catch (IllegalArgumentException e) { - // expected - } - RecordSet record = RecordSet.builder(NAME, TYPE).ttl(UNIT_TTL, UNIT).build(); - assertEquals(TTL, record.ttl()); - } @Test public void testEqualsAndNotEquals() { diff --git a/google-cloud-dns/src/test/java/com/google/cloud/dns/ZoneInfoTest.java b/google-cloud-dns/src/test/java/com/google/cloud/dns/ZoneInfoTest.java index 7de2cdac1d57..a59d22b8ba6a 100644 --- a/google-cloud-dns/src/test/java/com/google/cloud/dns/ZoneInfoTest.java +++ b/google-cloud-dns/src/test/java/com/google/cloud/dns/ZoneInfoTest.java @@ -75,19 +75,6 @@ public void testBuilder() { assertEquals(DNS_NAME, INFO.getDnsName()); } - @Test - public void testBuilderDeprecated() { - assertEquals(3, INFO.nameServers().size()); - assertEquals(NS1, INFO.nameServers().get(0)); - assertEquals(NS2, INFO.nameServers().get(1)); - assertEquals(NS3, INFO.nameServers().get(2)); - assertEquals(NAME, INFO.name()); - assertEquals(GENERATED_ID, INFO.generatedId()); - assertEquals(CREATION_TIME_MILLIS, INFO.creationTimeMillis()); - assertEquals(NAME_SERVER_SET, INFO.nameServerSet()); - assertEquals(DESCRIPTION, INFO.description()); - assertEquals(DNS_NAME, INFO.dnsName()); - } @Test public void testEqualsAndNotEquals() { diff --git a/google-cloud-dns/src/test/java/com/google/cloud/dns/ZoneTest.java b/google-cloud-dns/src/test/java/com/google/cloud/dns/ZoneTest.java index f4f73a0ffbe8..0514b1fc7e6a 100644 --- a/google-cloud-dns/src/test/java/com/google/cloud/dns/ZoneTest.java +++ b/google-cloud-dns/src/test/java/com/google/cloud/dns/ZoneTest.java @@ -97,13 +97,6 @@ public void testConstructor() { assertEquals(dns, zone.getDns()); } - @Test - public void testConstructorDeprecated() { - replay(dns); - assertEquals(ZONE_INFO.toPb(), zone.toPb()); - assertNotNull(zone.dns()); - assertEquals(dns, zone.dns()); - } @Test public void deleteByNameAndFound() { @@ -512,26 +505,5 @@ public void testBuilder() { .build(); assertEquals(zone, builder.build()); } - - @Test - public void testBuilderDeprecated() { - // one for each build() call because it invokes a constructor - expect(dns.getOptions()).andReturn(OPTIONS).times(8); - replay(dns); - assertNotEquals(zone, zone.toBuilder() - .setGeneratedId(new BigInteger(zone.generatedId()).add(BigInteger.ONE).toString()) - .build()); - assertNotEquals(zone, zone.toBuilder().dnsName(zone.name() + "aaaa").build()); - assertNotEquals(zone, zone.toBuilder().setNameServerSet(zone.nameServerSet() + "aaaa").build()); - assertNotEquals(zone, zone.toBuilder().setNameServers(ImmutableList.of("nameserverpppp")).build()); - assertNotEquals(zone, zone.toBuilder().dnsName(zone.dnsName() + "aaaa").build()); - assertNotEquals(zone, zone.toBuilder().setCreationTimeMillis(zone.creationTimeMillis() + 1) - .build()); - Zone.Builder builder = zone.toBuilder(); - builder.setGeneratedId(ZONE_ID) - .dnsName("example.com") - .setCreationTimeMillis(123478946464L) - .build(); - assertEquals(zone, builder.build()); - } } + diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/datastore/snippets/QuerySnippets.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/datastore/snippets/QuerySnippets.java index 878a21629934..8400d436c605 100644 --- a/google-cloud-examples/src/main/java/com/google/cloud/examples/datastore/snippets/QuerySnippets.java +++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/datastore/snippets/QuerySnippets.java @@ -55,20 +55,6 @@ public QueryResults newQuery(String kind) { return results; } - /** - * Example of creating and running a GQL query. - */ - // [TARGET gqlQueryBuilder(String)] - // [VARIABLE "my_kind"] - public QueryResults newQueryDeprecated(String kind) { - // [START newQueryDeprecated] - String gqlQuery = "select * from " + kind; - Query query = Query.gqlQueryBuilder(gqlQuery).build(); - QueryResults results = datastore.run(query); - // Use results - // [END newQueryDeprecated] - return results; - } /** * Example of creating and running a typed GQL query. @@ -85,20 +71,6 @@ public QueryResults newTypedQuery(String kind) { return results; } - /** - * Example of creating and running a typed GQL query. - */ - // [TARGET gqlQueryBuilder(ResultType, String)] - // [VARIABLE "my_kind"] - public QueryResults newTypedQueryDeprecated(String kind) { - // [START newTypedQueryDeprecated] - String gqlQuery = "select * from " + kind; - Query query = Query.gqlQueryBuilder(Query.ResultType.ENTITY, gqlQuery).build(); - QueryResults results = datastore.run(query); - // Use results - // [END newTypedQueryDeprecated] - return results; - } /** * Example of creating and running an entity query. @@ -114,19 +86,6 @@ public QueryResults newEntityQuery(String kind) { return results; } - /** - * Example of creating and running an entity query. - */ - // [TARGET entityQueryBuilder()] - // [VARIABLE "my_kind"] - public QueryResults newEntityQueryDeprecated(String kind) { - // [START newEntityQueryDeprecated] - Query query = Query.entityQueryBuilder().setKind(kind).build(); - QueryResults results = datastore.run(query); - // Use results - // [END newEntityQueryDeprecated] - return results; - } /** * Example of creating and running a key query. @@ -142,19 +101,6 @@ public QueryResults newKeyQuery(String kind) { return results; } - /** - * Example of creating and running a key query. - */ - // [TARGET keyQueryBuilder()] - // [VARIABLE "my_kind"] - public QueryResults newKeyQueryDeprecated(String kind) { - // [START newKeyQueryDeprecated] - Query query = Query.keyQueryBuilder().setKind(kind).build(); - QueryResults results = datastore.run(query); - // Use results - // [END newKeyQueryDeprecated] - return results; - } /** * Example of creating and running a projection entity query. @@ -173,23 +119,5 @@ public QueryResults newProjectionEntityQuery(String kind, Stri // [END newProjectionEntityQuery] return results; } - - /** - * Example of creating and running a projection entity query. - */ - // [TARGET projectionEntityQueryBuilder()] - // [VARIABLE "my_kind"] - // [VARIABLE "my_property"] - public QueryResults newProjectionEntityQueryDeprecated(String kind, - String property) { - // [START newProjectionEntityQuery] - Query query = Query.projectionEntityQueryBuilder() - .setKind(kind) - .addProjection(property) - .build(); - QueryResults results = datastore.run(query); - // Use results - // [END newProjectionEntityQuery] - return results; - } } + diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/datastore/snippets/TransactionSnippets.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/datastore/snippets/TransactionSnippets.java index 7f448a9fbda4..5f726e47568f 100644 --- a/google-cloud-examples/src/main/java/com/google/cloud/examples/datastore/snippets/TransactionSnippets.java +++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/datastore/snippets/TransactionSnippets.java @@ -369,8 +369,8 @@ public Key active() { transaction.commit(); } finally { // if committing succeeded - // then transaction.active() will be false - if (transaction.active()) { + // then transaction.isActive() will be false + if (transaction.isActive()) { // otherwise it's true and we need to rollback transaction.rollback(); } diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/PublisherSnippets.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/PublisherSnippets.java index f7d25e2728b0..6f431d6277f1 100644 --- a/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/PublisherSnippets.java +++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/PublisherSnippets.java @@ -19,7 +19,6 @@ * This file is referenced in Publisher's javadoc. Any change to this file should be reflected in * Publisher's javadoc. */ - package com.google.cloud.examples.pubsub.snippets; import com.google.api.gax.core.ApiFuture; diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/BlobSnippets.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/BlobSnippets.java index 8767aa9daaf1..903b75f7a6eb 100644 --- a/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/BlobSnippets.java +++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/BlobSnippets.java @@ -75,7 +75,7 @@ public boolean exists() { /** * Example of reading all bytes of the blob, if its generation matches the - * {@link Blob#generation()} value, otherwise a {@link StorageException} is thrown. + * {@link Blob#getGeneration()} value, otherwise a {@link StorageException} is thrown. */ // [TARGET getContent(BlobSourceOption...)] public byte[] getContent() { @@ -87,7 +87,7 @@ public byte[] getContent() { /** * Example of getting the blob's latest information, if its generation does not match the - * {@link Blob#generation()} value, otherwise a {@link StorageException} is thrown. + * {@link Blob#getGeneration()} value, otherwise a {@link StorageException} is thrown. */ // [TARGET reload(BlobSourceOption...)] public Blob reload() { @@ -115,7 +115,7 @@ public Blob update() { } /** - * Example of deleting the blob, if its generation matches the {@link Blob#generation()} value, + * Example of deleting the blob, if its generation matches the {@link Blob#getGeneration()} value, * otherwise a {@link StorageException} is thrown. */ // [TARGET delete(BlobSourceOption...)] diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/BucketSnippets.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/BucketSnippets.java index eab4b3a1e788..438341132da3 100644 --- a/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/BucketSnippets.java +++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/BucketSnippets.java @@ -68,7 +68,7 @@ public boolean exists() { /** * Example of getting the bucket's latest information, if its generation does not match the - * {@link Bucket#metageneration()} value, otherwise a {@link StorageException} is thrown. + * {@link Bucket#getMetageneration()} value, otherwise a {@link StorageException} is thrown. */ // [TARGET reload(BucketSourceOption...)] public Bucket reload() { @@ -94,7 +94,7 @@ public Bucket update() { /** * Example of deleting the bucket, if its metageneration matches the - * {@link Bucket#metageneration()} value, otherwise a {@link StorageException} is thrown. + * {@link Bucket#getMetageneration()} value, otherwise a {@link StorageException} is thrown. */ // [TARGET delete(BucketSourceOption...)] public boolean delete() { diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java index 6cb8099fe0f6..547689b96f80 100644 --- a/google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java +++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/translate/TranslateExample.java @@ -42,7 +42,7 @@ * translate +"} * *

The first parameter is an optional {@code targetLanguage}. If the target language is not - * supplied, {@code en} is used (see {@link TranslateOptions.Builder#setTargetLanguage(String)}). + * supplied, {@code en} is used (see {@link com.google.cloud.translate.TranslateOptions.Builder#setTargetLanguage(String)}). */ public class TranslateExample { diff --git a/google-cloud-examples/src/test/java/com/google/cloud/examples/datastore/snippets/ITQuerySnippets.java b/google-cloud-examples/src/test/java/com/google/cloud/examples/datastore/snippets/ITQuerySnippets.java index ca410b49e711..5ee22816c9c2 100644 --- a/google-cloud-examples/src/test/java/com/google/cloud/examples/datastore/snippets/ITQuerySnippets.java +++ b/google-cloud-examples/src/test/java/com/google/cloud/examples/datastore/snippets/ITQuerySnippets.java @@ -78,16 +78,6 @@ public void testNewQuery() throws InterruptedException { } } - @Test - public void testNewQueryDeprecated() throws InterruptedException { - QuerySnippets transactionSnippets = new QuerySnippets(datastore); - QueryResults results = transactionSnippets.newQueryDeprecated(KIND); - Set resultSet = Sets.newHashSet(results); - while (!resultSet.contains(entity1) || !resultSet.contains(entity2)) { - Thread.sleep(500); - resultSet = Sets.newHashSet(results); - } - } @Test public void testNewTypedQuery() throws InterruptedException { @@ -100,16 +90,6 @@ public void testNewTypedQuery() throws InterruptedException { } } - @Test - public void testNewTypedQueryDeprecated() throws InterruptedException { - QuerySnippets transactionSnippets = new QuerySnippets(datastore); - QueryResults results = transactionSnippets.newTypedQueryDeprecated(KIND); - Set resultSet = Sets.newHashSet(results); - while (!resultSet.contains(entity1) || !resultSet.contains(entity2)) { - Thread.sleep(500); - resultSet = Sets.newHashSet(results); - } - } @Test public void testNewEntityQuery() throws InterruptedException { @@ -133,16 +113,6 @@ public void testNewKeyQuery() throws InterruptedException { } } - @Test - public void testNewKeyQueryDeprecated() throws InterruptedException { - QuerySnippets transactionSnippets = new QuerySnippets(datastore); - QueryResults results = transactionSnippets.newKeyQueryDeprecated(KIND); - Set resultSet = Sets.newHashSet(results); - while (!resultSet.contains(entity1.getKey()) || !resultSet.contains(entity2.getKey())) { - Thread.sleep(500); - resultSet = Sets.newHashSet(results); - } - } @Test public void testNewProjectionEntityQuery() throws InterruptedException { @@ -157,18 +127,4 @@ public void testNewProjectionEntityQuery() throws InterruptedException { resultSet = Sets.newHashSet(Iterators.transform(results, ENTITY_TO_DESCRIPTION_FUNCTION)); } } - - @Test - public void testNewProjectionEntityQueryDeprecated() throws InterruptedException { - QuerySnippets transactionSnippets = new QuerySnippets(datastore); - QueryResults results = - transactionSnippets.newProjectionEntityQueryDeprecated(KIND, "description"); - Set resultSet = - Sets.newHashSet(Iterators.transform(results, ENTITY_TO_DESCRIPTION_FUNCTION)); - while (!resultSet.contains(entity1.getString("description")) - || !resultSet.contains(entity2.getString("description"))) { - Thread.sleep(500); - resultSet = Sets.newHashSet(Iterators.transform(results, ENTITY_TO_DESCRIPTION_FUNCTION)); - } - } } diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/AsyncLoggingHandler.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/AsyncLoggingHandler.java index 27ff47b1bd69..1773ef07aa55 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/AsyncLoggingHandler.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/AsyncLoggingHandler.java @@ -45,7 +45,7 @@ * *

Original Java logging levels are added as labels (with {@code levelName} and * {@code levelValue} keys, respectively) to the corresponding Stackdriver Logging {@link LogEntry}. - * You can read entry labels using {@link LogEntry#labels()}. To use logging levels that correspond + * You can read entry labels using {@link LogEntry#getLabels()}. To use logging levels that correspond * to Stackdriver Logging severities you can use {@link LoggingLevel}. * *

Configuration: By default each {@code AsyncLoggingHandler} is initialized using the diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/HttpRequest.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/HttpRequest.java index efac2760d895..e307a7e3e943 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/HttpRequest.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/HttpRequest.java @@ -94,13 +94,6 @@ public static final class Builder { this.cacheFillBytes = request.cacheFillBytes; } - /** - * Sets the HTTP request method. - */ - @Deprecated - public Builder requestMethod(RequestMethod requestMethod) { - return setRequestMethod(requestMethod); - } /** * Sets the HTTP request method. @@ -110,15 +103,6 @@ public Builder setRequestMethod(RequestMethod requestMethod) { return this; } - /** - * Sets the requested URL. Request URL contains the scheme ({@code http}, {@code https}), the - * host name, the path and the query portion of the URL that was requested. Example: - * {@code http://example.com/some/info?color=red}. - */ - @Deprecated - public Builder requestUrl(String requestUrl) { - return setRequestUrl(requestUrl); - } /** * Sets the requested URL. Request URL contains the scheme ({@code http}, {@code https}), the @@ -130,14 +114,6 @@ public Builder setRequestUrl(String requestUrl) { return this; } - /** - * Sets the size of the HTTP request message in bytes, including the request headers and the - * request body. - */ - @Deprecated - public Builder requestSize(long requestSize) { - return setRequestSize(requestSize); - } /** * Sets the size of the HTTP request message in bytes, including the request headers and the @@ -148,13 +124,6 @@ public Builder setRequestSize(long requestSize) { return this; } - /** - * Sets the response code indicating the status of response. - */ - @Deprecated - public Builder status(int status) { - return setStatus(status); - } /** * Sets the response code indicating the status of response. @@ -164,14 +133,6 @@ public Builder setStatus(int status) { return this; } - /** - * Sets the size of the HTTP response message sent back to the client, in bytes, including the - * response headers and the response body. - */ - @Deprecated - public Builder responseSize(long responseSize) { - return setResponseSize(responseSize); - } /** * Sets the size of the HTTP response message sent back to the client, in bytes, including the @@ -182,14 +143,6 @@ public Builder setResponseSize(long responseSize) { return this; } - /** - * Sets the user agent sent by the client. Example: - * {@code Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)}. - */ - @Deprecated - public Builder userAgent(String userAgent) { - return setUserAgent(userAgent); - } /** * Sets the user agent sent by the client. Example: @@ -200,14 +153,6 @@ public Builder setUserAgent(String userAgent) { return this; } - /** - * Sets the IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: - * {@code 192.168.1.1}, {@code FE80::0202:B3FF:FE1E:8329}. - */ - @Deprecated - public Builder remoteIp(String remoteIp) { - return setRemoteIp(remoteIp); - } /** * Sets the IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: @@ -218,14 +163,6 @@ public Builder setRemoteIp(String remoteIp) { return this; } - /** - * Sets the IP address (IPv4 or IPv6) of the origin server that the request was sent to. - * Examples: {@code 192.168.1.1}, {@code FE80::0202:B3FF:FE1E:8329}. - */ - @Deprecated - public Builder serverIp(String serverIp) { - return setServerIp(serverIp); - } /** * Sets the IP address (IPv4 or IPv6) of the origin server that the request was sent to. @@ -236,16 +173,6 @@ public Builder setServerIp(String serverIp) { return this; } - /** - * Sets the referer URL of the request, as defined in HTTP/1.1 Header Field Definitions. - * - * @see HTTP/1.1 Header Field - * Definitions - */ - @Deprecated - public Builder referer(String referer) { - return setReferer(referer); - } /** * Sets the referer URL of the request, as defined in HTTP/1.1 Header Field Definitions. @@ -258,13 +185,6 @@ public Builder setReferer(String referer) { return this; } - /** - * Sets whether or not a cache lookup was attempted. If not set, {@code false} is used. - */ - @Deprecated - public Builder cacheLookup(boolean cacheLookup) { - return setCacheLookup(cacheLookup); - } /** * Sets whether or not a cache lookup was attempted. If not set, {@code false} is used. @@ -274,14 +194,6 @@ public Builder setCacheLookup(boolean cacheLookup) { return this; } - /** - * Sets whether or not an entity was served from cache (with or without validation). If not set, - * {@code false} is used. - */ - @Deprecated - public Builder cacheHit(boolean cacheHit) { - return setCacheHit(cacheHit); - } /** * Sets whether or not an entity was served from cache (with or without validation). If not set, @@ -292,19 +204,10 @@ public Builder setCacheHit(boolean cacheHit) { return this; } - /** - * Sets whether or not the response was validated with the origin server before being served - * from cache. This field is only meaningful if {@link #cacheHit(boolean)} is set to - * {@code true}. If not set, {@code false} is used. - */ - @Deprecated - public Builder cacheValidatedWithOriginServer(boolean cacheValidatedWithOriginServer) { - return setCacheValidatedWithOriginServer(cacheValidatedWithOriginServer); - } /** * Sets whether or not the response was validated with the origin server before being served - * from cache. This field is only meaningful if {@link #cacheHit(boolean)} is set to + * from cache. This field is only meaningful if {@link #setCacheHit(boolean)} is set to * {@code true}. If not set, {@code false} is used. */ public Builder setCacheValidatedWithOriginServer(boolean cacheValidatedWithOriginServer) { @@ -312,14 +215,6 @@ public Builder setCacheValidatedWithOriginServer(boolean cacheValidatedWithOrigi return this; } - /** - * Sets the number of HTTP response bytes inserted into cache. Set only when a cache fill was - * attempted. - */ - @Deprecated - public Builder cacheFillBytes(long cacheFillBytes) { - return setCacheFillBytes(cacheFillBytes); - } /** * Sets the number of HTTP response bytes inserted into cache. Set only when a cache fill was @@ -354,13 +249,6 @@ public HttpRequest build() { this.cacheFillBytes = builder.cacheFillBytes; } - /** - * Returns the HTTP request method. - */ - @Deprecated - public RequestMethod requestMethod() { - return getRequestMethod(); - } /** * Returns the HTTP request method. @@ -369,15 +257,6 @@ public RequestMethod getRequestMethod() { return requestMethod; } - /** - * Returns the requested URL. Request URL contains the scheme ({@code http}, {@code https}), the - * host name, the path and the query portion of the URL that was requested. Example: - * {@code http://example.com/some/info?color=red}. - */ - @Deprecated - public String requestUrl() { - return getRequestUrl(); - } /** * Returns the requested URL. Request URL contains the scheme ({@code http}, {@code https}), the @@ -388,14 +267,6 @@ public String getRequestUrl() { return requestUrl; } - /** - * Returns the size of the HTTP request message in bytes, including the request headers and the - * request body. - */ - @Deprecated - public Long requestSize() { - return getRequestSize(); - } /** * Returns the size of the HTTP request message in bytes, including the request headers and the @@ -405,13 +276,6 @@ public Long getRequestSize() { return requestSize; } - /** - * Returns the response code indicating the status of response. - */ - @Deprecated - public Integer status() { - return getStatus(); - } /** * Returns the response code indicating the status of response. @@ -420,14 +284,6 @@ public Integer getStatus() { return status; } - /** - * Returns the size of the HTTP response message sent back to the client, in bytes, including the - * response headers and the response body. - */ - @Deprecated - public Long responseSize() { - return getResponseSize(); - } /** * Returns the size of the HTTP response message sent back to the client, in bytes, including the @@ -437,14 +293,6 @@ public Long getResponseSize() { return responseSize; } - /** - * Returns the user agent sent by the client. Example: - * {@code Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)}. - */ - @Deprecated - public String userAgent() { - return getUserAgent(); - } /** * Returns the user agent sent by the client. Example: @@ -454,14 +302,6 @@ public String getUserAgent() { return userAgent; } - /** - * Returns the IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: - * {@code 192.168.1.1}, {@code FE80::0202:B3FF:FE1E:8329}. - */ - @Deprecated - public String remoteIp() { - return getRemoteIp(); - } /** * Returns the IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: @@ -471,14 +311,6 @@ public String getRemoteIp() { return remoteIp; } - /** - * Returns the IP address (IPv4 or IPv6) of the origin server that the request was sent to. - * Examples: {@code 192.168.1.1}, {@code FE80::0202:B3FF:FE1E:8329}. - */ - @Deprecated - public String serverIp() { - return getServerIp(); - } /** * Returns the IP address (IPv4 or IPv6) of the origin server that the request was sent to. @@ -488,16 +320,6 @@ public String getServerIp() { return serverIp; } - /** - * Returns the referer URL of the request, as defined in HTTP/1.1 Header Field Definitions. - * - * @see HTTP/1.1 Header Field - * Definitions - */ - @Deprecated - public String referer() { - return getReferer(); - } /** * Returns the referer URL of the request, as defined in HTTP/1.1 Header Field Definitions. @@ -534,14 +356,6 @@ public boolean cacheValidatedWithOriginServer() { return cacheValidatedWithOriginServer; } - /** - * Returns the number of HTTP response bytes inserted into cache. Set only when a cache fill was - * attempted. - */ - @Deprecated - public Long cacheFillBytes() { - return getCacheFillBytes(); - } /** * Returns the number of HTTP response bytes inserted into cache. Set only when a cache fill was @@ -647,13 +461,6 @@ com.google.logging.type.HttpRequest toPb() { return builder.build(); } - /** - * Returns a builder for {@code HttpRequest} objects. - */ - @Deprecated - public static Builder builder() { - return newBuilder(); - } /** * Returns a builder for {@code HttpRequest} objects. diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/LogEntry.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/LogEntry.java index 8dc4b87f7434..16ca2a4eb796 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/LogEntry.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/LogEntry.java @@ -36,8 +36,8 @@ * entries can have different type of payloads: an UTF-8 string (see * {@link Payload.StringPayload}), a JSON object (see {@link Payload.JsonPayload}, or a protobuf * object (see {@link Payload.ProtoPayload}). Entries can also store additional information about - * the operation or the HTTP request that generated the log (see {@link LogEntry#operation()} and - * {@link LogEntry#httpRequest()}, respectively). + * the operation or the HTTP request that generated the log (see {@link LogEntry#getOperation()} and + * {@link LogEntry#getHttpRequest()}, respectively). * * @see Log Entries and Logs */ @@ -95,17 +95,6 @@ public static class Builder { this.payload = entry.payload; } - /** - * Sets the name of the log to which this log entry belongs. The log name must be less than 512 - * characters long and can only include the following characters: upper and lower case - * alphanumeric characters: {@code [A-Za-z0-9]}; and punctuation characters: {@code _-./}. The - * forward-slash ({@code /}) characters in the log name must be URL-encoded. Examples: - * {@code syslog}, {@code library.googleapis.com%2Fbook_log}. - */ - @Deprecated - public Builder logName(String logName) { - return setLogName(logName); - } /** * Sets the name of the log to which this log entry belongs. The log name must be less than 512 @@ -119,15 +108,6 @@ public Builder setLogName(String logName) { return this; } - /** - * Sets the monitored resource associated with this log entry. Example: a log entry that reports - * a database error would be associated with the monitored resource designating the particular - * database that reported the error. - */ - @Deprecated - public Builder resource(MonitoredResource resource) { - return setResource(resource); - } /** * Sets the monitored resource associated with this log entry. Example: a log entry that reports @@ -139,14 +119,6 @@ public Builder setResource(MonitoredResource resource) { return this; } - /** - * Sets the time at which the event described by the log entry occurred, in milliseconds. If - * omitted, the Logging service will use the time at which the log entry is received. - */ - @Deprecated - public Builder timestamp(long timestamp) { - return setTimestamp(timestamp); - } /** * Sets the time at which the event described by the log entry occurred, in milliseconds. If @@ -157,13 +129,6 @@ public Builder setTimestamp(long timestamp) { return this; } - /** - * Sets the severity of the log entry. If not set, {@link Severity#DEFAULT} is used. - */ - @Deprecated - public Builder severity(Severity severity) { - return setSeverity(severity); - } /** * Sets the severity of the log entry. If not set, {@link Severity#DEFAULT} is used. @@ -173,15 +138,6 @@ public Builder setSeverity(Severity severity) { return this; } - /** - * Sets a unique ID for the log entry. If you provide this field, the Logging service considers - * other log entries in the same log with the same ID as duplicates which can be removed. If - * omitted, the Logging service will generate a unique ID for this log entry. - */ - @Deprecated - public Builder insertId(String insertId) { - return setInsertId(insertId); - } /** * Sets a unique ID for the log entry. If you provide this field, the Logging service considers @@ -193,13 +149,6 @@ public Builder setInsertId(String insertId) { return this; } - /** - * Sets information about the HTTP request associated with this log entry, if applicable. - */ - @Deprecated - public Builder httpRequest(HttpRequest httpRequest) { - return setHttpRequest(httpRequest); - } /** * Sets information about the HTTP request associated with this log entry, if applicable. @@ -209,14 +158,6 @@ public Builder setHttpRequest(HttpRequest httpRequest) { return this; } - /** - * Sets an optional set of user-defined (key, value) data that provides additional information - * about the log entry. - */ - @Deprecated - public Builder labels(Map labels) { - return setLabels(labels); - } /** * Sets an optional set of user-defined (key, value) data that provides additional information @@ -245,13 +186,6 @@ public Builder clearLabels() { return this; } - /** - * Sets information about an operation associated with the log entry, if applicable. - */ - @Deprecated - public Builder operation(Operation operation) { - return setOperation(operation); - } /** * Sets information about an operation associated with the log entry, if applicable. @@ -261,17 +195,6 @@ public Builder setOperation(Operation operation) { return this; } - /** - * Sets the payload for this log entry. The log entry payload can be provided as an UTF-8 string - * (see {@link Payload.StringPayload}), a JSON object (see {@link Payload.JsonPayload}, or - * a protobuf object (see {@link Payload.ProtoPayload}). - * - * @see Log Entries and Logs - */ - @Deprecated - public Builder payload(Payload payload) { - return setPayload(payload); - } /** * Sets the payload for this log entry. The log entry payload can be provided as an UTF-8 string @@ -305,17 +228,6 @@ public LogEntry build() { this.payload = builder.payload; } - /** - * Returns the name of the log to which this log entry belongs. The log name must be less than 512 - * characters long and can only include the following characters: upper and lower case - * alphanumeric characters: {@code [A-Za-z0-9]}; and punctuation characters: {@code _-./}. The - * forward-slash ({@code /}) characters in the log name must be URL-encoded. Examples: - * {@code syslog}, {@code library.googleapis.com%2Fbook_log}. - */ - @Deprecated - public String logName() { - return getLogName(); - } /** * Returns the name of the log to which this log entry belongs. The log name must be less than 512 @@ -328,15 +240,6 @@ public String getLogName() { return logName; } - /** - * Returns the monitored resource associated with this log entry. Example: a log entry that - * reports a database error would be associated with the monitored resource designating the - * particular database that reported the error. - */ - @Deprecated - public MonitoredResource resource() { - return getResource(); - } /** * Returns the monitored resource associated with this log entry. Example: a log entry that @@ -347,14 +250,6 @@ public MonitoredResource getResource() { return resource; } - /** - * Returns the time at which the event described by the log entry occurred, in milliseconds. If - * omitted, the Logging service will use the time at which the log entry is received. - */ - @Deprecated - public Long timestamp() { - return getTimestamp(); - } /** * Returns the time at which the event described by the log entry occurred, in milliseconds. If @@ -364,13 +259,6 @@ public Long getTimestamp() { return timestamp; } - /** - * Returns the severity of the log entry. If not set, {@link Severity#DEFAULT} is used. - */ - @Deprecated - public Severity severity() { - return getSeverity(); - } /** * Returns the severity of the log entry. If not set, {@link Severity#DEFAULT} is used. @@ -379,14 +267,6 @@ public Severity getSeverity() { return severity; } - /** - * Returns a unique ID for the log entry. The Logging service considers other log entries in the - * same log with the same ID as duplicates which can be removed. - */ - @Deprecated - public String insertId() { - return getInsertId(); - } /** * Returns a unique ID for the log entry. The Logging service considers other log entries in the @@ -396,13 +276,6 @@ public String getInsertId() { return insertId; } - /** - * Returns information about the HTTP request associated with this log entry, if applicable. - */ - @Deprecated - public HttpRequest httpRequest() { - return getHttpRequest(); - } /** * Returns information about the HTTP request associated with this log entry, if applicable. @@ -411,14 +284,6 @@ public HttpRequest getHttpRequest() { return httpRequest; } - /** - * Returns an optional set of user-defined (key, value) data that provides additional information - * about the log entry. - */ - @Deprecated - public Map labels() { - return getLabels(); - } /** * Returns an optional set of user-defined (key, value) data that provides additional information @@ -428,13 +293,6 @@ public Map getLabels() { return labels; } - /** - * Returns information about an operation associated with the log entry, if applicable. - */ - @Deprecated - public Operation operation() { - return getOperation(); - } /** * Returns information about an operation associated with the log entry, if applicable. @@ -443,18 +301,6 @@ public Operation getOperation() { return operation; } - /** - * Returns the payload for this log entry. The log entry payload can be an UTF-8 string (see - * {@link Payload.StringPayload}), a JSON object (see {@link Payload.JsonPayload}, or a protobuf - * object (see {@link Payload.ProtoPayload}). - * - * @see Log Entries and Logs - */ - @SuppressWarnings("unchecked") - @Deprecated - public T payload() { - return getPayload(); - } /** * Returns the payload for this log entry. The log entry payload can be an UTF-8 string (see @@ -546,13 +392,6 @@ com.google.logging.v2.LogEntry toPb(String projectId) { return builder.build(); } - /** - * Returns a builder for {@code LogEntry} objects given the entry payload. - */ - @Deprecated - public static Builder builder(Payload payload) { - return newBuilder(payload); - } /** * Returns a builder for {@code LogEntry} objects given the entry payload. diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/Logging.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/Logging.java index c9ea10659fd5..58f74579a139 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/Logging.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/Logging.java @@ -85,7 +85,7 @@ private WriteOption(OptionType option, Object value) { } /** - * Returns an option to specify a default log name (see {@link LogEntry#logName()}) for those + * Returns an option to specify a default log name (see {@link LogEntry#getLogName()}) for those * log entries that do not specify their own log name. Example: {@code syslog}. */ public static WriteOption logName(String logName) { @@ -93,7 +93,7 @@ public static WriteOption logName(String logName) { } /** - * Returns an option to specify a default monitored resource (see {@link LogEntry#resource()}) + * Returns an option to specify a default monitored resource (see {@link LogEntry#getResource()}) * for those log entries that do not specify their own resource. */ public static WriteOption resource(MonitoredResource resource) { @@ -101,9 +101,9 @@ public static WriteOption resource(MonitoredResource resource) { } /** - * Sets an option to specify (key, value) pairs that are added to the {@link LogEntry#labels()} - * of each log entry written, except when a log entry already has a value associated to the - * same key. + * Sets an option to specify (key, value) pairs that are added to the + * {@link LogEntry#getLabels()} of each log entry written, except when a log entry already has a + * value associated to the same key. */ public static WriteOption labels(Map labels) { return new WriteOption(OptionType.LABELS, ImmutableMap.copyOf(labels)); @@ -175,7 +175,7 @@ public static EntryListOption pageToken(String pageToken) { /** * Returns an option to sort log entries. If not specified, log entries are sorted in ascending - * (most-recent last) order with respect to the {@link LogEntry#timestamp()} value. + * (most-recent last) order with respect to the {@link LogEntry#getTimestamp()} value. */ public static EntryListOption sortOrder(SortingField field, SortingOrder order) { return new EntryListOption(OptionType.ORDER_BY, field.selector() + ' ' + order.selector()); diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingHandler.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingHandler.java index 6b36e15aeca3..9af8e231917b 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingHandler.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingHandler.java @@ -56,8 +56,8 @@ * *

Original Java logging levels are added as labels (with {@code levelName} and * {@code levelValue} keys, respectively) to the corresponding Stackdriver Logging {@link LogEntry}. - * You can read entry labels using {@link LogEntry#labels()}. To use logging levels that correspond - * to Stackdriver Logging severities you can use {@link LoggingLevel}. + * You can read entry labels using {@link LogEntry#getLabels()}. To use logging levels that + * correspond to Stackdriver Logging severities you can use {@link LoggingLevel}. * *

Configuration: By default each {@code LoggingHandler} is initialized using the * following {@code LogManager} configuration properties (that you can set in the @@ -81,7 +81,7 @@ *

  • {@code com.google.cloud.logging.LoggingHandler.enhancers} specifies a comma separated list * of {@link Enhancer} classes. This handler will call each enhancer list whenever it builds * a {@link MonitoredResource} or {@link LogEntry} instance (defaults to empty list). - *
  • {@code com.google.cloud.logging.LoggingHandler.resourceType} the type name to use when + *
  • {@code com.google.cloud.logging.LoggingHandler.resourceType} the type name to use when * creating the default {@link MonitoredResource} (defaults to "global"). * * @@ -139,7 +139,7 @@ public LoggingHandler(String log, LoggingOptions options) { * * @param log the name of the log to which log entries are written * @param options options for the Stackdriver Logging service - * @param monitoredResource the monitored resource to which log entries refer. If it is null + * @param monitoredResource the monitored resource to which log entries refer. If it is null * then a default resource is created based on the project ID. When creating a default resource, if * any {@link Enhancer} instances are configured and then each * {@link Enhancer#enhanceMonitoredResource(com.google.cloud.MonitoredResource.Builder)} method @@ -148,13 +148,13 @@ public LoggingHandler(String log, LoggingOptions options) { public LoggingHandler(String log, LoggingOptions options, MonitoredResource monitoredResource) { this(log, options, monitoredResource,null); } - + /** * Creates a handler that publishes messages to Stackdriver Logging. * * @param log the name of the log to which log entries are written * @param options options for the Stackdriver Logging service - * @param monitoredResource the monitored resource to which log entries refer. If it is null + * @param monitoredResource the monitored resource to which log entries refer. If it is null * then a default resource is created based on the project ID. When creating a default resource, if * any {@link Enhancer} instances are configured and then each * {@link Enhancer#enhanceMonitoredResource(com.google.cloud.MonitoredResource.Builder)} method @@ -220,7 +220,7 @@ private MonitoredResource getDefaultResource(String resourceType) { for (Enhancer enhancer : enhancers) { enhancer.enhanceMonitoredResource(builder); } - return builder.build(); + return builder.build(); } private static class LogConfigHelper { @@ -278,16 +278,16 @@ Formatter getFormatterProperty(String name, Formatter defaultValue) { } return defaultValue; } - + List getEnhancerProperty(String name) { String list = manager.getProperty(name); try { List enhancers = new ArrayList<>(); if (list != null) { String[] items = list.split(","); - for (String e_name : items) { + for (String e_name : items) { Class clz = (Class) ClassLoader.getSystemClassLoader().loadClass(e_name); - enhancers.add((Enhancer) clz.newInstance()); + enhancers.add(clz.newInstance()); } } return enhancers; @@ -372,17 +372,17 @@ private LogEntry entryFor(LogRecord record) { enhanceLogEntry(builder, record); return builder.build(); } catch (Exception ex) { - // Formatting or enhancing can fail but we should not throw an exception, + // Formatting or enhancing can fail but we should not throw an exception, // we report the error instead reportError(null, ex, ErrorManager.FORMAT_FAILURE); return null; } } - + @Deprecated protected void enhanceLogEntry(LogEntry.Builder builder, LogRecord record) { } - + private static Severity severityFor(Level level) { if (level instanceof LoggingLevel) { return ((LoggingLevel) level).getSeverity(); @@ -494,7 +494,7 @@ public synchronized long setFlushSize(long flushSize) { public static void addHandler(Logger logger, LoggingHandler handler) { logger.addHandler(handler); } - + /** * A Log Enhancer. * May be used to enhance the {@link MonitoredResource} and/or the {@link LogEntry} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingImpl.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingImpl.java index b7bf7161a04f..178a5ab7b611 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingImpl.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingImpl.java @@ -141,11 +141,6 @@ private static class SinkPageFetcher extends BasePageFetcher { super(serviceOptions, cursor, requestOptions); } - @Override - @Deprecated - public Future> nextPage() { - return getNextPage(); - } @Override public Future> getNextPage() { @@ -163,11 +158,6 @@ private static class MonitoredResourceDescriptorPageFetcher super(serviceOptions, cursor, requestOptions); } - @Override - @Deprecated - public Future> nextPage() { - return getNextPage(); - } @Override public Future> getNextPage() { @@ -184,11 +174,6 @@ private static class MetricPageFetcher extends BasePageFetcher { super(serviceOptions, cursor, requestOptions); } - @Override - @Deprecated - public Future> nextPage() { - return getNextPage(); - } @Override public Future> getNextPage() { @@ -205,11 +190,6 @@ private static class LogEntryPageFetcher extends BasePageFetcher { super(serviceOptions, cursor, requestOptions); } - @Override - @Deprecated - public Future> nextPage() { - return getNextPage(); - } @Override public Future> getNextPage() { diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingLevel.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingLevel.java index 53056993a6d2..8d2c94d0c815 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingLevel.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingLevel.java @@ -86,13 +86,6 @@ private LoggingLevel(String name, int value, Severity severity) { this.severity = severity; } - /** - * Returns the Stackdriver Logging severity associated with this logging level. - */ - @Deprecated - public Severity severity() { - return getSeverity(); - } /** * Returns the Stackdriver Logging severity associated with this logging level. diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingOptions.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingOptions.java index 3bf7b8b3f9dc..6a815efd5800 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingOptions.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingOptions.java @@ -44,13 +44,6 @@ public Logging create(LoggingOptions options) { } } - /** - * Returns a default {@code LoggingOptions} instance. - */ - @Deprecated - public static LoggingOptions defaultInstance() { - return getDefaultInstance(); - } /** * Returns a default {@code LoggingOptions} instance. @@ -132,10 +125,6 @@ public Builder toBuilder() { return new Builder(this); } - @Deprecated - public static Builder builder() { - return newBuilder(); - } public static Builder newBuilder() { return new Builder(); diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/Metric.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/Metric.java index 06a87b6a80e8..ebba88a60c1a 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/Metric.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/Metric.java @@ -28,7 +28,7 @@ /** * Stackdriver Logging metrics describe logs-based metric. The value of the metric is the number of - * log entries that match a logs filter (see {@link #filter()}). + * log entries that match a logs filter (see {@link #getFilter()}). * *

    {@code Metric} adds a layer of service-related functionality over {@link MetricInfo}. Objects * of this class are immutable. To get a {@code Metric} object with the most recent information use @@ -57,11 +57,6 @@ private Builder(Metric metric) { delegate = new BuilderImpl(metric); } - @Override - @Deprecated - public Builder name(String name) { - return setName(name); - } @Override public Builder setName(String name) { @@ -69,11 +64,6 @@ public Builder setName(String name) { return this; } - @Override - @Deprecated - public Builder description(String description) { - return setDescription(description); - } @Override public Builder setDescription(String description) { @@ -81,11 +71,6 @@ public Builder setDescription(String description) { return this; } - @Override - @Deprecated - public Builder filter(String filter) { - return setFilter(filter); - } @Override public Builder setFilter(String filter) { @@ -127,13 +112,6 @@ public final boolean equals(Object obj) { return baseEquals(other) && Objects.equals(options, other.options); } - /** - * Returns the metrics's {@code Logging} object used to issue requests. - */ - @Deprecated - public Logging logging() { - return getLogging(); - } /** * Returns the metrics's {@code Logging} object used to issue requests. diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/MetricInfo.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/MetricInfo.java index 9be96f8d2ce8..7d9bb5602697 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/MetricInfo.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/MetricInfo.java @@ -26,7 +26,7 @@ /** * Stackdriver Logging metrics describe logs-based metric. The value of the metric is the number of - * log entries that match a logs filter (see {@link #filter()}). + * log entries that match a logs filter (see {@link #getFilter()}). * * @see Logs-based Metrics * @@ -44,15 +44,6 @@ public class MetricInfo implements Serializable { */ public abstract static class Builder { - /** - * Sets the name of the metric. Example: {@code severe-errors}. Metric identifiers are - * limited to 1000 characters and can include only the following characters: {@code A-Z}, - * {@code a-z}, {@code 0-9}, and the special characters {@code _-.,+!*',()%/\}. The - * forward-slash character ({@code /}) denotes a hierarchy of name pieces, and it cannot be the - * first character of the name. - */ - @Deprecated - public abstract Builder name(String name); /** * Sets the name of the metric. Example: {@code severe-errors}. Metric identifiers are @@ -63,26 +54,12 @@ public abstract static class Builder { */ public abstract Builder setName(String name); - /** - * Sets an optional description for this metric. Used for documentation purpose. - */ - @Deprecated - public abstract Builder description(String description); /** * Sets an optional description for this metric. Used for documentation purpose. */ public abstract Builder setDescription(String description); - /** - * Sets an advanced logs filter. The value of the metric is the number of log entries that match - * this filter. Example: {@code logName=projects/my-projectid/logs/syslog AND severity>=ERROR}. - * - * @see Advanced Log - * Filters - */ - @Deprecated - public abstract Builder filter(String filter); /** * Sets an advanced logs filter. The value of the metric is the number of log entries that match @@ -116,11 +93,6 @@ static final class BuilderImpl extends Builder { this.filter = metric.filter; } - @Override - @Deprecated - public Builder name(String name) { - return setName(name); - } @Override public Builder setName(String name) { @@ -128,11 +100,6 @@ public Builder setName(String name) { return this; } - @Override - @Deprecated - public Builder description(String description) { - return setDescription(description); - } @Override public Builder setDescription(String description) { @@ -140,11 +107,6 @@ public Builder setDescription(String description) { return this; } - @Override - @Deprecated - public Builder filter(String filter) { - return setFilter(filter); - } @Override public Builder setFilter(String filter) { @@ -164,17 +126,6 @@ public MetricInfo build() { this.description = builder.description; } - /** - * Returns the name of the metric. Example: {@code severe-errors}. Metric identifiers are - * limited to 1000 characters and can include only the following characters: {@code A-Z}, - * {@code a-z}, {@code 0-9}, and the special characters {@code _-.,+!*',()%/\}. The - * forward-slash character ({@code /}) denotes a hierarchy of name pieces, and it cannot be the - * first character of the name. - */ - @Deprecated - public String name() { - return getName(); - } /** * Returns the name of the metric. Example: {@code severe-errors}. Metric identifiers are @@ -187,13 +138,6 @@ public String getName() { return name; } - /** - * Returns an optional description for this metric. Used for documentation purpose. - */ - @Deprecated - public String description() { - return getDescription(); - } /** * Returns an optional description for this metric. Used for documentation purpose. @@ -202,18 +146,6 @@ public String getDescription() { return description; } - /** - * Returns an advanced logs filter. The value of the metric is the number of log entries that - * match this filter. Example: - * {@code logName=projects/my-projectid/logs/syslog AND severity>=ERROR}. - * - * @see Advanced Log - * Filters - */ - @Deprecated - public String filter() { - return getFilter(); - } /** * Returns an advanced logs filter. The value of the metric is the number of log entries that @@ -265,13 +197,6 @@ public Builder toBuilder() { return new BuilderImpl(this); } - /** - * Returns a builder for {@code MetricInfo} objects given the name of the metric and its filter. - */ - @Deprecated - public static Builder builder(String name, String filter) { - return newBuilder(name, filter); - } /** * Returns a builder for {@code MetricInfo} objects given the name of the metric and its filter. diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/Operation.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/Operation.java index 468f40feb733..ea82a50808dd 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/Operation.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/Operation.java @@ -63,14 +63,6 @@ public static final class Builder { this.last = operation.last; } - /** - * Sets the operation identifier. Log entries with the same identifier are assumed to be part - * of the same operation. The combination of id and producer must be globally unique. - */ - @Deprecated - public Builder id(String id) { - return setId(id); - } /** * Sets the operation identifier. Log entries with the same identifier are assumed to be part @@ -81,15 +73,6 @@ public Builder setId(String id) { return this; } - /** - * Sets an arbitrary producer identifier. The combination of producer and id must be globally - * unique. Examples: {@code MyDivision.MyBigCompany.com}, - * {@code github.com/MyProject/MyApplication}. - */ - @Deprecated - public Builder producer(String producer) { - return setProducer(producer); - } /** * Sets an arbitrary producer identifier. The combination of producer and id must be globally @@ -101,14 +84,6 @@ public Builder setProducer(String producer) { return this; } - /** - * Sets whether the corresponding entry is the first log entry in the operation. If not set, - * {@code false} is used. - */ - @Deprecated - public Builder first(boolean first) { - return setFirst(first); - } /** * Sets whether the corresponding entry is the first log entry in the operation. If not set, @@ -119,14 +94,6 @@ public Builder setFirst(boolean first) { return this; } - /** - * Sets whether the corresponding entry is the last log entry in the operation. If not set, - * {@code false} is used. - */ - @Deprecated - public Builder last(boolean last) { - return setLast(last); - } /** * Sets whether the corresponding entry is the last log entry in the operation. If not set, @@ -152,37 +119,19 @@ public Operation build() { this.last = builder.last; } - /** - * Returns the operation identifier. Log entries with the same identifier are assumed to be part - * of the same operation. The combination of this value and {@link #producer()} must be globally - * unique. - */ - @Deprecated - public String id() { - return getId(); - } /** * Returns the operation identifier. Log entries with the same identifier are assumed to be part - * of the same operation. The combination of this value and {@link #producer()} must be globally - * unique. + * of the same operation. The combination of this value and {@link #getProducer()} must be + * globally unique. */ public String getId() { return id; } - /** - * Returns an arbitrary producer identifier. The combination of this value and {@link #id()} - * must be globally unique. Examples: {@code MyDivision.MyBigCompany.com}, - * {@code github.com/MyProject/MyApplication}. - */ - @Deprecated - public String producer() { - return getProducer(); - } /** - * Returns an arbitrary producer identifier. The combination of this value and {@link #id()} + * Returns an arbitrary producer identifier. The combination of this value and {@link #getId()} * must be globally unique. Examples: {@code MyDivision.MyBigCompany.com}, * {@code github.com/MyProject/MyApplication}. */ @@ -252,14 +201,6 @@ LogEntryOperation toPb() { return builder.build(); } - /** - * Returns a builder for {@code Operation} objects given the operation and producer identifiers. - * The combination of producer and id must be globally unique. - */ - @Deprecated - public static Builder builder(String id, String producer) { - return newBuilder(id, producer); - } /** * Returns a builder for {@code Operation} objects given the operation and producer identifiers. diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/Payload.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/Payload.java index c7b6a8a20f43..456c2aef15f7 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/Payload.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/Payload.java @@ -97,13 +97,6 @@ public static final class JsonPayload extends Payload { super(Type.JSON, jsonData); } - /** - * Returns the log entry's JSON data as an unmodifiable map. - */ - @Deprecated - public Map dataAsMap() { - return getDataAsMap(); - } /** * Returns the log entry's JSON data as an unmodifiable map. @@ -188,14 +181,6 @@ private Payload(Type type, T data) { this.data = checkNotNull(data); } - /** - * Returns the payload type. Payload can be an UTF-8 string ({@link Type#STRING}), a JSON object - * ({@link Type#JSON}) or a protobuf object ({@link Type#PROTO}). - */ - @Deprecated - public Type type() { - return getType(); - } /** * Returns the payload type. Payload can be an UTF-8 string ({@link Type#STRING}), a JSON object @@ -205,13 +190,6 @@ public Type getType() { return type; } - /** - * Returns the log entry payload's data. - */ - @Deprecated - public T data() { - return getData(); - } /** * Returns the log entry payload's data. diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/Sink.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/Sink.java index ff3d75dac01f..d1213d59f100 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/Sink.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/Sink.java @@ -63,11 +63,6 @@ private Builder(Sink sink) { delegate = new BuilderImpl(sink); } - @Override - @Deprecated - public Builder name(String name) { - return setName(name); - } @Override public Builder setName(String name) { @@ -75,11 +70,6 @@ public Builder setName(String name) { return this; } - @Override - @Deprecated - public Builder destination(Destination destination) { - return setDestination(destination); - } @Override public Builder setDestination(Destination destination) { @@ -87,11 +77,6 @@ public Builder setDestination(Destination destination) { return this; } - @Override - @Deprecated - public Builder filter(String filter) { - return setFilter(filter); - } @Override public Builder setFilter(String filter) { @@ -99,11 +84,6 @@ public Builder setFilter(String filter) { return this; } - @Override - @Deprecated - public Builder versionFormat(VersionFormat versionFormat) { - return setVersionFormat(versionFormat); - } @Override public Builder setVersionFormat(VersionFormat versionFormat) { @@ -145,13 +125,6 @@ public final boolean equals(Object obj) { return baseEquals(other) && Objects.equals(options, other.options); } - /** - * Returns the sinks's {@code Logging} object used to issue requests. - */ - @Deprecated - public Logging logging() { - return getLogging(); - } /** * Returns the sinks's {@code Logging} object used to issue requests. diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/SinkInfo.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/SinkInfo.java index af218c2b3a11..68c47b3590e4 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/SinkInfo.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/SinkInfo.java @@ -92,13 +92,6 @@ public static final class BucketDestination extends Destination { this.bucket = checkNotNull(bucket); } - /** - * Returns the name of the Google Cloud Storage bucket this destination represents. - */ - @Deprecated - public String bucket() { - return getBucket(); - } /** * Returns the name of the Google Cloud Storage bucket this destination represents. @@ -175,14 +168,6 @@ public static final class DatasetDestination extends Destination { this.dataset = checkNotNull(dataset); } - /** - * Returns the name of the project where the Google Cloud BigQuery dataset resides. If - * {@code null}, the default project is used. - */ - @Deprecated - public String project() { - return getProject(); - } /** * Returns the name of the project where the Google Cloud BigQuery dataset resides. If @@ -192,13 +177,6 @@ public String getProject() { return project; } - /** - * Returns the name of the Google Cloud BigQuery dataset this destination represents. - */ - @Deprecated - public String dataset() { - return getDataset(); - } /** * Returns the name of the Google Cloud BigQuery dataset this destination represents. @@ -288,14 +266,6 @@ public static final class TopicDestination extends Destination { this.topic = checkNotNull(topic); } - /** - * Returns the name of the project where the Google Cloud Pub/Sub topic resides. If - * {@code null}, the default project is used. - */ - @Deprecated - public String project() { - return getProject(); - } /** * Returns the name of the project where the Google Cloud Pub/Sub topic resides. If @@ -305,13 +275,6 @@ public String getProject() { return project; } - /** - * Returns the name of the Google Cloud Pub/Sub topic this destination represents. - */ - @Deprecated - public String topic() { - return getTopic(); - } /** * Returns the name of the Google Cloud Pub/Sub topic this destination represents. @@ -386,13 +349,6 @@ static TopicDestination fromPb(String destinationPb) { this.type = checkNotNull(type); } - /** - * Returns the type of this destination. - */ - @Deprecated - public Type type() { - return getType(); - } /** * Returns the type of this destination. @@ -461,13 +417,6 @@ static VersionFormat fromPb(LogSink.VersionFormat versionPb) { */ public abstract static class Builder { - /** - * Sets the name of the sink. Example: {@code my-severe-errors-to-pubsub}. Sink identifiers are - * limited to 1000 characters and can include only the following characters: {@code A-Z}, - * {@code a-z}, {@code 0-9}, and the special characters {@code _-.}. - */ - @Deprecated - public abstract Builder name(String name); /** * Sets the name of the sink. Example: {@code my-severe-errors-to-pubsub}. Sink identifiers are @@ -476,18 +425,6 @@ public abstract static class Builder { */ public abstract Builder setName(String name); - /** - * Sets the export destination. Use a {@link Destination.BucketDestination} object to create a - * sink that exports logs to a Google Cloud Storage bucket. Use a - * {@link Destination.DatasetDestination} object to create a sink that exports logs to a Google - * Cloud BigQuery dataset. Use a {@link Destination.TopicDestination} object to create a sink - * that exports logs to a Google Cloud Pub/Sub topic. - * - * @see - * Exporting Logs - */ - @Deprecated - public abstract Builder destination(Destination destination); /** * Sets the export destination. Use a {@link Destination.BucketDestination} object to create a @@ -501,23 +438,11 @@ public abstract static class Builder { */ public abstract Builder setDestination(Destination destination); - /** - * Sets an advanced logs filter. Only log entries matching that filter are exported. The filter - * must be consistent with the log entry format specified with - * {@link #versionFormat(VersionFormat)}, regardless of the format of the log entry that was - * originally written to Stackdriver Logging. Example (V2 format): - * {@code logName=projects/my-projectid/logs/syslog AND severity>=ERROR}. - * - * @see Advanced Log - * Filters - */ - @Deprecated - public abstract Builder filter(String filter); /** * Sets an advanced logs filter. Only log entries matching that filter are exported. The filter * must be consistent with the log entry format specified with - * {@link #versionFormat(VersionFormat)}, regardless of the format of the log entry that was + * {@link #setVersionFormat(VersionFormat)}, regardless of the format of the log entry that was * originally written to Stackdriver Logging. Example (V2 format): * {@code logName=projects/my-projectid/logs/syslog AND severity>=ERROR}. * @@ -526,13 +451,6 @@ public abstract static class Builder { */ public abstract Builder setFilter(String filter); - /** - * Sets the log entry version to use for this sink's exported log entries. This version does - * not have to correspond to the version of the log entry when it was written to Google Cloud - * Logging. - */ - @Deprecated - public abstract Builder versionFormat(VersionFormat versionFormat); /** * Sets the log entry version to use for this sink's exported log entries. This version does @@ -566,11 +484,6 @@ static final class BuilderImpl extends Builder { this.versionFormat = sink.versionFormat; } - @Override - @Deprecated - public Builder name(String name) { - return setName(name); - } @Override public Builder setName(String name) { @@ -578,11 +491,6 @@ public Builder setName(String name) { return this; } - @Override - @Deprecated - public Builder destination(Destination destination) { - return setDestination(destination); - } @Override public Builder setDestination(Destination destination) { @@ -590,11 +498,6 @@ public Builder setDestination(Destination destination) { return this; } - @Override - @Deprecated - public Builder filter(String filter) { - return setFilter(filter); - } @Override public Builder setFilter(String filter) { @@ -602,11 +505,6 @@ public Builder setFilter(String filter) { return this; } - @Override - @Deprecated - public Builder versionFormat(VersionFormat versionFormat) { - return setVersionFormat(versionFormat); - } @Override public Builder setVersionFormat(VersionFormat versionFormat) { @@ -627,15 +525,6 @@ public SinkInfo build() { this.versionFormat = builder.versionFormat; } - /** - * Returns the name of the sink. Example: {@code my-severe-errors-to-pubsub}. Sink identifiers are - * limited to 1000 characters and can include only the following characters: {@code A-Z}, - * {@code a-z}, {@code 0-9}, and the special characters {@code _-.}. - */ - @Deprecated - public String name() { - return getName(); - } /** * Returns the name of the sink. Example: {@code my-severe-errors-to-pubsub}. Sink identifiers are @@ -646,21 +535,6 @@ public String getName() { return name; } - /** - * Returns the export destination. This method returns a {@link Destination.BucketDestination} for - * sinks that export logs to Google Cloud Storage buckets. Returns - * {@link Destination.DatasetDestination} for sinks that export logs to Google Cloud BigQuery - * datasets. Returns {@link Destination.TopicDestination} for sinks that export logs to Google - * Cloud Pub/Sub topics. - * - * @see - * Exporting Logs - */ - @SuppressWarnings("unchecked") - @Deprecated - public T destination() { - return getDestination(); - } /** * Returns the export destination. This method returns a {@link Destination.BucketDestination} for @@ -677,25 +551,12 @@ public T getDestination() { return (T) destination; } - /** - * Returns an advanced logs filter. Only log entries matching that filter are exported. The filter - * must be consistent with the log entry format specified in {@link #versionFormat()}, regardless - * of the format of the log entry that wa originally written to Stackdriver Logging. Example (V2 - * format): {@code logName=projects/my-projectid/logs/syslog AND severity>=ERROR}. - * - * @see Advanced Log - * Filters - */ - @Deprecated - public String filter() { - return getFilter(); - } /** * Returns an advanced logs filter. Only log entries matching that filter are exported. The filter - * must be consistent with the log entry format specified in {@link #versionFormat()}, regardless - * of the format of the log entry that wa originally written to Stackdriver Logging. Example (V2 - * format): {@code logName=projects/my-projectid/logs/syslog AND severity>=ERROR}. + * must be consistent with the log entry format specified in {@link #getVersionFormat()}, + * regardless of the format of the log entry that wa originally written to Stackdriver Logging. + * Example (V2 format): {@code logName=projects/my-projectid/logs/syslog AND severity>=ERROR}. * * @see Advanced Log * Filters @@ -704,15 +565,6 @@ public String getFilter() { return filter; } - /** - * Returns the log entry version to use for this sink's exported log entries. This version does - * not have to correspond to the version of the log entry when it was written to Google Cloud - * Logging. - */ - @Deprecated - public VersionFormat versionFormat() { - return getVersionFormat(); - } /** * Returns the log entry version to use for this sink's exported log entries. This version does @@ -763,13 +615,6 @@ public Builder toBuilder() { return new BuilderImpl(this); } - /** - * Returns a builder for {@code SinkInfo} objects given the name of the sink and its destination. - */ - @Deprecated - public static Builder builder(String name, Destination destination) { - return newBuilder(name, destination); - } /** * Returns a builder for {@code SinkInfo} objects given the name of the sink and its destination. diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/testing/RemoteLoggingHelper.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/testing/RemoteLoggingHelper.java index 79ff035e4f38..4fdd02c4c09c 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/testing/RemoteLoggingHelper.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/testing/RemoteLoggingHelper.java @@ -45,13 +45,6 @@ private RemoteLoggingHelper(LoggingOptions options) { this.options = options; } - /** - * Returns a {@link LoggingOptions} object to be used for testing. - */ - @Deprecated - public LoggingOptions options() { - return getOptions(); - } /** * Returns a {@link LoggingOptions} object to be used for testing. diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/HttpRequestTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/HttpRequestTest.java index ca8fece87ee0..8cc69232d719 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/HttpRequestTest.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/HttpRequestTest.java @@ -58,21 +58,6 @@ public class HttpRequestTest { .setCacheValidatedWithOriginServer(CACHE_VALIDATED_WITH_ORIGIN_SERVER) .setCacheFillBytes(CACHE_FILL_BYTES) .build(); - private static final HttpRequest DEPRECATED_HTTP_REQUEST = HttpRequest.builder() - .requestMethod(REQUEST_METHOD) - .requestUrl(REQUEST_URL) - .requestSize(REQUEST_SIZE) - .status(STATUS) - .responseSize(REPONSE_SIZE) - .userAgent(USER_AGENT) - .remoteIp(REMOTE_IP) - .serverIp(SERVER_IP) - .referer(REFERER) - .cacheLookup(CACHE_LOOKUP) - .cacheHit(CACHE_HIT) - .cacheValidatedWithOriginServer(CACHE_VALIDATED_WITH_ORIGIN_SERVER) - .cacheFillBytes(CACHE_FILL_BYTES) - .build(); @Rule public ExpectedException thrown = ExpectedException.none(); @@ -94,23 +79,6 @@ public void testBuilder() { assertEquals(CACHE_FILL_BYTES, HTTP_REQUEST.getCacheFillBytes()); } - @Test - public void testBuilderDeprecated() { - assertEquals(REQUEST_METHOD, DEPRECATED_HTTP_REQUEST.requestMethod()); - assertEquals(REQUEST_URL, DEPRECATED_HTTP_REQUEST.requestUrl()); - assertEquals(REQUEST_SIZE, DEPRECATED_HTTP_REQUEST.requestSize()); - assertEquals(STATUS, DEPRECATED_HTTP_REQUEST.status()); - assertEquals(REPONSE_SIZE, DEPRECATED_HTTP_REQUEST.responseSize()); - assertEquals(USER_AGENT, DEPRECATED_HTTP_REQUEST.userAgent()); - assertEquals(REMOTE_IP, DEPRECATED_HTTP_REQUEST.remoteIp()); - assertEquals(SERVER_IP, DEPRECATED_HTTP_REQUEST.serverIp()); - assertEquals(REFERER, DEPRECATED_HTTP_REQUEST.referer()); - assertEquals(CACHE_LOOKUP, DEPRECATED_HTTP_REQUEST.cacheLookup()); - assertEquals(CACHE_HIT, DEPRECATED_HTTP_REQUEST.cacheHit()); - assertEquals(CACHE_VALIDATED_WITH_ORIGIN_SERVER, - DEPRECATED_HTTP_REQUEST.cacheValidatedWithOriginServer()); - assertEquals(CACHE_FILL_BYTES, DEPRECATED_HTTP_REQUEST.cacheFillBytes()); - } @Test public void testBuilderDefaultValues() { diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/LogEntryTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/LogEntryTest.java index 0f6c0f1c7d94..85e2bd81ccde 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/LogEntryTest.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/LogEntryTest.java @@ -83,36 +83,6 @@ public class LogEntryTest { .setLabels(LABELS) .setOperation(OPERATION) .build(); - private static final LogEntry DEPRECATED_STRING_ENTRY = LogEntry.builder(STRING_PAYLOAD) - .logName(LOG_NAME) - .resource(RESOURCE) - .timestamp(TIMESTAMP) - .severity(SEVERITY) - .insertId(INSERT_ID) - .httpRequest(HTTP_REQUEST) - .labels(LABELS) - .operation(OPERATION) - .build(); - private static final LogEntry DEPRECATED_JSON_ENTRY = LogEntry.builder(JSON_PAYLOAD) - .logName(LOG_NAME) - .resource(RESOURCE) - .timestamp(TIMESTAMP) - .severity(SEVERITY) - .insertId(INSERT_ID) - .httpRequest(HTTP_REQUEST) - .labels(LABELS) - .operation(OPERATION) - .build(); - private static final LogEntry DEPRECATED_PROTO_ENTRY = LogEntry.builder(PROTO_PAYLOAD) - .logName(LOG_NAME) - .resource(RESOURCE) - .timestamp(TIMESTAMP) - .severity(SEVERITY) - .insertId(INSERT_ID) - .httpRequest(HTTP_REQUEST) - .labels(LABELS) - .operation(OPERATION) - .build(); @Test public void testOf() { @@ -191,57 +161,6 @@ public void testBuilder() { assertEquals(StringPayload.of("otherPayload"), logEntry.getPayload()); } - @Test - public void testBuilderDeprecated() { - assertEquals(LOG_NAME, DEPRECATED_STRING_ENTRY.logName()); - assertEquals(RESOURCE, DEPRECATED_STRING_ENTRY.resource()); - assertEquals(TIMESTAMP, (long) DEPRECATED_STRING_ENTRY.timestamp()); - assertEquals(SEVERITY, DEPRECATED_STRING_ENTRY.severity()); - assertEquals(INSERT_ID, DEPRECATED_STRING_ENTRY.insertId()); - assertEquals(HTTP_REQUEST, DEPRECATED_STRING_ENTRY.httpRequest()); - assertEquals(LABELS, DEPRECATED_STRING_ENTRY.labels()); - assertEquals(OPERATION, DEPRECATED_STRING_ENTRY.operation()); - assertEquals(STRING_PAYLOAD, DEPRECATED_STRING_ENTRY.payload()); - assertEquals(LOG_NAME, DEPRECATED_JSON_ENTRY.logName()); - assertEquals(RESOURCE, DEPRECATED_JSON_ENTRY.resource()); - assertEquals(TIMESTAMP, (long) DEPRECATED_JSON_ENTRY.timestamp()); - assertEquals(SEVERITY, DEPRECATED_JSON_ENTRY.severity()); - assertEquals(INSERT_ID, DEPRECATED_JSON_ENTRY.insertId()); - assertEquals(HTTP_REQUEST, DEPRECATED_JSON_ENTRY.httpRequest()); - assertEquals(LABELS, DEPRECATED_JSON_ENTRY.labels()); - assertEquals(OPERATION, DEPRECATED_JSON_ENTRY.operation()); - assertEquals(JSON_PAYLOAD, DEPRECATED_JSON_ENTRY.payload()); - assertEquals(LOG_NAME, DEPRECATED_PROTO_ENTRY.logName()); - assertEquals(RESOURCE, DEPRECATED_PROTO_ENTRY.resource()); - assertEquals(TIMESTAMP, (long) DEPRECATED_PROTO_ENTRY.timestamp()); - assertEquals(SEVERITY, DEPRECATED_PROTO_ENTRY.severity()); - assertEquals(INSERT_ID, DEPRECATED_PROTO_ENTRY.insertId()); - assertEquals(HTTP_REQUEST, DEPRECATED_PROTO_ENTRY.httpRequest()); - assertEquals(LABELS, DEPRECATED_PROTO_ENTRY.labels()); - assertEquals(OPERATION, DEPRECATED_PROTO_ENTRY.operation()); - assertEquals(PROTO_PAYLOAD, DEPRECATED_PROTO_ENTRY.payload()); - LogEntry logEntry = LogEntry.builder(STRING_PAYLOAD) - .payload(StringPayload.of("otherPayload")) - .logName(LOG_NAME) - .resource(RESOURCE) - .timestamp(TIMESTAMP) - .severity(SEVERITY) - .insertId(INSERT_ID) - .httpRequest(HTTP_REQUEST) - .addLabel("key1", "value1") - .addLabel("key2", "value2") - .operation(OPERATION) - .build(); - assertEquals(LOG_NAME, logEntry.logName()); - assertEquals(RESOURCE, logEntry.resource()); - assertEquals(TIMESTAMP, (long) logEntry.timestamp()); - assertEquals(SEVERITY, logEntry.severity()); - assertEquals(INSERT_ID, logEntry.insertId()); - assertEquals(HTTP_REQUEST, logEntry.httpRequest()); - assertEquals(LABELS, logEntry.labels()); - assertEquals(OPERATION, logEntry.operation()); - assertEquals(StringPayload.of("otherPayload"), logEntry.payload()); - } @Test public void testToBuilder() { diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingLevelTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingLevelTest.java index 3c5ccee1884b..ed657492fc18 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingLevelTest.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingLevelTest.java @@ -28,7 +28,6 @@ public class LoggingLevelTest { @Test public void testDebug() { LoggingLevel debug = LoggingLevel.DEBUG; - assertEquals(Severity.DEBUG, debug.severity()); assertEquals(Severity.DEBUG, debug.getSeverity()); assertEquals("DEBUG", debug.getName()); assertTrue(debug.intValue() < Level.FINEST.intValue()); @@ -38,7 +37,6 @@ public void testDebug() { @Test public void testNotice() { LoggingLevel notice = LoggingLevel.NOTICE; - assertEquals(Severity.NOTICE, notice.severity()); assertEquals(Severity.NOTICE, notice.getSeverity()); assertEquals("NOTICE", notice.getName()); assertTrue(notice.intValue() > Level.INFO.intValue()); @@ -48,7 +46,6 @@ public void testNotice() { @Test public void testError() { LoggingLevel error = LoggingLevel.ERROR; - assertEquals(Severity.ERROR, error.severity()); assertEquals(Severity.ERROR, error.getSeverity()); assertEquals("ERROR", error.getName()); assertTrue(error.intValue() > Level.WARNING.intValue()); @@ -58,7 +55,6 @@ public void testError() { @Test public void testCritical() { LoggingLevel critical = LoggingLevel.CRITICAL; - assertEquals(Severity.CRITICAL, critical.severity()); assertEquals(Severity.CRITICAL, critical.getSeverity()); assertEquals("CRITICAL", critical.getName()); assertTrue(critical.intValue() > LoggingLevel.SEVERE.intValue()); @@ -68,7 +64,6 @@ public void testCritical() { @Test public void testAlert() { LoggingLevel alert = LoggingLevel.ALERT; - assertEquals(Severity.ALERT, alert.severity()); assertEquals(Severity.ALERT, alert.getSeverity()); assertEquals("ALERT", alert.getName()); assertTrue(alert.intValue() > LoggingLevel.CRITICAL.intValue()); @@ -78,7 +73,6 @@ public void testAlert() { @Test public void testEmergency() { LoggingLevel emergency = LoggingLevel.EMERGENCY; - assertEquals(Severity.EMERGENCY, emergency.severity()); assertEquals(Severity.EMERGENCY, emergency.getSeverity()); assertEquals("EMERGENCY", emergency.getName()); assertTrue(emergency.intValue() > LoggingLevel.ALERT.intValue()); diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/MetricInfoTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/MetricInfoTest.java index 8e1682dc1701..15214fb96cf4 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/MetricInfoTest.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/MetricInfoTest.java @@ -32,9 +32,6 @@ public class MetricInfoTest { private static final MetricInfo METRIC_INFO = MetricInfo.newBuilder(NAME, FILTER) .setDescription(DESCRIPTION) .build(); - private static final MetricInfo DEPRECATED_METRIC_INFO = MetricInfo.builder(NAME, FILTER) - .description(DESCRIPTION) - .build(); @Test public void testOf() { @@ -51,20 +48,6 @@ public void testBuilder() { assertEquals(DESCRIPTION, METRIC_INFO.getDescription()); } - @Test - public void testBuilderDeprecated() { - assertEquals(NAME, DEPRECATED_METRIC_INFO.getName()); - assertEquals(FILTER, DEPRECATED_METRIC_INFO.getFilter()); - assertEquals(DESCRIPTION, DEPRECATED_METRIC_INFO.getDescription()); - MetricInfo metricInfo = DEPRECATED_METRIC_INFO.toBuilder() - .name(NEW_NAME) - .description(NEW_DESCRIPTION) - .filter(NEW_FILTER) - .build(); - assertEquals(NEW_NAME, metricInfo.name()); - assertEquals(NEW_FILTER, metricInfo.filter()); - assertEquals(NEW_DESCRIPTION, metricInfo.description()); - } @Test public void testToBuilder() { diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/MetricTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/MetricTest.java index 1fa008c72f16..cd024f003306 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/MetricTest.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/MetricTest.java @@ -82,20 +82,6 @@ public void testBuilder() { assertSame(serviceMockReturnsOptions, builtMetric.getLogging()); } - @Test - public void testBuilderDeprecated() { - initializeExpectedMetric(2); - replay(logging); - Metric builtMetric = expectedMetric.toBuilder() - .name(NEW_NAME) - .filter(NEW_FILTER) - .description(NEW_DESCRIPTION) - .build(); - assertEquals(NEW_NAME, builtMetric.name()); - assertEquals(NEW_DESCRIPTION, builtMetric.description()); - assertEquals(NEW_FILTER, builtMetric.filter()); - assertSame(serviceMockReturnsOptions, builtMetric.logging()); - } @Test public void testToBuilder() { diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/OperationTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/OperationTest.java index 1b7601379b05..1d26b1935a95 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/OperationTest.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/OperationTest.java @@ -32,10 +32,6 @@ public class OperationTest { .setFirst(FIRST) .setLast(LAST) .build(); - private static final Operation DEPRECATED_OPERATION = Operation.builder(ID, PRODUCER) - .first(FIRST) - .last(LAST) - .build(); @Test public void testBuilder() { @@ -45,23 +41,6 @@ public void testBuilder() { assertFalse(OPERATION.last()); } - @Test - public void testBuilderDeprecated() { - assertEquals(ID, DEPRECATED_OPERATION.id()); - assertEquals(PRODUCER, DEPRECATED_OPERATION.producer()); - assertTrue(DEPRECATED_OPERATION.first()); - assertFalse(DEPRECATED_OPERATION.last()); - Operation operation = DEPRECATED_OPERATION.toBuilder() - .id("newId") - .producer("newProducer") - .first(false) - .last(true) - .build(); - assertEquals("newId", operation.id()); - assertEquals("newProducer", operation.producer()); - assertFalse(operation.first()); - assertTrue(operation.last()); - } @Test public void testToBuilder() { diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/PayloadTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/PayloadTest.java index bc77fc3df0bc..4207318c09f9 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/PayloadTest.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/PayloadTest.java @@ -109,20 +109,6 @@ public void testOf() { assertEquals(JSON_DATA, jsonPayload.getDataAsMap()); } - @Test - public void testOfDeprecated() { - assertEquals(Type.STRING, STRING_PAYLOAD.type()); - assertEquals(STRING_DATA, STRING_PAYLOAD.data()); - assertEquals(Type.JSON, JSON_PAYLOAD.type()); - assertEquals(STRUCT_DATA, JSON_PAYLOAD.data()); - assertEquals(JSON_DATA, JSON_PAYLOAD.dataAsMap()); - assertEquals(Type.PROTO, PROTO_PAYLOAD.type()); - assertEquals(PROTO_DATA, PROTO_PAYLOAD.data()); - JsonPayload jsonPayload = JsonPayload.of(STRUCT_DATA); - assertEquals(Type.JSON, jsonPayload.type()); - assertEquals(STRUCT_DATA, jsonPayload.data()); - assertEquals(JSON_DATA, jsonPayload.dataAsMap()); - } @Test public void testToAndFromPb() { diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/SinkInfoTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/SinkInfoTest.java index 265f52d428d1..14c492297300 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/SinkInfoTest.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/SinkInfoTest.java @@ -52,21 +52,6 @@ public class SinkInfoTest { .setFilter(FILTER) .setVersionFormat(VERSION) .build(); - private static final SinkInfo DEPRECATED_BUCKET_SINK_INFO = - SinkInfo.builder(NAME, BUCKET_DESTINATION) - .filter(FILTER) - .versionFormat(VERSION) - .build(); - private static final SinkInfo DEPRECATED_DATASET_SINK_INFO = - SinkInfo.builder(NAME, DATASET_DESTINATION) - .filter(FILTER) - .versionFormat(VERSION) - .build(); - private static final SinkInfo DEPRECATED_TOPIC_SINK_INFO = - SinkInfo.builder(NAME, TOPIC_DESTINATION) - .filter(FILTER) - .versionFormat(VERSION) - .build(); @Rule public ExpectedException thrown = ExpectedException.none(); @@ -77,11 +62,6 @@ public void testOfBucketDestination() { assertEquals("bucket", BUCKET_DESTINATION.getBucket()); } - @Test - public void testOfBucketDestinationDeprecated() { - assertEquals(Destination.Type.BUCKET, BUCKET_DESTINATION.type()); - assertEquals("bucket", BUCKET_DESTINATION.bucket()); - } @Test public void testOfDatasetDestination() { @@ -93,15 +73,6 @@ public void testOfDatasetDestination() { assertEquals("dataset", datasetDestination.getDataset()); } - @Test - public void testOfDatasetDestinationDeprecated() { - assertEquals(Destination.Type.DATASET, DATASET_DESTINATION.type()); - assertEquals("project", DATASET_DESTINATION.project()); - assertEquals("dataset", DATASET_DESTINATION.dataset()); - DatasetDestination datasetDestination = DatasetDestination.of("dataset"); - assertNull(datasetDestination.project()); - assertEquals("dataset", datasetDestination.dataset()); - } @Test public void testOfTopicDestination() { @@ -113,15 +84,6 @@ public void testOfTopicDestination() { assertEquals("topic", topicDestination.getTopic()); } - @Test - public void testOfTopicDestinationDeprecated() { - assertEquals(Destination.Type.TOPIC, TOPIC_DESTINATION.type()); - assertEquals("project", TOPIC_DESTINATION.project()); - assertEquals("topic", TOPIC_DESTINATION.topic()); - TopicDestination topicDestination = TopicDestination.of("topic"); - assertNull(topicDestination.project()); - assertEquals("topic", topicDestination.topic()); - } @Test public void testToAndFromPbDestination() { @@ -172,31 +134,6 @@ public void testBuilder() { assertEquals(VERSION, TOPIC_SINK_INFO.getVersionFormat()); } - @Test - public void testBuilderDeprecated() { - assertEquals(NAME, DEPRECATED_BUCKET_SINK_INFO.name()); - assertEquals(BUCKET_DESTINATION, DEPRECATED_BUCKET_SINK_INFO.destination()); - assertEquals(FILTER, DEPRECATED_BUCKET_SINK_INFO.filter()); - assertEquals(VERSION, DEPRECATED_BUCKET_SINK_INFO.versionFormat()); - assertEquals(NAME, DEPRECATED_DATASET_SINK_INFO.name()); - assertEquals(DATASET_DESTINATION, DEPRECATED_DATASET_SINK_INFO.destination()); - assertEquals(FILTER, DEPRECATED_DATASET_SINK_INFO.filter()); - assertEquals(VERSION, DEPRECATED_DATASET_SINK_INFO.versionFormat()); - assertEquals(NAME, DEPRECATED_TOPIC_SINK_INFO.name()); - assertEquals(TOPIC_DESTINATION, DEPRECATED_TOPIC_SINK_INFO.destination()); - assertEquals(FILTER, DEPRECATED_TOPIC_SINK_INFO.filter()); - assertEquals(VERSION, DEPRECATED_TOPIC_SINK_INFO.versionFormat()); - SinkInfo updatedSinkInfo = DEPRECATED_BUCKET_SINK_INFO.toBuilder() - .destination(TOPIC_DESTINATION) - .name("newName") - .filter("logName=projects/my-projectid/logs/syslog") - .versionFormat(VersionFormat.V2) - .build(); - assertEquals("newName", updatedSinkInfo.name()); - assertEquals(TOPIC_DESTINATION, updatedSinkInfo.destination()); - assertEquals("logName=projects/my-projectid/logs/syslog", updatedSinkInfo.filter()); - assertEquals(VersionFormat.V2, updatedSinkInfo.versionFormat()); - } @Test public void testToBuilder() { diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/SinkTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/SinkTest.java index 4b4d79284d90..c3b9861c3789 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/SinkTest.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/SinkTest.java @@ -90,21 +90,6 @@ public void testBuilder() { assertEquals(NEW_VERSION, builtSink.getVersionFormat()); } - @Test - public void testBuilderDeprecated() { - initializeExpectedSink(2); - replay(logging); - Sink builtSink = expectedSink.toBuilder() - .name(NEW_NAME) - .filter(NEW_FILTER) - .destination(DATASET_DESTINATION) - .versionFormat(NEW_VERSION) - .build(); - assertEquals(NEW_NAME, builtSink.name()); - assertEquals(DATASET_DESTINATION, builtSink.destination()); - assertEquals(NEW_FILTER, builtSink.filter()); - assertEquals(NEW_VERSION, builtSink.versionFormat()); - } @Test public void testToBuilder() { diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/PubSub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/PubSub.java index d9e845fcc69a..3d69789c3816 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/PubSub.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/PubSub.java @@ -796,7 +796,7 @@ interface MessageConsumer extends AutoCloseable { /** * Acknowledges the given messages for the provided subscription. Ack ids identify the messages to - * acknowledge, as returned in {@link ReceivedMessage#ackId()} by {@link #pull(String, int)} and + * acknowledge, as returned in {@link ReceivedMessage#getAckId()} by {@link #pull(String, int)} and * {@link #pullAsync(String, int)}. * *

    Example of acking one message. @@ -823,7 +823,7 @@ interface MessageConsumer extends AutoCloseable { /** * Sends a request to acknowledge the given messages for the provided subscription. Ack ids - * identify the messages to acknowledge, as returned in {@link ReceivedMessage#ackId()} by + * identify the messages to acknowledge, as returned in {@link ReceivedMessage#getAckId()} by * {@link #pull(String, int)} and {@link #pullAsync(String, int)}. The method returns a * {@code Future} object that can be used to wait for the acknowledge operation to be completed. * @@ -854,8 +854,8 @@ interface MessageConsumer extends AutoCloseable { /** * Acknowledges the given messages for the provided subscription. Ack ids identify the messages to - * acknowledge, as returned in {@link ReceivedMessage#ackId()} by {@link #pull(String, int)} and - * {@link #pullAsync(String, int)}. + * acknowledge, as returned in {@link ReceivedMessage#getAckId()} by {@link #pull(String, int)} + * and {@link #pullAsync(String, int)}. * *

    Example of acking a list of messages. *

     {@code
    @@ -876,7 +876,7 @@ interface MessageConsumer extends AutoCloseable {
     
       /**
        * Sends a request to acknowledge the given messages for the provided subscription. Ack ids
    -   * identify the messages to acknowledge, as returned in {@link ReceivedMessage#ackId()} by
    +   * identify the messages to acknowledge, as returned in {@link ReceivedMessage#getAckId()} by
        * {@link #pull(String, int)} and {@link #pullAsync(String, int)}. The method returns a
        * {@code Future} object that can be used to wait for the acknowledge operation to be completed.
        *
    @@ -900,7 +900,7 @@ interface MessageConsumer extends AutoCloseable {
     
       /**
        * "Nacks" the given messages for the provided subscription. Ack ids identify the messages to
    -   * "nack", as returned in {@link ReceivedMessage#ackId()} by {@link #pull(String, int)} and
    +   * "nack", as returned in {@link ReceivedMessage#getAckId()} by {@link #pull(String, int)} and
        * {@link #pullAsync(String, int)}. This method corresponds to calling
        * {@link #modifyAckDeadline(String, int, TimeUnit, String, String...)} with a deadline of 0.
        *
    @@ -928,7 +928,7 @@ interface MessageConsumer extends AutoCloseable {
     
       /**
        * Sends a request to "nack" the given messages for the provided subscription. Ack ids identify
    -   * the messages to "nack", as returned in {@link ReceivedMessage#ackId()} by
    +   * the messages to "nack", as returned in {@link ReceivedMessage#getAckId()} by
        * {@link #pull(String, int)} and {@link #pullAsync(String, int)}. This method corresponds to
        * calling {@link #modifyAckDeadlineAsync(String, int, TimeUnit, String, String...)} with a
        * deadline of 0. The method returns a {@code Future} object that can be used to wait for the
    @@ -961,7 +961,7 @@ interface MessageConsumer extends AutoCloseable {
     
       /**
        * "Nacks" the given messages for the provided subscription. Ack ids identify the messages to
    -   * "nack", as returned in {@link ReceivedMessage#ackId()} by {@link #pull(String, int)} and
    +   * "nack", as returned in {@link ReceivedMessage#getAckId()} by {@link #pull(String, int)} and
        * {@link #pullAsync(String, int)}. This method corresponds to calling
        * {@link #modifyAckDeadline(String, int, TimeUnit, Iterable)} with a deadline of 0.
        *
    @@ -984,7 +984,7 @@ interface MessageConsumer extends AutoCloseable {
     
       /**
        * Sends a request to "nack" the given messages for the provided subscription. Ack ids identify
    -   * the messages to "nack", as returned in {@link ReceivedMessage#ackId()} by
    +   * the messages to "nack", as returned in {@link ReceivedMessage#getAckId()} by
        * {@link #pull(String, int)} and {@link #pullAsync(String, int)}. This method corresponds to
        * calling {@link #modifyAckDeadlineAsync(String, int, TimeUnit, Iterable)} with a deadline of 0.
        * The method returns a {@code Future} object that can be used to wait for the "nack" operation to
    @@ -1217,7 +1217,7 @@ Future modifyAckDeadlineAsync(String subscription, int deadline, TimeUnit
        * 

    It is recommended that you use the read-modify-write pattern. This pattern entails reading * the project's current policy, updating it locally, and then sending the modified policy for * writing. Cloud IAM solves the problem of conflicting processes simultaneously attempting to - * modify a policy by using the {@link Policy#etag etag} property. This property is used to + * modify a policy by using the {@link Policy#getEtag etag} property. This property is used to * verify whether the policy has changed since the last request. When you make a request with an * etag value, the value in the request is compared with the existing etag value associated with * the policy. The policy is written only if the etag values match. If the etags don't match, @@ -1336,7 +1336,7 @@ Future modifyAckDeadlineAsync(String subscription, int deadline, TimeUnit *

    It is recommended that you use the read-modify-write pattern. This pattern entails reading * the project's current policy, updating it locally, and then sending the modified policy for * writing. Cloud IAM solves the problem of conflicting processes simultaneously attempting to - * modify a policy by using the {@link Policy#etag etag} property. This property is used to + * modify a policy by using the {@link Policy#getEtag etag} property. This property is used to * verify whether the policy has changed since the last request. When you make a request with an * etag value, the value in the request is compared with the existing etag value associated with * the policy. The policy is written only if the etag values match. If the etags don't match, a diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/PubSubImpl.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/PubSubImpl.java index 83843bf8b296..d23bce0bc5d1 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/PubSubImpl.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/PubSubImpl.java @@ -154,12 +154,6 @@ private static class TopicPageFetcher extends BasePageFetcher { super(serviceOptions, cursor, requestOptions); } - @Override - @Deprecated - public Future> nextPage() { - return getNextPage(); - } - @Override public Future> getNextPage() { return listTopicsAsync(serviceOptions(), requestOptions()); @@ -175,12 +169,6 @@ private static class SubscriptionPageFetcher extends BasePageFetcher> nextPage() { - return getNextPage(); - } - @Override public Future> getNextPage() { return listSubscriptionsAsync(serviceOptions(), requestOptions()); @@ -199,12 +187,6 @@ private static class SubscriptionNamePageFetcher extends BasePageFetcher> nextPage() { - return getNextPage(); - } - @Override public Future> getNextPage() { return listSubscriptionsAsync(topic, serviceOptions(), requestOptions()); @@ -449,6 +431,7 @@ public Page listSubscriptions(ListOption... options) { return get(listSubscriptionsAsync(options)); } + @Override public Future> listSubscriptionsAsync(ListOption... options) { return listSubscriptionsAsync(getOptions(), optionMap(options)); } diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/Subscription.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/Subscription.java index bcbb769fed9a..8456d6926719 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/Subscription.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/Subscription.java @@ -481,7 +481,7 @@ public Future getPolicyAsync() { *

    It is recommended that you use the read-modify-write pattern. This pattern entails reading * the project's current policy, updating it locally, and then sending the modified policy for * writing. Cloud IAM solves the problem of conflicting processes simultaneously attempting to - * modify a policy by using the {@link Policy#etag etag} property. This property is used to + * modify a policy by using the {@link Policy#getEtag etag} property. This property is used to * verify whether the policy has changed since the last request. When you make a request with an * etag value, the value in the request is compared with the existing etag value associated with * the policy. The policy is written only if the etag values match. If the etags don't match, a @@ -511,7 +511,7 @@ public Policy replacePolicy(Policy newPolicy) { *

    It is recommended that you use the read-modify-write pattern. This pattern entails reading * the project's current policy, updating it locally, and then sending the modified policy for * writing. Cloud IAM solves the problem of conflicting processes simultaneously attempting to - * modify a policy by using the {@link Policy#etag etag} property. This property is used to + * modify a policy by using the {@link Policy#getEtag etag} property. This property is used to * verify whether the policy has changed since the last request. When you make a request with an * etag value, the value in the request is compared with the existing etag value associated with * the policy. The policy is written only if the etag values match. If the etags don't match, diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/SubscriptionInfo.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/SubscriptionInfo.java index 81fb26e8f675..fa105d51a3ba 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/SubscriptionInfo.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/SubscriptionInfo.java @@ -279,8 +279,8 @@ public TopicId topic() { } /** - * Returns the identity of the topic this subscription refers to. If {@link TopicId#project()} is - * {@code null} the topic is assumed to reside in the {@link PubSubOptions#getProjectId()} + * Returns the identity of the topic this subscription refers to. If {@link TopicId#getProject()} + * is {@code null} the topic is assumed to reside in the {@link PubSubOptions#getProjectId()} * project. After a topic is deleted, existing subscriptions to that topic are not deleted, but * their topic field is set to {@link TopicId#deletedTopic()}. */ diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/Topic.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/Topic.java index 548c95832e2c..392588cc1f58 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/Topic.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/deprecated/Topic.java @@ -456,7 +456,7 @@ public Policy replacePolicy(Policy newPolicy) { *

    It is recommended that you use the read-modify-write pattern. This pattern entails reading * the project's current policy, updating it locally, and then sending the modified policy for * writing. Cloud IAM solves the problem of conflicting processes simultaneously attempting to - * modify a policy by using the {@link Policy#etag etag} property. This property is used to + * modify a policy by using the {@link Policy#getEtag etag} property. This property is used to * verify whether the policy has changed since the last request. When you make a request with an * etag value, the value in the request is compared with the existing etag value associated with * the policy. The policy is written only if the etag values match. If the etags don't match, diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/MessageDispatcher.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/MessageDispatcher.java index d215eb3a6599..c43f03bc1c6b 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/MessageDispatcher.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/MessageDispatcher.java @@ -109,6 +109,7 @@ public int compareTo(ExtensionJob other) { return expiration.compareTo(other.expiration); } + @Override public String toString() { ArrayList ackIds = new ArrayList<>(); for (AckHandler ah : ackHandlers) { @@ -137,6 +138,7 @@ public void addAckId(String ackId) { ackIds.add(ackId); } + @Override public String toString() { return String.format( "PendingModifyAckDeadline{extension: %d sec, ackIds: %s}", @@ -146,7 +148,7 @@ public String toString() { /** * Handles callbacks for acking/nacking messages from the {@link - * com.google.cloud.pubsub.deprecated.MessageReceiver}. + * com.google.cloud.pubsub.spi.v1.MessageReceiver}. */ private class AckHandler implements FutureCallback { private final String ackId; diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/MessageReceiver.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/MessageReceiver.java index ab0a90979c01..181bdf943612 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/MessageReceiver.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/MessageReceiver.java @@ -27,7 +27,7 @@ public interface MessageReceiver { *

    This {@code MessageReceiver} passes all messages to a {@code BlockingQueue}. * This method can be called concurrently from multiple threads, * so it is important that the queue be thread-safe. - * + * * This example is for illustration. Implementations may directly process messages * instead of sending them to queues. *

     {@code
    diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PollingSubscriberConnection.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PollingSubscriberConnection.java
    index 4b865832be35..2c3b6d7fa84c 100644
    --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PollingSubscriberConnection.java
    +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PollingSubscriberConnection.java
    @@ -48,7 +48,7 @@
     import org.joda.time.Duration;
     
     /**
    - * Implementation of {@link AbstractSubscriberConnection} based on Cloud Pub/Sub pull and
    + * Implementation of {@link AckProcessor} based on Cloud Pub/Sub pull and
      * acknowledge operations.
      */
     final class PollingSubscriberConnection extends AbstractService implements AckProcessor {
    diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Publisher.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Publisher.java
    index 11dd87a27f5f..ebb0329d9b12 100644
    --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Publisher.java
    +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Publisher.java
    @@ -174,8 +174,8 @@ public TopicName getTopicName() {
        * be delayed based on the publisher bundling options.
        *
        * 

    Depending on chosen flow control {@link #failOnFlowControlLimits option}, the returned - * future might immediately fail with a {@link FlowController.FlowControlException} or block the - * current thread until there are more resources available to publish. + * future might immediately fail with a {@link com.google.api.gax.grpc.FlowController.FlowControlException} + * or block the current thread until there are more resources available to publish. * *

    Example of publishing a message. *

     {@code
    @@ -485,9 +485,9 @@ public FlowControlSettings getFlowControlSettings() {
        * #getFlowControlSettings()}).
        *
        * 

    If set to false, a publish call will fail with either {@link - * FlowController.MaxOutstandingRequestBytesReachedException} or {@link - * FlowController.MaxOutstandingElementCountReachedException}, as appropriate, when flow control - * limits are reached. + * com.google.api.gax.grpc.FlowController.MaxOutstandingRequestBytesReachedException} or {@link + * com.google.api.gax.grpc.FlowController.MaxOutstandingElementCountReachedException}, as + * appropriate, when flow contro limits are reached. */ public boolean failOnFlowControlLimits() { return failOnFlowControlLimits; @@ -667,8 +667,9 @@ public Builder setFlowControlSettings(FlowControlSettings flowControlSettings) { /** * Whether to fail publish when reaching any of the flow control limits, with either a {@link - * FlowController.MaxOutstandingRequestBytesReachedException} or {@link - * FlowController.MaxOutstandingElementCountReachedException} as appropriate. + * com.google.api.gax.grpc.FlowController.MaxOutstandingRequestBytesReachedException} or {@link + * com.google.api.gax.grpc.FlowController.MaxOutstandingElementCountReachedException} as + * appropriate. * *

    If set to false, then publish operations will block the current thread until the * outstanding requests go under the limits. diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/StreamingSubscriberConnection.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/StreamingSubscriberConnection.java index df68736d32d9..8f2d121b3e6e 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/StreamingSubscriberConnection.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/StreamingSubscriberConnection.java @@ -49,7 +49,7 @@ import javax.annotation.Nullable; import org.joda.time.Duration; -/** Implementation of {@link AbstractSubscriberConnection} based on Cloud Pub/Sub streaming pull. */ +/** Implementation of {@link AckProcessor} based on Cloud Pub/Sub streaming pull. */ final class StreamingSubscriberConnection extends AbstractService implements AckProcessor { private static final Logger logger = Logger.getLogger(StreamingSubscriberConnection.class.getName()); diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MessageWaiterTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MessageWaiterTest.java index 94840e1ee0ed..0c38e89ad060 100644 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MessageWaiterTest.java +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MessageWaiterTest.java @@ -24,7 +24,7 @@ import org.junit.runners.JUnit4; /** - * Tests for {@link PublisherImpl}. + * Tests for {@link MessageWaiter}. */ @RunWith(JUnit4.class) public class MessageWaiterTest { @@ -33,9 +33,9 @@ public class MessageWaiterTest { public void test() throws Exception { final MessageWaiter waiter = new MessageWaiter(); waiter.incrementPendingMessages(1); - + final AtomicBoolean waitReached = new AtomicBoolean(); - + Thread t = new Thread(new Runnable(){ @Override public void run() { @@ -46,10 +46,10 @@ public void run() { } }); t.start(); - + waiter.waitNoMessages(waitReached); t.join(); - + assertEquals(0, waiter.pendingMessages()); } } diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/SubscriberImplTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/SubscriberImplTest.java index f5f422434cb0..164c9948562d 100644 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/SubscriberImplTest.java +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/SubscriberImplTest.java @@ -56,7 +56,7 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -/** Tests for {@link SubscriberImpl}. */ +/** Tests for {@link Subscriber}. */ @RunWith(Parameterized.class) public class SubscriberImplTest { diff --git a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/Project.java b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/Project.java index 1927ecc5adaf..9c5f158ff73d 100644 --- a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/Project.java +++ b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/Project.java @@ -53,11 +53,6 @@ public static class Builder extends ProjectInfo.Builder { this.infoBuilder = new ProjectInfo.BuilderImpl(project); } - @Override - @Deprecated - public Builder name(String name) { - return setName(name); - } @Override public Builder setName(String name) { @@ -65,11 +60,6 @@ public Builder setName(String name) { return this; } - @Override - @Deprecated - public Builder projectId(String projectId) { - return setProjectId(projectId); - } @Override public Builder setProjectId(String projectId) { @@ -95,11 +85,6 @@ public Builder clearLabels() { return this; } - @Override - @Deprecated - public Builder labels(Map labels) { - return setLabels(labels); - } @Override public Builder setLabels(Map labels) { @@ -143,13 +128,6 @@ public Project build() { this.options = resourceManager.getOptions(); } - /** - * Returns the {@link ResourceManager} service object associated with this Project. - */ - @Deprecated - public ResourceManager resourceManager() { - return getResourceManager(); - } /** * Returns the {@link ResourceManager} service object associated with this Project. diff --git a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ProjectInfo.java b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ProjectInfo.java index 9b8fe7c0cbe0..b40c518cbded 100644 --- a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ProjectInfo.java +++ b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ProjectInfo.java @@ -122,15 +122,6 @@ static ResourceId fromPb( */ public abstract static class Builder { - /** - * Set the user-assigned name of the project. - * - *

    This field is optional and can remain unset. Allowed characters are: lowercase and - * uppercase letters, numbers, hyphen, single-quote, double-quote, space, and exclamation point. - * This field can be changed after project creation. - */ - @Deprecated - public abstract Builder name(String name); /** * Set the user-assigned name of the project. @@ -141,15 +132,6 @@ public abstract static class Builder { */ public abstract Builder setName(String name); - /** - * Set the unique, user-assigned ID of the project. - * - *

    The ID must be 6 to 30 lowercase letters, digits, or hyphens. It must start with a letter. - * Trailing hyphens are prohibited. This field cannot be changed after the server creates the - * project. - */ - @Deprecated - public abstract Builder projectId(String projectId); /** * Set the unique, user-assigned ID of the project. @@ -177,17 +159,6 @@ public abstract static class Builder { */ public abstract Builder clearLabels(); - /** - * Set the labels associated with this project. - * - *

    Label keys must be between 1 and 63 characters long and must conform to the following - * regular expression: [a-z]([-a-z0-9]*[a-z0-9])?. Label values must be between 0 and 63 - * characters long and must conform to the regular expression ([a-z]([-a-z0-9]*[a-z0-9])?)?. No - * more than 256 labels can be associated with a given resource. This field can be changed after - * project creation. - */ - @Deprecated - public abstract Builder labels(Map labels); /** * Set the labels associated with this project. @@ -235,11 +206,6 @@ static class BuilderImpl extends Builder { this.parent = info.parent; } - @Override - @Deprecated - public Builder name(String name) { - return setName(name); - } @Override public Builder setName(String name) { @@ -247,11 +213,6 @@ public Builder setName(String name) { return this; } - @Override - @Deprecated - public Builder projectId(String projectId) { - return setProjectId(projectId); - } @Override public Builder setProjectId(String projectId) { @@ -277,11 +238,6 @@ public Builder clearLabels() { return this; } - @Override - @Deprecated - public Builder labels(Map labels) { - return setLabels(labels); - } @Override public Builder setLabels(Map labels) { @@ -329,15 +285,6 @@ public ProjectInfo build() { this.parent = builder.parent; } - /** - * Get the unique, user-assigned ID of the project. - * - *

    This field cannot be changed after the server creates the project. - */ - @Deprecated - public String projectId() { - return getProjectId(); - } /** * Get the unique, user-assigned ID of the project. @@ -348,15 +295,6 @@ public String getProjectId() { return projectId; } - /** - * Get the user-assigned name of the project. - * - *

    This field is optional, can remain unset, and can be changed after project creation. - */ - @Deprecated - public String name() { - return getName(); - } /** * Get the user-assigned name of the project. @@ -367,15 +305,6 @@ public String getName() { return Data.isNull(name) ? null : name; } - /** - * Get number uniquely identifying the project. - * - *

    This field is set by the server and is read-only. - */ - @Deprecated - public Long projectNumber() { - return getProjectNumber(); - } /** * Get number uniquely identifying the project. @@ -386,13 +315,6 @@ public Long getProjectNumber() { return projectNumber; } - /** - * Get the immutable map of labels associated with this project. - */ - @Deprecated - public Map labels() { - return getLabels(); - } /** * Get the immutable map of labels associated with this project. @@ -401,16 +323,6 @@ public Map getLabels() { return labels; } - /** - * Get the project's lifecycle state. - * - *

    This is a read-only field. To change the lifecycle state of your project, use the - * {@code delete} or {@code undelete} method. - */ - @Deprecated - public State state() { - return state; - } /** * Get the project's lifecycle state. @@ -426,15 +338,6 @@ ResourceId getParent() { return parent; } - /** - * Get the project's creation time (in milliseconds). - * - *

    This field is set by the server and is read-only. - */ - @Deprecated - public Long createTimeMillis() { - return getCreateTimeMillis(); - } /** * Get the project's creation time (in milliseconds). @@ -458,10 +361,6 @@ public int hashCode() { return Objects.hash(name, projectId, labels, projectNumber, state, createTimeMillis, parent); } - @Deprecated - public static Builder builder(String id) { - return newBuilder(id); - } public static Builder newBuilder(String id) { return new BuilderImpl(id); diff --git a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManager.java b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManager.java index 694c7d1a4542..bf2c80b34513 100644 --- a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManager.java +++ b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManager.java @@ -58,11 +58,6 @@ enum ProjectField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } @Override public String getSelector() { @@ -298,7 +293,7 @@ public static ProjectListOption fields(ProjectField... fields) { *

    It is recommended that you use the read-modify-write pattern. This pattern entails reading * the project's current policy, updating it locally, and then sending the modified policy for * writing. Cloud IAM solves the problem of conflicting processes simultaneously attempting to - * modify a policy by using the {@link Policy#etag etag} property. This property is used to + * modify a policy by using the {@link Policy#getEtag etag} property. This property is used to * verify whether the policy has changed since the last request. When you make a request to Cloud * IAM with an etag value, Cloud IAM compares the etag value in the request with the existing etag * value associated with the policy. It writes the policy only if the etag values match. If the diff --git a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerImpl.java b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerImpl.java index 46b0dc1ff6ca..5c1069d1c170 100644 --- a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerImpl.java +++ b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerImpl.java @@ -107,11 +107,6 @@ private static class ProjectPageFetcher implements NextPageFetcher { this.serviceOptions = serviceOptions; } - @Override - @Deprecated - public Page nextPage() { - return getNextPage(); - } @Override public Page getNextPage() { diff --git a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerOptions.java b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerOptions.java index 7b893fe4d98e..ec18271d3ba3 100644 --- a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerOptions.java +++ b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerOptions.java @@ -41,13 +41,6 @@ public ResourceManager create(ResourceManagerOptions options) { } } - /** - * Returns a default {@code ResourceManagerOptions} instance. - */ - @Deprecated - public static ResourceManagerOptions defaultInstance() { - return getDefaultInstance(); - } /** * Returns a default {@code ResourceManagerOptions} instance. @@ -126,10 +119,6 @@ public Builder toBuilder() { return new Builder(this); } - @Deprecated - public static Builder builder() { - return newBuilder(); - } public static Builder newBuilder() { return new Builder(); diff --git a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/testing/LocalResourceManagerHelper.java b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/testing/LocalResourceManagerHelper.java index 45c3af96df0d..1f574cceb070 100644 --- a/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/testing/LocalResourceManagerHelper.java +++ b/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/testing/LocalResourceManagerHelper.java @@ -672,13 +672,6 @@ public static LocalResourceManagerHelper create() { return new LocalResourceManagerHelper(); } - /** - * Returns a {@link ResourceManagerOptions} instance that sets the host to use the mock server. - */ - @Deprecated - public ResourceManagerOptions options() { - return getOptions(); - } /** * Returns a {@link ResourceManagerOptions} instance that sets the host to use the mock server. diff --git a/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ProjectInfoTest.java b/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ProjectInfoTest.java index b2ca95207ad6..6ffc86f34369 100644 --- a/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ProjectInfoTest.java +++ b/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ProjectInfoTest.java @@ -48,14 +48,6 @@ public class ProjectInfoTest { ProjectInfo.newBuilder(PROJECT_ID).build(); private static final ProjectInfo UNNAMED_PROJECT_FROM_LIST = PARTIAL_PROJECT_INFO.toBuilder().setName("Unnamed").build(); - private static final ProjectInfo DEPRECATED_PROJECT_INFO = ProjectInfo.builder(PROJECT_ID) - .name(NAME) - .labels(LABELS) - .setProjectNumber(PROJECT_NUMBER) - .setCreateTimeMillis(CREATE_TIME_MILLIS) - .setState(STATE) - .setParent(PARENT) - .build(); @Test public void testBuilder() { @@ -74,23 +66,6 @@ public void testBuilder() { assertEquals(null, PARTIAL_PROJECT_INFO.getState()); } - @Test - public void testBuilderDeprecated() { - assertEquals(PROJECT_ID, DEPRECATED_PROJECT_INFO.projectId()); - assertEquals(NAME, DEPRECATED_PROJECT_INFO.name()); - assertEquals(LABELS, DEPRECATED_PROJECT_INFO.labels()); - assertEquals(PROJECT_NUMBER, DEPRECATED_PROJECT_INFO.projectNumber()); - assertEquals(CREATE_TIME_MILLIS, DEPRECATED_PROJECT_INFO.createTimeMillis()); - assertEquals(STATE, DEPRECATED_PROJECT_INFO.state()); - - assertEquals(PROJECT_ID, PARTIAL_PROJECT_INFO.projectId()); - assertEquals(null, PARTIAL_PROJECT_INFO.name()); - assertTrue(PARTIAL_PROJECT_INFO.labels().isEmpty()); - assertEquals(null, PARTIAL_PROJECT_INFO.projectNumber()); - assertEquals(null, PARTIAL_PROJECT_INFO.createTimeMillis()); - assertEquals(null, PARTIAL_PROJECT_INFO.state()); - } - @Test public void testToBuilder() { compareProjects(FULL_PROJECT_INFO, FULL_PROJECT_INFO.toBuilder().build()); diff --git a/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ProjectTest.java b/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ProjectTest.java index c98a9a000381..8522c9b3ab93 100644 --- a/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ProjectTest.java +++ b/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/ProjectTest.java @@ -134,28 +134,6 @@ public void testBuilder() { assertEquals(parent, project.getParent()); } - @Test - public void testBuilderDeprecated() { - expect(resourceManager.getOptions()).andReturn(mockOptions).times(4); - replay(resourceManager); - Project.Builder builder = - new Project.Builder(new Project(resourceManager, new ProjectInfo.BuilderImpl("wrong-id"))); - Project project = builder.projectId(PROJECT_ID) - .name(NAME) - .labels(LABELS) - .setProjectNumber(PROJECT_NUMBER) - .setCreateTimeMillis(CREATE_TIME_MILLIS) - .setState(STATE) - .build(); - assertEquals(PROJECT_ID, project.projectId()); - assertEquals(NAME, project.name()); - assertEquals(LABELS, project.labels()); - assertEquals(PROJECT_NUMBER, project.projectNumber()); - assertEquals(CREATE_TIME_MILLIS, project.createTimeMillis()); - assertEquals(STATE, project.state()); - assertEquals(resourceManager.getOptions(), project.resourceManager().getOptions()); - assertNull(project.getParent()); - } @Test public void testGet() { diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/InstanceInfo.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/InstanceInfo.java index 775114d27fa8..bba232f985ce 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/InstanceInfo.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/InstanceInfo.java @@ -41,11 +41,6 @@ public enum InstanceField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } @Override public String getSelector() { diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java index 0bc26a577847..41bc6b8ffb86 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java @@ -345,11 +345,6 @@ private T unpack(Any response, Class clazz) throws Spanne private abstract class PageFetcher implements NextPageFetcher { private String nextPageToken; - @Deprecated - @Override - public Page nextPage() { - return getNextPage(); - } @Override public Page getNextPage() { diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/Acl.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/Acl.java index 365ce71a4021..95bfabe8ffe3 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/Acl.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/Acl.java @@ -81,14 +81,6 @@ private Builder(Acl acl) { this.etag = acl.etag; } - /** - * Sets the entity for the ACL object. - */ - @Deprecated - public Builder entity(Entity entity) { - return setEntity(entity); - } - /** * Sets the entity for the ACL object. */ @@ -97,14 +89,6 @@ public Builder setEntity(Entity entity) { return this; } - /** - * Sets the role to associate to the {@code entity} object. - */ - @Deprecated - public Builder role(Role role) { - return setRole(role); - } - /** * Sets the role to associate to the {@code entity} object. */ @@ -150,14 +134,6 @@ public enum Type { this.value = value; } - /** - * Returns the type of entity. - */ - @Deprecated - public Type type() { - return getType(); - } - /** * Returns the type of entity. */ @@ -165,14 +141,6 @@ public Type getType() { return type; } - /** - * Returns the entity's value. - */ - @Deprecated - protected String value() { - return getValue(); - } - /** * Returns the entity's value. */ @@ -248,14 +216,6 @@ public Domain(String domain) { super(Type.DOMAIN, domain); } - /** - * Returns the domain associated to this entity. - */ - @Deprecated - public String domain() { - return getDomain(); - } - /** * Returns the domain associated to this entity. */ @@ -280,14 +240,6 @@ public Group(String email) { super(Type.GROUP, email); } - /** - * Returns the group email. - */ - @Deprecated - public String email() { - return getEmail(); - } - /** * Returns the group email. */ @@ -314,14 +266,6 @@ public User(String email) { super(Type.USER, email); } - /** - * Returns the user email. - */ - @Deprecated - public String email() { - return getEmail(); - } - /** * Returns the user email. */ @@ -377,14 +321,6 @@ public Project(ProjectRole projectRole, String projectId) { this.projectId = projectId; } - /** - * Returns the role in the project for this entity. - */ - @Deprecated - public ProjectRole projectRole() { - return getProjectRole(); - } - /** * Returns the role in the project for this entity. */ @@ -392,14 +328,6 @@ public ProjectRole getProjectRole() { return projectRole; } - /** - * Returns the project id for this entity. - */ - @Deprecated - public String projectId() { - return getProjectId(); - } - /** * Returns the project id for this entity. */ @@ -429,14 +357,6 @@ private Acl(Builder builder) { this.etag = builder.etag; } - /** - * Returns the entity for this ACL object. - */ - @Deprecated - public Entity entity() { - return getEntity(); - } - /** * Returns the entity for this ACL object. */ @@ -444,14 +364,6 @@ public Entity getEntity() { return entity; } - /** - * Returns the role associated to the entity in this ACL object. - */ - @Deprecated - public Role role() { - return getRole(); - } - /** * Returns the role associated to the entity in this ACL object. */ @@ -459,14 +371,6 @@ public Role getRole() { return role; } - /** - * Returns the ID of the ACL entry. - */ - @Deprecated - public String id() { - return getId(); - } - /** * Returns the ID of the ACL entry. */ @@ -474,16 +378,6 @@ public String getId() { return id; } - /** - * Returns HTTP 1.1 Entity tag for the ACL entry. - * - * @see Entity Tags - */ - @Deprecated - public String etag() { - return getEtag(); - } - /** * Returns HTTP 1.1 Entity tag for the ACL entry. * @@ -510,17 +404,6 @@ public static Acl of(Entity entity, Role role) { return newBuilder(entity, role).build(); } - /** - * Returns a builder for {@code Acl} objects. - * - * @param entity the entity for this ACL object - * @param role the role to associate to the {@code entity} object - */ - @Deprecated - public static Builder builder(Entity entity, Role role) { - return newBuilder(entity, role); - } - /** * Returns a builder for {@code Acl} objects. * diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/Blob.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/Blob.java index 6c09cbecc12d..f188938381b3 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/Blob.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/Blob.java @@ -200,12 +200,6 @@ public static class Builder extends BlobInfo.Builder { this.infoBuilder = new BlobInfo.BuilderImpl(blob); } - @Override - @Deprecated - public Builder blobId(BlobId blobId) { - return setBlobId(blobId); - } - @Override public Builder setBlobId(BlobId blobId) { infoBuilder.setBlobId(blobId); @@ -218,47 +212,24 @@ Builder setGeneratedId(String generatedId) { return this; } - @Override - public Builder contentType(String contentType) { - return setContentType(contentType); - } - @Override public Builder setContentType(String contentType) { infoBuilder.setContentType(contentType); return this; } - @Override - @Deprecated - public Builder contentDisposition(String contentDisposition) { - return setContentDisposition(contentDisposition); - } - @Override public Builder setContentDisposition(String contentDisposition) { infoBuilder.setContentDisposition(contentDisposition); return this; } - @Override - @Deprecated - public Builder contentLanguage(String contentLanguage) { - return setContentLanguage(contentLanguage); - } - @Override public Builder setContentLanguage(String contentLanguage) { infoBuilder.setContentLanguage(contentLanguage); return this; } - @Override - @Deprecated - public Builder contentEncoding(String contentEncoding) { - return setContentEncoding(contentEncoding); - } - @Override public Builder setContentEncoding(String contentEncoding) { infoBuilder.setContentEncoding(contentEncoding); @@ -271,24 +242,12 @@ Builder setComponentCount(Integer componentCount) { return this; } - @Override - @Deprecated - public Builder cacheControl(String cacheControl) { - return setCacheControl(cacheControl); - } - @Override public Builder setCacheControl(String cacheControl) { infoBuilder.setCacheControl(cacheControl); return this; } - @Override - @Deprecated - public Builder acl(List acl) { - return setAcl(acl); - } - @Override public Builder setAcl(List acl) { infoBuilder.setAcl(acl); @@ -319,24 +278,12 @@ Builder setSelfLink(String selfLink) { return this; } - @Override - @Deprecated - public Builder md5(String md5) { - return setMd5(md5); - } - @Override public Builder setMd5(String md5) { infoBuilder.setMd5(md5); return this; } - @Override - @Deprecated - public Builder crc32c(String crc32c) { - return setCrc32c(crc32c); - } - @Override public Builder setCrc32c(String crc32c) { infoBuilder.setCrc32c(crc32c); @@ -349,12 +296,6 @@ Builder setMediaLink(String mediaLink) { return this; } - @Override - @Deprecated - public Builder metadata(Map metadata) { - return setMetadata(metadata); - } - @Override public Builder setMetadata(Map metadata) { infoBuilder.setMetadata(metadata); @@ -433,22 +374,11 @@ public boolean exists(BlobSourceOption... options) { return storage.get(getBlobId(), getOptions) != null; } - /** - * Returns this blob's content. - * - * @param options blob read options - * @throws StorageException upon failure - */ - @Deprecated - public byte[] content(BlobSourceOption... options) { - return storage.readAllBytes(getBlobId(), toSourceOptions(this, options)); - } - /** * Returns this blob's content. * *

    Example of reading all bytes of the blob, if its generation matches the - * {@link Blob#generation()} value, otherwise a {@link StorageException} is thrown. + * {@link Blob#getGeneration()} value, otherwise a {@link StorageException} is thrown. *

     {@code
        * byte[] content = blob.getContent(BlobSourceOption.generationMatch());
        * }
    @@ -464,7 +394,7 @@ public byte[] getContent(BlobSourceOption... options) { * Fetches current blob's latest information. Returns {@code null} if the blob does not exist. * *

    Example of getting the blob's latest information, if its generation does not match the - * {@link Blob#generation()} value, otherwise a {@link StorageException} is thrown. + * {@link Blob#getGeneration()} value, otherwise a {@link StorageException} is thrown. *

     {@code
        * Blob latestBlob = blob.reload(BlobSourceOption.generationNotMatch());
        * if (latestBlob == null) {
    @@ -512,8 +442,8 @@ public Blob update(BlobTargetOption... options) {
       /**
        * Deletes this blob.
        *
    -   * 

    Example of deleting the blob, if its generation matches the {@link Blob#generation()} value, - * otherwise a {@link StorageException} is thrown. + *

    Example of deleting the blob, if its generation matches the {@link Blob#getGeneration()} + * value, otherwise a {@link StorageException} is thrown. *

     {@code
        * boolean deleted = blob.delete(BlobSourceOption.generationMatch());
        * if (deleted) {
    @@ -804,14 +734,6 @@ public List listAcls() {
         return storage.listAcls(getBlobId());
       }
     
    -  /**
    -   * Returns the blob's {@code Storage} object used to issue requests.
    -   */
    -  @Deprecated
    -  public Storage storage() {
    -    return getStorage();
    -  }
    -
       /**
        * Returns the blob's {@code Storage} object used to issue requests.
        */
    diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobId.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobId.java
    index f24e5ea2a4ed..d2881eef95af 100644
    --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobId.java
    +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobId.java
    @@ -26,7 +26,7 @@
     
     /**
      * Google Storage Object identifier. A {@code BlobId} object includes the name of the containing
    - * bucket, the blob's name and possibly the blob's generation. If {@link #generation()} is
    + * bucket, the blob's name and possibly the blob's generation. If {@link #getGeneration()} is
      * {@code null} the identifier refers to the latest blob's generation.
      */
     public final class BlobId implements Serializable {
    @@ -42,14 +42,6 @@ private BlobId(String bucket, String name, Long generation) {
         this.generation = generation;
       }
     
    -  /**
    -   * Returns the name of the bucket containing the blob.
    -   */
    -  @Deprecated
    -  public String bucket() {
    -    return getBucket();
    -  }
    -
         /**
        * Returns the name of the bucket containing the blob.
        */
    @@ -57,14 +49,6 @@ public String getBucket() {
         return bucket;
       }
     
    -  /**
    -   * Returns the name of the blob.
    -   */
    -  @Deprecated
    -  public String name() {
    -    return getName();
    -  }
    -
         /**
        * Returns the name of the blob.
        */
    @@ -72,14 +56,6 @@ public String getName() {
         return name;
       }
     
    -  /**
    -   * Returns blob's data generation. Used for versioning.
    -   */
    -  @Deprecated
    -  public Long generation() {
    -    return getGeneration();
    -  }
    -
         /**
        * Returns blob's data generation. Used for versioning.
        */
    diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobInfo.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobInfo.java
    index 150a11d6793b..b15fe6e34fde 100644
    --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobInfo.java
    +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobInfo.java
    @@ -109,14 +109,6 @@ public static class CustomerEncryption implements Serializable {
           this.keySha256 = keySha256;
         }
     
    -    /**
    -     * Returns the algorithm used to encrypt the blob.
    -     */
    -    @Deprecated
    -    public String encryptionAlgorithm() {
    -      return getEncryptionAlgorithm();
    -    }
    -
         /**
          * Returns the algorithm used to encrypt the blob.
          */
    @@ -124,14 +116,6 @@ public String getEncryptionAlgorithm() {
           return encryptionAlgorithm;
         }
     
    -    /**
    -     * Returns the SHA256 hash of the encryption key.
    -     */
    -    @Deprecated
    -    public String keySha256() {
    -      return getKeySha256();
    -    }
    -
         /**
          * Returns the SHA256 hash of the encryption key.
          */
    @@ -177,12 +161,6 @@ static CustomerEncryption fromPb(StorageObject.CustomerEncryption customerEncryp
        */
       public abstract static class Builder {
     
    -    /**
    -     * Sets the blob identity.
    -     */
    -    @Deprecated
    -    public abstract Builder blobId(BlobId blobId);
    -
         /**
          * Sets the blob identity.
          */
    @@ -190,14 +168,6 @@ public abstract static class Builder {
     
         abstract Builder setGeneratedId(String generatedId);
     
    -    /**
    -     * Sets the blob's data content type.
    -     *
    -     * @see Content-Type
    -     */
    -    @Deprecated
    -    public abstract Builder contentType(String contentType);
    -
         /**
          * Sets the blob's data content type.
          *
    @@ -205,14 +175,6 @@ public abstract static class Builder {
          */
         public abstract Builder setContentType(String contentType);
     
    -    /**
    -     * Sets the blob's data content disposition.
    -     *
    -     * @see Content-Disposition
    -     */
    -    @Deprecated
    -    public abstract Builder contentDisposition(String contentDisposition);
    -
         /**
          * Sets the blob's data content disposition.
          *
    @@ -220,14 +182,6 @@ public abstract static class Builder {
          */
         public abstract Builder setContentDisposition(String contentDisposition);
     
    -    /**
    -     * Sets the blob's data content language.
    -     *
    -     * @see Content-Language
    -     */
    -    @Deprecated
    -    public abstract Builder contentLanguage(String contentLanguage);
    -
         /**
          * Sets the blob's data content language.
          *
    @@ -235,14 +189,6 @@ public abstract static class Builder {
          */
         public abstract Builder setContentLanguage(String contentLanguage);
     
    -    /**
    -     * Sets the blob's data content encoding.
    -     *
    -     * @see Content-Encoding
    -     */
    -    @Deprecated
    -    public abstract Builder contentEncoding(String contentEncoding);
    -
         /**
          * Sets the blob's data content encoding.
          *
    @@ -252,14 +198,6 @@ public abstract static class Builder {
     
         abstract Builder setComponentCount(Integer componentCount);
     
    -    /**
    -     * Sets the blob's data cache control.
    -     *
    -     * @see Cache-Control
    -     */
    -    @Deprecated
    -    public abstract Builder cacheControl(String cacheControl);
    -
         /**
          * Sets the blob's data cache control.
          *
    @@ -267,16 +205,6 @@ public abstract static class Builder {
          */
         public abstract Builder setCacheControl(String cacheControl);
     
    -    /**
    -     * Sets the blob's access control configuration.
    -     *
    -     * @see 
    -     *     About Access Control Lists
    -     */
    -    @Deprecated
    -    public abstract Builder acl(List acl);
    -
         /**
          * Sets the blob's access control configuration.
          *
    @@ -294,15 +222,6 @@ public abstract static class Builder {
     
         abstract Builder setSelfLink(String selfLink);
     
    -    /**
    -     * Sets the MD5 hash of blob's data. MD5 value must be encoded in base64.
    -     *
    -     * @see 
    -     *     Hashes and ETags: Best Practices
    -     */
    -    @Deprecated
    -    public abstract Builder md5(String md5);
    -
         /**
          * Sets the MD5 hash of blob's data. MD5 value must be encoded in base64.
          *
    @@ -311,17 +230,6 @@ public abstract static class Builder {
          */
         public abstract Builder setMd5(String md5);
     
    -    /**
    -     * Sets the CRC32C checksum of blob's data as described in
    -     * RFC 4960, Appendix B; encoded in
    -     * base64 in big-endian order.
    -     *
    -     * @see 
    -     *     Hashes and ETags: Best Practices
    -     */
    -    @Deprecated
    -    public abstract Builder crc32c(String crc32c);
    -
         /**
          * Sets the CRC32C checksum of blob's data as described in
          * RFC 4960, Appendix B; encoded in
    @@ -334,12 +242,6 @@ public abstract static class Builder {
     
         abstract Builder setMediaLink(String mediaLink);
     
    -    /**
    -     * Sets the blob's user provided metadata.
    -     */
    -    @Deprecated
    -    public abstract Builder metadata(Map metadata);
    -
         /**
          * Sets the blob's user provided metadata.
          */
    @@ -419,12 +321,6 @@ static final class BuilderImpl extends Builder {
           isDirectory = blobInfo.isDirectory;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder blobId(BlobId blobId) {
    -      return setBlobId(blobId);
    -    }
    -
         @Override
         public Builder setBlobId(BlobId blobId) {
           this.blobId = checkNotNull(blobId);
    @@ -437,48 +333,24 @@ Builder setGeneratedId(String generatedId) {
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder contentType(String contentType) {
    -      return setContentType(contentType);
    -    }
    -
         @Override
         public Builder setContentType(String contentType) {
           this.contentType = firstNonNull(contentType, Data.nullOf(String.class));
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder contentDisposition(String contentDisposition) {
    -      return setContentDisposition(contentDisposition);
    -    }
    -
         @Override
         public Builder setContentDisposition(String contentDisposition) {
           this.contentDisposition = firstNonNull(contentDisposition, Data.nullOf(String.class));
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder contentLanguage(String contentLanguage) {
    -      return setContentLanguage(contentLanguage);
    -    }
    -
         @Override
         public Builder setContentLanguage(String contentLanguage) {
           this.contentLanguage = firstNonNull(contentLanguage, Data.nullOf(String.class));
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder contentEncoding(String contentEncoding) {
    -      return setContentEncoding(contentEncoding);
    -    }
    -
         @Override
         public Builder setContentEncoding(String contentEncoding) {
           this.contentEncoding = firstNonNull(contentEncoding, Data.nullOf(String.class));
    @@ -491,24 +363,12 @@ Builder setComponentCount(Integer componentCount) {
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder cacheControl(String cacheControl) {
    -      return setCacheControl(cacheControl);
    -    }
    -
         @Override
         public Builder setCacheControl(String cacheControl) {
           this.cacheControl = firstNonNull(cacheControl, Data.nullOf(String.class));
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder acl(List acl) {
    -      return setAcl(acl);
    -    }
    -
         @Override
         public Builder setAcl(List acl) {
           this.acl = acl != null ? ImmutableList.copyOf(acl) : null;
    @@ -539,24 +399,12 @@ Builder setSelfLink(String selfLink) {
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder md5(String md5) {
    -      return setMd5(md5);
    -    }
    -
         @Override
         public Builder setMd5(String md5) {
           this.md5 = firstNonNull(md5, Data.nullOf(String.class));
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder crc32c(String crc32c) {
    -      return setCrc32c(crc32c);
    -    }
    -
         @Override
         public Builder setCrc32c(String crc32c) {
           this.crc32c = firstNonNull(crc32c, Data.nullOf(String.class));
    @@ -569,12 +417,6 @@ Builder setMediaLink(String mediaLink) {
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder metadata(Map metadata) {
    -      return setMetadata(metadata);
    -    }
    -
         @Override
         public Builder setMetadata(Map metadata) {
           this.metadata = metadata != null
    @@ -651,14 +493,6 @@ public BlobInfo build() {
         isDirectory = firstNonNull(builder.isDirectory, Boolean.FALSE);
       }
     
    -  /**
    -   * Returns the blob's identity.
    -   */
    -  @Deprecated
    -  public BlobId blobId() {
    -    return getBlobId();
    -  }
    -
         /**
        * Returns the blob's identity.
        */
    @@ -666,14 +500,6 @@ public BlobId getBlobId() {
         return blobId;
       }
     
    -  /**
    -   * Returns the name of the containing bucket.
    -   */
    -  @Deprecated
    -  public String bucket() {
    -    return getBucket();
    -  }
    -
         /**
        * Returns the name of the containing bucket.
        */
    @@ -681,14 +507,6 @@ public String getBucket() {
         return getBlobId().getBucket();
       }
     
    -  /**
    -   * Returns the service-generated for the blob.
    -   */
    -  @Deprecated
    -  public String generatedId() {
    -    return getGeneratedId();
    -  }
    -
         /**
        * Returns the service-generated for the blob.
        */
    @@ -696,14 +514,6 @@ public String getGeneratedId() {
         return generatedId;
       }
     
    -  /**
    -   * Returns the blob's name.
    -   */
    -  @Deprecated
    -  public String name() {
    -    return getName();
    -  }
    -
         /**
        * Returns the blob's name.
        */
    @@ -711,16 +521,6 @@ public String getName() {
         return getBlobId().getName();
       }
     
    -  /**
    -   * Returns the blob's data cache control.
    -   *
    -   * @see Cache-Control
    -   */
    -  @Deprecated
    -  public String cacheControl() {
    -    return getCacheControl();
    -  }
    -
       /**
        * Returns the blob's data cache control.
        *
    @@ -730,17 +530,6 @@ public String getCacheControl() {
         return Data.isNull(cacheControl) ? null : cacheControl;
       }
     
    -  /**
    -   * Returns the blob's access control configuration.
    -   *
    -   * @see 
    -   *     About Access Control Lists
    -   */
    -  @Deprecated
    -  public List acl() {
    -    return getAcl();
    -  }
    -
       /**
        * Returns the blob's access control configuration.
        *
    @@ -751,14 +540,6 @@ public List getAcl() {
         return acl;
       }
     
    -  /**
    -   * Returns the blob's owner. This will always be the uploader of the blob.
    -   */
    -  @Deprecated
    -  public Acl.Entity owner() {
    -    return getOwner();
    -  }
    -
       /**
        * Returns the blob's owner. This will always be the uploader of the blob.
        */
    @@ -766,16 +547,6 @@ public Acl.Entity getOwner() {
         return owner;
       }
     
    -  /**
    -   * Returns the content length of the data in bytes.
    -   *
    -   * @see Content-Length
    -   */
    -  @Deprecated
    -  public Long size() {
    -    return getSize();
    -  }
    -
       /**
        * Returns the content length of the data in bytes.
        *
    @@ -785,16 +556,6 @@ public Long getSize() {
         return size;
       }
     
    -  /**
    -   * Returns the blob's data content type.
    -   *
    -   * @see Content-Type
    -   */
    -  @Deprecated
    -  public String contentType() {
    -    return getContentType();
    -  }
    -
       /**
        * Returns the blob's data content type.
        *
    @@ -804,16 +565,6 @@ public String getContentType() {
         return Data.isNull(contentType) ? null : contentType;
       }
     
    -  /**
    -   * Returns the blob's data content encoding.
    -   *
    -   * @see Content-Encoding
    -   */
    -  @Deprecated
    -  public String contentEncoding() {
    -    return getContentEncoding();
    -  }
    -
       /**
        * Returns the blob's data content encoding.
        *
    @@ -823,16 +574,6 @@ public String getContentEncoding() {
         return Data.isNull(contentEncoding) ? null : contentEncoding;
       }
     
    -  /**
    -   * Returns the blob's data content disposition.
    -   *
    -   * @see Content-Disposition
    -   */
    -  @Deprecated
    -  public String contentDisposition() {
    -    return getContentDisposition();
    -  }
    -
       /**
        * Returns the blob's data content disposition.
        *
    @@ -842,16 +583,6 @@ public String getContentDisposition() {
         return Data.isNull(contentDisposition) ? null : contentDisposition;
       }
     
    -  /**
    -   * Returns the blob's data content language.
    -   *
    -   * @see Content-Language
    -   */
    -  @Deprecated
    -  public String contentLanguage() {
    -    return getContentLanguage();
    -  }
    -
       /**
        * Returns the blob's data content language.
        *
    @@ -861,20 +592,6 @@ public String getContentLanguage() {
         return Data.isNull(contentLanguage) ? null : contentLanguage;
       }
     
    -  /**
    -   * Returns the number of components that make up this blob. Components are accumulated through
    -   * the {@link Storage#compose(Storage.ComposeRequest)} operation and are limited to a count of
    -   * 1024, counting 1 for each non-composite component blob and componentCount for each composite
    -   * component blob. This value is set only for composite blobs.
    -   *
    -   * @see Component Count
    -   *     Property
    -   */
    -  @Deprecated
    -  public Integer componentCount() {
    -    return getComponentCount();
    -  }
    -
       /**
        * Returns the number of components that make up this blob. Components are accumulated through
        * the {@link Storage#compose(Storage.ComposeRequest)} operation and are limited to a count of
    @@ -888,16 +605,6 @@ public Integer getComponentCount() {
         return componentCount;
       }
     
    -  /**
    -   * Returns HTTP 1.1 Entity tag for the blob.
    -   *
    -   * @see Entity Tags
    -   */
    -  @Deprecated
    -  public String etag() {
    -    return getEtag();
    -  }
    -
       /**
        * Returns HTTP 1.1 Entity tag for the blob.
        *
    @@ -907,14 +614,6 @@ public String getEtag() {
         return etag;
       }
     
    -  /**
    -   * Returns the URI of this blob as a string.
    -   */
    -  @Deprecated
    -  public String selfLink() {
    -    return getSelfLink();
    -  }
    -
       /**
        * Returns the URI of this blob as a string.
        */
    @@ -922,17 +621,6 @@ public String getSelfLink() {
         return selfLink;
       }
     
    -  /**
    -   * Returns the MD5 hash of blob's data encoded in base64.
    -   *
    -   * @see 
    -   *     Hashes and ETags: Best Practices
    -   */
    -  @Deprecated
    -  public String md5() {
    -    return getMd5();
    -  }
    -
       /**
        * Returns the MD5 hash of blob's data encoded in base64.
        *
    @@ -943,19 +631,6 @@ public String getMd5() {
         return Data.isNull(md5) ? null : md5;
       }
     
    -  /**
    -   * Returns the CRC32C checksum of blob's data as described in
    -   * RFC 4960, Appendix B; encoded in
    -   * base64 in big-endian order.
    -   *
    -   * @see 
    -   *     Hashes and ETags: Best Practices
    -   */
    -  @Deprecated
    -  public String crc32c() {
    -    return getCrc32c();
    -  }
    -
       /**
        * Returns the CRC32C checksum of blob's data as described in
        * RFC 4960, Appendix B; encoded in
    @@ -968,14 +643,6 @@ public String getCrc32c() {
         return Data.isNull(crc32c) ? null : crc32c;
       }
     
    -  /**
    -   * Returns the blob's media download link.
    -   */
    -  @Deprecated
    -  public String mediaLink() {
    -    return getMediaLink();
    -  }
    -
       /**
        * Returns the blob's media download link.
        */
    @@ -983,14 +650,6 @@ public String getMediaLink() {
         return mediaLink;
       }
     
    -  /**
    -   * Returns blob's user provided metadata.
    -   */
    -  @Deprecated
    -  public Map metadata() {
    -    return getMetadata();
    -  }
    -
       /**
        * Returns blob's user provided metadata.
        */
    @@ -998,14 +657,6 @@ public Map getMetadata() {
         return metadata == null || Data.isNull(metadata) ? null : Collections.unmodifiableMap(metadata);
       }
     
    -  /**
    -   * Returns blob's data generation. Used for blob versioning.
    -   */
    -  @Deprecated
    -  public Long generation() {
    -    return getGeneration();
    -  }
    -
       /**
        * Returns blob's data generation. Used for blob versioning.
        */
    @@ -1013,16 +664,6 @@ public Long getGeneration() {
         return getBlobId().getGeneration();
       }
     
    -  /**
    -   * Returns blob's metageneration. Used for preconditions and for detecting changes in metadata.
    -   * A metageneration number is only meaningful in the context of a particular generation of a
    -   * particular blob.
    -   */
    -  @Deprecated
    -  public Long metageneration() {
    -    return getMetageneration();
    -  }
    -
       /**
        * Returns blob's metageneration. Used for preconditions and for detecting changes in metadata.
        * A metageneration number is only meaningful in the context of a particular generation of a
    @@ -1032,14 +673,6 @@ public Long getMetageneration() {
         return metageneration;
       }
     
    -  /**
    -   * Returns the deletion time of the blob.
    -   */
    -  @Deprecated
    -  public Long deleteTime() {
    -    return getDeleteTime();
    -  }
    -
       /**
        * Returns the deletion time of the blob.
        */
    @@ -1047,14 +680,6 @@ public Long getDeleteTime() {
         return deleteTime;
       }
     
    -  /**
    -   * Returns the last modification time of the blob's metadata.
    -   */
    -  @Deprecated
    -  public Long updateTime() {
    -    return getUpdateTime();
    -  }
    -
         /**
        * Returns the last modification time of the blob's metadata.
        */
    @@ -1062,14 +687,6 @@ public Long getUpdateTime() {
         return updateTime;
       }
     
    -  /**
    -   * Returns the creation time of the blob.
    -   */
    -  @Deprecated
    -  public Long createTime() {
    -    return getCreateTime();
    -  }
    -
         /**
        * Returns the creation time of the blob.
        */
    @@ -1081,23 +698,14 @@ public Long getCreateTime() {
        * Returns {@code true} if the current blob represents a directory. This can only happen if the
        * blob is returned by {@link Storage#list(String, Storage.BlobListOption...)} when the
        * {@link Storage.BlobListOption#currentDirectory()} option is used. When this is the case only
    -   * {@link #blobId()} and {@link #size()} are set for the current blob: {@link BlobId#name()} ends
    -   * with the '/' character, {@link BlobId#generation()} returns {@code null} and {@link #size()} is
    -   * {@code 0}.
    +   * {@link #getBlobId()} and {@link #getSize()} are set for the current blob:
    +   * {@link BlobId#getName()} ends with the '/' character, {@link BlobId#getGeneration()} returns
    +   * {@code null} and {@link #getSize()} is {@code 0}.
        */
       public boolean isDirectory() {
         return isDirectory;
       }
     
    -  /**
    -   * Returns information on the customer-supplied encryption key, if the blob is encrypted using
    -   * such a key.
    -   */
    -  @Deprecated
    -  public CustomerEncryption customerEncryption() {
    -    return getCustomerEncryption();
    -  }
    -
       /**
        * Returns information on the customer-supplied encryption key, if the blob is encrypted using
        * such a key.
    @@ -1191,14 +799,6 @@ public ObjectAccessControl apply(Acl acl) {
         return storageObject;
       }
     
    -  /**
    -   * Returns a {@code BlobInfo} builder where blob identity is set using the provided values.
    -   */
    -  @Deprecated
    -  public static Builder builder(BucketInfo bucketInfo, String name) {
    -    return newBuilder(bucketInfo.getName(), name);
    -  }
    -
       /**
        * Returns a {@code BlobInfo} builder where blob identity is set using the provided values.
        */
    @@ -1206,14 +806,6 @@ public static Builder newBuilder(BucketInfo bucketInfo, String name) {
         return newBuilder(bucketInfo.getName(), name);
       }
     
    -  /**
    -   * Returns a {@code BlobInfo} builder where blob identity is set using the provided values.
    -   */
    -  @Deprecated
    -  public static Builder builder(String bucket, String name) {
    -    return newBuilder(BlobId.of(bucket, name));
    -  }
    -
       /**
        * Returns a {@code BlobInfo} builder where blob identity is set using the provided values.
        */
    @@ -1221,14 +813,6 @@ public static Builder newBuilder(String bucket, String name) {
         return newBuilder(BlobId.of(bucket, name));
       }
     
    -  /**
    -   * Returns a {@code BlobInfo} builder where blob identity is set using the provided values.
    -   */
    -  @Deprecated
    -  public static Builder builder(BucketInfo bucketInfo, String name, Long generation) {
    -    return newBuilder(bucketInfo.getName(), name, generation);
    -  }
    -
       /**
        * Returns a {@code BlobInfo} builder where blob identity is set using the provided values.
        */
    @@ -1236,14 +820,6 @@ public static Builder newBuilder(BucketInfo bucketInfo, String name, Long genera
         return newBuilder(bucketInfo.getName(), name, generation);
       }
     
    -  /**
    -   * Returns a {@code BlobInfo} builder where blob identity is set using the provided values.
    -   */
    -  @Deprecated
    -  public static Builder builder(String bucket, String name, Long generation) {
    -    return newBuilder(BlobId.of(bucket, name, generation));
    -  }
    -
       /**
        * Returns a {@code BlobInfo} builder where blob identity is set using the provided values.
        */
    @@ -1251,14 +827,6 @@ public static Builder newBuilder(String bucket, String name, Long generation) {
         return newBuilder(BlobId.of(bucket, name, generation));
       }
     
    -  /**
    -   * Returns a {@code BlobInfo} builder where blob identity is set using the provided value.
    -   */
    -  @Deprecated
    -  public static Builder builder(BlobId blobId) {
    -    return newBuilder(blobId);
    -  }
    -
       /**
        * Returns a {@code BlobInfo} builder where blob identity is set using the provided value.
        */
    diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobReadChannel.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobReadChannel.java
    index 2b9019701644..48f95a1cb240 100644
    --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobReadChannel.java
    +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobReadChannel.java
    @@ -107,11 +107,6 @@ public void seek(long position) throws IOException {
         endOfStream = false;
       }
     
    -  @Override
    -  @Deprecated
    -  public void chunkSize(int chunkSize) {
    -    setChunkSize(chunkSize);
    -  }
     
       @Override
       public void setChunkSize(int chunkSize) {
    diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java
    index ffde1389fab8..4c6aa4c45f41 100644
    --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java
    +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java
    @@ -469,12 +469,6 @@ public static class Builder extends BucketInfo.Builder {
           this.infoBuilder = new BucketInfo.BuilderImpl(bucket);
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder name(String name) {
    -      return setName(name);
    -    }
    -
         @Override
         public Builder setName(String name) {
           infoBuilder.setName(name);
    @@ -499,72 +493,36 @@ Builder setSelfLink(String selfLink) {
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder versioningEnabled(Boolean enable) {
    -      return setVersioningEnabled(enable);
    -    }
    -
         @Override
         public Builder setVersioningEnabled(Boolean enable) {
           infoBuilder.setVersioningEnabled(enable);
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder indexPage(String indexPage) {
    -      return setIndexPage(indexPage);
    -    }
    -
         @Override
         public Builder setIndexPage(String indexPage) {
           infoBuilder.setIndexPage(indexPage);
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder notFoundPage(String notFoundPage) {
    -      return setNotFoundPage(notFoundPage);
    -    }
    -
         @Override
         public Builder setNotFoundPage(String notFoundPage) {
           infoBuilder.setNotFoundPage(notFoundPage);
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder deleteRules(Iterable rules) {
    -      return setDeleteRules(rules);
    -    }
    -
         @Override
         public Builder setDeleteRules(Iterable rules) {
           infoBuilder.setDeleteRules(rules);
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder storageClass(String storageClass) {
    -      return setStorageClass(storageClass);
    -    }
    -
         @Override
         public Builder setStorageClass(String storageClass) {
           infoBuilder.setStorageClass(storageClass);
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder location(String location) {
    -      return setLocation(location);
    -    }
    -
         @Override
         public Builder setLocation(String location) {
           infoBuilder.setLocation(location);
    @@ -589,36 +547,18 @@ Builder setMetageneration(Long metageneration) {
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder cors(Iterable cors) {
    -      return setCors(cors);
    -    }
    -
         @Override
         public Builder setCors(Iterable cors) {
           infoBuilder.setCors(cors);
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder acl(Iterable acl) {
    -      return setAcl(acl);
    -    }
    -
         @Override
         public Builder setAcl(Iterable acl) {
           infoBuilder.setAcl(acl);
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder defaultAcl(Iterable acl) {
    -      return setDefaultAcl(acl);
    -    }
    -
         @Override
         public Builder setDefaultAcl(Iterable acl) {
           infoBuilder.setDefaultAcl(acl);
    @@ -664,7 +604,7 @@ public boolean exists(BucketSourceOption... options) {
        * Fetches current bucket's latest information. Returns {@code null} if the bucket does not exist.
        *
        * 

    Example of getting the bucket's latest information, if its generation does not match the - * {@link Bucket#metageneration()} value, otherwise a {@link StorageException} is thrown. + * {@link Bucket#getMetageneration()} value, otherwise a {@link StorageException} is thrown. *

     {@code
        * Bucket latestBucket = bucket.reload(BucketSourceOption.metagenerationMatch());
        * if (latestBucket == null) {
    @@ -704,7 +644,7 @@ public Bucket update(BucketTargetOption... options) {
        * Deletes this bucket.
        *
        * 

    Example of deleting the bucket, if its metageneration matches the - * {@link Bucket#metageneration()} value, otherwise a {@link StorageException} is thrown. + * {@link Bucket#getMetageneration()} value, otherwise a {@link StorageException} is thrown. *

     {@code
        * boolean deleted = bucket.delete(BucketSourceOption.metagenerationMatch());
        * if (deleted) {
    @@ -1101,14 +1041,6 @@ public List listDefaultAcls() {
         return storage.listDefaultAcls(getName());
       }
     
    -  /**
    -   * Returns the bucket's {@code Storage} object used to issue requests.
    -   */
    -  @Deprecated
    -  public Storage storage() {
    -    return getStorage();
    -  }
    -
       /**
        * Returns the bucket's {@code Storage} object used to issue requests.
        */
    diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java
    index 283d34b3bf5e..7a78e2b9ccb6 100644
    --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java
    +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java
    @@ -102,11 +102,6 @@ public enum Type {
           this.type = type;
         }
     
    -    @Deprecated
    -    public Type type() {
    -      return getType();
    -    }
    -
         public Type getType() {
           return type;
         }
    @@ -185,11 +180,6 @@ public AgeDeleteRule(int daysToLive) {
           this.daysToLive = daysToLive;
         }
     
    -    @Deprecated
    -    public int daysToLive() {
    -      return getDaysToLive();
    -    }
    -
         public int getDaysToLive() {
           return daysToLive;
         }
    @@ -254,11 +244,6 @@ public CreatedBeforeDeleteRule(long timeMillis) {
           this.timeMillis = timeMillis;
         }
     
    -    @Deprecated
    -    public long timeMillis() {
    -      return getTimeMillis();
    -    }
    -
         public long getTimeMillis() {
           return timeMillis;
         }
    @@ -291,11 +276,6 @@ public NumNewerVersionsDeleteRule(int numNewerVersions) {
           this.numNewerVersions = numNewerVersions;
         }
     
    -    @Deprecated
    -    public int numNewerVersions() {
    -      return getNumNewerVersions();
    -    }
    -
         public int getNumNewerVersions() {
           return numNewerVersions;
         }
    @@ -341,12 +321,6 @@ void populateCondition(Rule.Condition condition) {
        * Builder for {@code BucketInfo}.
        */
       public abstract static class Builder {
    -    /**
    -     * Sets the bucket's name.
    -     */
    -    @Deprecated
    -    public abstract Builder name(String name);
    -
         /**
          * Sets the bucket's name.
          */
    @@ -358,51 +332,23 @@ public abstract static class Builder {
     
         abstract Builder setSelfLink(String selfLink);
     
    -    /**
    -     * Sets whether versioning should be enabled for this bucket. When set to true, versioning is
    -     * fully enabled.
    -     */
    -    @Deprecated
    -    public abstract Builder versioningEnabled(Boolean enable);
    -
         /**
          * Sets whether versioning should be enabled for this bucket. When set to true, versioning is
          * fully enabled.
          */
         public abstract Builder setVersioningEnabled(Boolean enable);
     
    -    /**
    -     * Sets the bucket's website index page. Behaves as the bucket's directory index where missing
    -     * blobs are treated as potential directories.
    -     */
    -    @Deprecated
    -    public abstract Builder indexPage(String indexPage);
    -
         /**
          * Sets the bucket's website index page. Behaves as the bucket's directory index where missing
          * blobs are treated as potential directories.
          */
         public abstract Builder setIndexPage(String indexPage);
     
    -    /**
    -     * Sets the custom object to return when a requested resource is not found.
    -     */
    -    @Deprecated
    -    public abstract Builder notFoundPage(String notFoundPage);
    -
         /**
          * Sets the custom object to return when a requested resource is not found.
          */
         public abstract Builder setNotFoundPage(String notFoundPage);
     
    -    /**
    -     * Sets the bucket's lifecycle configuration as a number of delete rules.
    -     *
    -     * @see Lifecycle Management
    -     */
    -    @Deprecated
    -    public abstract Builder deleteRules(Iterable rules);
    -
         /**
          * Sets the bucket's lifecycle configuration as a number of delete rules.
          *
    @@ -410,14 +356,6 @@ public abstract static class Builder {
          */
         public abstract Builder setDeleteRules(Iterable rules);
     
    -    /**
    -     * Sets the bucket's storage class. This defines how blobs in the bucket are stored and
    -     * determines the SLA and the cost of storage. A list of supported values is available
    -     * here.
    -     */
    -    @Deprecated
    -    public abstract Builder storageClass(String storageClass);
    -
         /**
          * Sets the bucket's storage class. This defines how blobs in the bucket are stored and
          * determines the SLA and the cost of storage. A list of supported values is available
    @@ -425,14 +363,6 @@ public abstract static class Builder {
          */
         public abstract Builder setStorageClass(String storageClass);
     
    -    /**
    -     * Sets the bucket's location. Data for blobs in the bucket resides in physical storage within
    -     * this region. A list of supported values is available
    -     * here.
    -     */
    -    @Deprecated
    -    public abstract Builder location(String location);
    -
         /**
          * Sets the bucket's location. Data for blobs in the bucket resides in physical storage within
          * this region. A list of supported values is available
    @@ -446,15 +376,6 @@ public abstract static class Builder {
     
         abstract Builder setMetageneration(Long metageneration);
     
    -    /**
    -     * Sets the bucket's Cross-Origin Resource Sharing (CORS) configuration.
    -     *
    -     * @see 
    -     *     Cross-Origin Resource Sharing (CORS)
    -     */
    -    @Deprecated
    -    public abstract Builder cors(Iterable cors);
    -
         /**
          * Sets the bucket's Cross-Origin Resource Sharing (CORS) configuration.
          *
    @@ -463,16 +384,6 @@ public abstract static class Builder {
          */
         public abstract Builder setCors(Iterable cors);
     
    -    /**
    -     * Sets the bucket's access control configuration.
    -     *
    -     * @see 
    -     *     About Access Control Lists
    -     */
    -    @Deprecated
    -    public abstract Builder acl(Iterable acl);
    -
         /**
          * Sets the bucket's access control configuration.
          *
    @@ -482,17 +393,6 @@ public abstract static class Builder {
          */
         public abstract Builder setAcl(Iterable acl);
     
    -    /**
    -     * Sets the default access control configuration to apply to bucket's blobs when no other
    -     * configuration is specified.
    -     *
    -     * @see 
    -     *     About Access Control Lists
    -     */
    -    @Deprecated
    -    public abstract Builder defaultAcl(Iterable acl);
    -
         /**
          * Sets the default access control configuration to apply to bucket's blobs when no other
          * configuration is specified.
    @@ -551,12 +451,6 @@ static final class BuilderImpl extends Builder {
           deleteRules = bucketInfo.deleteRules;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder name(String name) {
    -      return setName(name);
    -    }
    -
         @Override
         public Builder setName(String name) {
           this.name = checkNotNull(name);
    @@ -581,72 +475,36 @@ Builder setSelfLink(String selfLink) {
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder versioningEnabled(Boolean enable) {
    -      return setVersioningEnabled(enable);
    -    }
    -
         @Override
         public Builder setVersioningEnabled(Boolean enable) {
           this.versioningEnabled = firstNonNull(enable, Data.nullOf(Boolean.class));
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder indexPage(String indexPage) {
    -      return setIndexPage(indexPage);
    -    }
    -
         @Override
         public Builder setIndexPage(String indexPage) {
           this.indexPage = indexPage;
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder notFoundPage(String notFoundPage) {
    -      return setNotFoundPage(notFoundPage);
    -    }
    -
         @Override
         public Builder setNotFoundPage(String notFoundPage) {
           this.notFoundPage = notFoundPage;
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder deleteRules(Iterable rules) {
    -      return setDeleteRules(rules);
    -    }
    -
         @Override
         public Builder setDeleteRules(Iterable rules) {
           this.deleteRules = rules != null ? ImmutableList.copyOf(rules) : null;
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder storageClass(String storageClass) {
    -      return setStorageClass(storageClass);
    -    }
    -
         @Override
         public Builder setStorageClass(String storageClass) {
           this.storageClass = storageClass;
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder location(String location) {
    -      return setLocation(location);
    -    }
    -
         @Override
         public Builder setLocation(String location) {
           this.location = location;
    @@ -671,36 +529,18 @@ Builder setMetageneration(Long metageneration) {
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder cors(Iterable cors) {
    -      return setCors(cors);
    -    }
    -
         @Override
         public Builder setCors(Iterable cors) {
           this.cors = cors != null ? ImmutableList.copyOf(cors) : null;
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder acl(Iterable acl) {
    -      return setAcl(acl);
    -    }
    -
         @Override
         public Builder setAcl(Iterable acl) {
           this.acl = acl != null ? ImmutableList.copyOf(acl) : null;
           return this;
         }
     
    -    @Override
    -    @Deprecated
    -    public Builder defaultAcl(Iterable acl) {
    -      return setDefaultAcl(acl);
    -    }
    -
         @Override
         public Builder setDefaultAcl(Iterable acl) {
           this.defaultAcl = acl != null ? ImmutableList.copyOf(acl) : null;
    @@ -733,14 +573,6 @@ public BucketInfo build() {
         deleteRules = builder.deleteRules;
       }
     
    -  /**
    -   * Returns the service-generated id for the bucket.
    -   */
    -  @Deprecated
    -  public String generatedId() {
    -    return getGeneratedId();
    -  }
    -
       /**
        * Returns the service-generated id for the bucket.
        */
    @@ -748,14 +580,6 @@ public String getGeneratedId() {
         return generatedId;
       }
     
    -  /**
    -   * Returns the bucket's name.
    -   */
    -  @Deprecated
    -  public String name() {
    -    return getName();
    -  }
    -
       /**
        * Returns the bucket's name.
        */
    @@ -763,14 +587,6 @@ public String getName() {
         return name;
       }
     
    -  /**
    -   * Returns the bucket's owner. This is always the project team's owner group.
    -   */
    -  @Deprecated
    -  public Entity owner() {
    -    return getOwner();
    -  }
    -
       /**
        * Returns the bucket's owner. This is always the project team's owner group.
        */
    @@ -778,14 +594,6 @@ public Entity getOwner() {
         return owner;
       }
     
    -  /**
    -   * Returns the URI of this bucket as a string.
    -   */
    -  @Deprecated
    -  public String selfLink() {
    -    return getSelfLink();
    -  }
    -
       /**
        * Returns the URI of this bucket as a string.
        */
    @@ -800,15 +608,6 @@ public Boolean versioningEnabled() {
         return Data.isNull(versioningEnabled) ? null : versioningEnabled;
       }
     
    -  /**
    -   * Returns bucket's website index page. Behaves as the bucket's directory index where missing
    -   * blobs are treated as potential directories.
    -   */
    -  @Deprecated
    -  public String indexPage() {
    -    return getIndexPage();
    -  }
    -
       /**
        * Returns bucket's website index page. Behaves as the bucket's directory index where missing
        * blobs are treated as potential directories.
    @@ -817,14 +616,6 @@ public String getIndexPage() {
         return indexPage;
       }
     
    -  /**
    -   * Returns the custom object to return when a requested resource is not found.
    -   */
    -  @Deprecated
    -  public String notFoundPage() {
    -    return getNotFoundPage();
    -  }
    -
       /**
        * Returns the custom object to return when a requested resource is not found.
        */
    @@ -832,16 +623,6 @@ public String getNotFoundPage() {
         return notFoundPage;
       }
     
    -  /**
    -   * Returns bucket's lifecycle configuration as a number of delete rules.
    -   *
    -   * @see Lifecycle Management
    -   */
    -  @Deprecated
    -  public List deleteRules() {
    -    return getDeleteRules();
    -  }
    -
       /**
        * Returns bucket's lifecycle configuration as a number of delete rules.
        *
    @@ -851,16 +632,6 @@ public List getDeleteRules() {
         return deleteRules;
       }
     
    -  /**
    -   * Returns HTTP 1.1 Entity tag for the bucket.
    -   *
    -   * @see Entity Tags
    -   */
    -  @Deprecated
    -  public String etag() {
    -    return getEtag();
    -  }
    -
       /**
        * Returns HTTP 1.1 Entity tag for the bucket.
        *
    @@ -870,14 +641,6 @@ public String getEtag() {
         return etag;
       }
     
    -  /**
    -   * Returns the time at which the bucket was created.
    -   */
    -  @Deprecated
    -  public Long createTime() {
    -    return getCreateTime();
    -  }
    -
       /**
        * Returns the time at which the bucket was created.
        */
    @@ -885,14 +648,6 @@ public Long getCreateTime() {
         return createTime;
       }
     
    -  /**
    -   * Returns the metadata generation of this bucket.
    -   */
    -  @Deprecated
    -  public Long metageneration() {
    -    return getMetageneration();
    -  }
    -
       /**
        * Returns the metadata generation of this bucket.
        */
    @@ -900,17 +655,6 @@ public Long getMetageneration() {
         return metageneration;
       }
     
    -  /**
    -   * Returns the bucket's location. Data for blobs in the bucket resides in physical storage within
    -   * this region.
    -   *
    -   * @see Bucket Locations
    -   */
    -  @Deprecated
    -  public String location() {
    -    return getLocation();
    -  }
    -
       /**
        * Returns the bucket's location. Data for blobs in the bucket resides in physical storage within
        * this region.
    @@ -921,17 +665,6 @@ public String getLocation() {
         return location;
       }
     
    -  /**
    -   * Returns the bucket's storage class. This defines how blobs in the bucket are stored and
    -   * determines the SLA and the cost of storage.
    -   *
    -   * @see Storage Classes
    -   */
    -  @Deprecated
    -  public String storageClass() {
    -    return getStorageClass();
    -  }
    -
       /**
        * Returns the bucket's storage class. This defines how blobs in the bucket are stored and
        * determines the SLA and the cost of storage.
    @@ -942,17 +675,6 @@ public String getStorageClass() {
         return storageClass;
       }
     
    -  /**
    -   * Returns the bucket's Cross-Origin Resource Sharing (CORS) configuration.
    -   *
    -   * @see 
    -   *     Cross-Origin Resource Sharing (CORS)
    -   */
    -  @Deprecated
    -  public List cors() {
    -    return getCors();
    -  }
    -
       /**
        * Returns the bucket's Cross-Origin Resource Sharing (CORS) configuration.
        *
    @@ -963,17 +685,6 @@ public List getCors() {
         return cors;
       }
     
    -  /**
    -   * Returns the bucket's access control configuration.
    -   *
    -   * @see 
    -   *     About Access Control Lists
    -   */
    -  @Deprecated
    -  public List acl() {
    -    return getAcl();
    -  }
    -
       /**
        * Returns the bucket's access control configuration.
        *
    @@ -984,17 +695,6 @@ public List getAcl() {
         return acl;
       }
     
    -  /**
    -   * Returns the default access control configuration for this bucket's blobs.
    -   *
    -   * @see 
    -   *     About Access Control Lists
    -   */
    -  @Deprecated
    -  public List defaultAcl() {
    -    return getDefaultAcl();
    -  }
    -
       /**
        * Returns the default access control configuration for this bucket's blobs.
        *
    @@ -1102,14 +802,6 @@ public static BucketInfo of(String name) {
         return newBuilder(name).build();
       }
     
    -  /**
    -   * Returns a {@code BucketInfo} builder where the bucket's name is set to the provided name.
    -   */
    -  @Deprecated
    -  public static Builder builder(String name) {
    -    return newBuilder(name);
    -  }
    -
       /**
        * Returns a {@code BucketInfo} builder where the bucket's name is set to the provided name.
        */
    diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/CopyWriter.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/CopyWriter.java
    index 962f4d05f69e..f0d477890ab0 100644
    --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/CopyWriter.java
    +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/CopyWriter.java
    @@ -35,14 +35,14 @@
      * Google Storage blob copy writer. A {@code CopyWriter} object allows to copy both blob's data and
      * information. To override source blob's information supply a {@code BlobInfo} to the
      * {@code CopyRequest} using either
    - * {@link Storage.CopyRequest.Builder#target(BlobInfo, Storage.BlobTargetOption...)} or
    - * {@link Storage.CopyRequest.Builder#target(BlobInfo, Iterable)}.
    + * {@link Storage.CopyRequest.Builder#setTarget(BlobInfo, Storage.BlobTargetOption...)} or
    + * {@link Storage.CopyRequest.Builder#setTarget(BlobInfo, Iterable)}.
      *
      * 

    This class holds the result of a copy request. If source and * destination blobs share the same location and storage class the copy is completed in one RPC call * otherwise one or more {@link #copyChunk} calls are necessary to complete the copy. In addition, - * {@link CopyWriter#result()} can be used to automatically complete the copy and return information - * on the newly created blob. + * {@link CopyWriter#getResult()} can be used to automatically complete the copy and return + * information on the newly created blob. * * @see Rewrite */ @@ -58,24 +58,6 @@ public class CopyWriter implements Restorable { this.storageRpc = serviceOptions.getRpc(); } - /** - * Returns the updated information for the written blob. Calling this method when {@code isDone()} - * is {@code false} will block until all pending chunks are copied. - * - *

    This method has the same effect of doing: - *

     {@code
    -   * while (!copyWriter.isDone()) {
    -   *    copyWriter.copyChunk();
    -   * }}
    -   * 
    - * - * @throws StorageException upon failure - */ - @Deprecated - public Blob result() { - return getResult(); - } - /** * Returns the updated information for the written blob. Calling this method when {@code isDone()} * is {@code false} will block until all pending chunks are copied. @@ -96,14 +78,6 @@ public Blob getResult() { return Blob.fromPb(serviceOptions.getService(), rewriteResponse.result); } - /** - * Returns the size of the blob being copied. - */ - @Deprecated - public long blobSize() { - return getBlobSize(); - } - /** * Returns the size of the blob being copied. */ @@ -118,14 +92,6 @@ public boolean isDone() { return rewriteResponse.isDone; } - /** - * Returns the number of bytes copied. - */ - @Deprecated - public long totalBytesCopied() { - return getTotalBytesCopied(); - } - /** * Returns the number of bytes copied. */ diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/Cors.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/Cors.java index 29840f5079de..3bf5bf3c5a3f 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/Cors.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/Cors.java @@ -121,11 +121,6 @@ public String toString() { return getValue(); } - @Deprecated - public String value() { - return getValue(); - } - public String getValue() { return value; } @@ -143,15 +138,6 @@ public static final class Builder { private Builder() {} - /** - * Sets the max time in seconds in which a client can issue requests before sending a new - * preflight request. - */ - @Deprecated - public Builder maxAgeSeconds(Integer maxAgeSeconds) { - return setMaxAgeSeconds(maxAgeSeconds); - } - /** * Sets the max time in seconds in which a client can issue requests before sending a new * preflight request. @@ -161,14 +147,6 @@ public Builder setMaxAgeSeconds(Integer maxAgeSeconds) { return this; } - /** - * Sets the HTTP methods supported by this CORS configuration. - */ - @Deprecated - public Builder methods(Iterable methods) { - return setMethods(methods); - } - /** * Sets the HTTP methods supported by this CORS configuration. */ @@ -177,14 +155,6 @@ public Builder setMethods(Iterable methods) { return this; } - /** - * Sets the origins for this CORS configuration. - */ - @Deprecated - public Builder origins(Iterable origins) { - return setOrigins(origins); - } - /** * Sets the origins for this CORS configuration. */ @@ -193,14 +163,6 @@ public Builder setOrigins(Iterable origins) { return this; } - /** - * Sets the response headers supported by this CORS configuration. - */ - @Deprecated - public Builder responseHeaders(Iterable headers) { - return setResponseHeaders(headers); - } - /** * Sets the response headers supported by this CORS configuration. */ @@ -224,15 +186,6 @@ private Cors(Builder builder) { this.responseHeaders = builder.responseHeaders; } - /** - * Returns the max time in seconds in which a client can issue requests before sending a new - * preflight request. - */ - @Deprecated - public Integer maxAgeSeconds() { - return getMaxAgeSeconds(); - } - /** * Returns the max time in seconds in which a client can issue requests before sending a new * preflight request. @@ -241,14 +194,6 @@ public Integer getMaxAgeSeconds() { return maxAgeSeconds; } - /** - * Returns the HTTP methods supported by this CORS configuration. - */ - @Deprecated - public List methods() { - return getMethods(); - } - /** * Returns the HTTP methods supported by this CORS configuration. */ @@ -256,14 +201,6 @@ public List getMethods() { return methods; } - /** - * Returns the origins in this CORS configuration. - */ - @Deprecated - public List origins() { - return getOrigins(); - } - /** * Returns the origins in this CORS configuration. */ @@ -271,14 +208,6 @@ public List getOrigins() { return origins; } - /** - * Returns the response headers supported by this CORS configuration. - */ - @Deprecated - public List responseHeaders() { - return getResponseHeaders(); - } - /** * Returns the response headers supported by this CORS configuration. */ @@ -314,14 +243,6 @@ public boolean equals(Object obj) { && Objects.equals(responseHeaders, other.responseHeaders); } - /** - * Returns a CORS configuration builder. - */ - @Deprecated - public static Builder builder() { - return newBuilder(); - } - /** * Returns a CORS configuration builder. */ diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java index 021270c364b6..4ecd0ca5064e 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java @@ -100,18 +100,13 @@ enum BucketField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } - @Override public String getSelector() { return selector; } } + enum BlobField implements FieldSelector { ACL("acl"), BUCKET("bucket"), @@ -146,18 +141,13 @@ enum BlobField implements FieldSelector { this.selector = selector; } - @Override - @Deprecated - public String selector() { - return getSelector(); - } - @Override public String getSelector() { return selector; } } + /** * Class for specifying bucket target options. */ @@ -523,7 +513,7 @@ private BlobSourceOption(StorageRpc.Option rpcOption, Object value) { * Returns an option for blob's data generation match. If this option is used the request will * fail if blob's generation does not match. The generation value to compare with the actual * blob's generation is taken from a source {@link BlobId} object. When this option is passed - * to a {@link Storage} method and {@link BlobId#generation()} is {@code null} or no + * to a {@link Storage} method and {@link BlobId#getGeneration()} is {@code null} or no * {@link BlobId} is provided an exception is thrown. */ public static BlobSourceOption generationMatch() { @@ -542,7 +532,7 @@ public static BlobSourceOption generationMatch(long generation) { * Returns an option for blob's data generation mismatch. If this option is used the request * will fail if blob's generation matches. The generation value to compare with the actual * blob's generation is taken from a source {@link BlobId} object. When this option is passed - * to a {@link Storage} method and {@link BlobId#generation()} is {@code null} or no + * to a {@link Storage} method and {@link BlobId#getGeneration()} is {@code null} or no * {@link BlobId} is provided an exception is thrown. */ public static BlobSourceOption generationNotMatch() { @@ -612,7 +602,7 @@ private BlobGetOption(StorageRpc.Option rpcOption, String value) { * Returns an option for blob's data generation match. If this option is used the request will * fail if blob's generation does not match. The generation value to compare with the actual * blob's generation is taken from a source {@link BlobId} object. When this option is passed - * to a {@link Storage} method and {@link BlobId#generation()} is {@code null} or no + * to a {@link Storage} method and {@link BlobId#getGeneration()} is {@code null} or no * {@link BlobId} is provided an exception is thrown. */ public static BlobGetOption generationMatch() { @@ -631,7 +621,7 @@ public static BlobGetOption generationMatch(long generation) { * Returns an option for blob's data generation mismatch. If this option is used the request * will fail if blob's generation matches. The generation value to compare with the actual * blob's generation is taken from a source {@link BlobId} object. When this option is passed - * to a {@link Storage} method and {@link BlobId#generation()} is {@code null} or no + * to a {@link Storage} method and {@link BlobId#getGeneration()} is {@code null} or no * {@link BlobId} is provided an exception is thrown. */ public static BlobGetOption generationNotMatch() { @@ -758,10 +748,10 @@ public static BlobListOption prefix(String prefix) { * possible {@link #prefix(String)}, do not contain the '/' delimiter are returned as is. Blobs * whose names, after a possible {@link #prefix(String)}, contain the '/' delimiter, will have * their name truncated after the delimiter and will be returned as {@link Blob} objects where - * only {@link Blob#blobId()}, {@link Blob#size()} and {@link Blob#isDirectory()} are set. For - * such directory blobs, ({@link BlobId#generation()} returns {@code null}), {@link Blob#size()} - * returns {@code 0} while {@link Blob#isDirectory()} returns {@code true}. Duplicate directory - * blobs are omitted. + * only {@link Blob#getBlobId()}, {@link Blob#getSize()} and {@link Blob#isDirectory()} are set. + * For such directory blobs, ({@link BlobId#getGeneration()} returns {@code null}), + * {@link Blob#getSize()} returns {@code 0} while {@link Blob#isDirectory()} returns + * {@code true}. Duplicate directory blobs are omitted. */ public static BlobListOption currentDirectory() { return new BlobListOption(StorageRpc.Option.DELIMITER, true); @@ -883,20 +873,10 @@ public static class SourceBlob implements Serializable { this.generation = generation; } - @Deprecated - public String name() { - return getName(); - } - public String getName() { return name; } - @Deprecated - public Long generation() { - return getGeneration(); - } - public Long getGeneration() { return generation; } @@ -933,14 +913,6 @@ public Builder addSource(String blob, long generation) { return this; } - /** - * Sets compose operation's target blob. - */ - @Deprecated - public Builder target(BlobInfo target) { - return setTarget(target); - } - /** * Sets compose operation's target blob. */ @@ -949,14 +921,6 @@ public Builder setTarget(BlobInfo target) { return this; } - /** - * Sets compose operation's target blob options. - */ - @Deprecated - public Builder targetOptions(BlobTargetOption... options) { - return setTargetOptions(options); - } - /** * Sets compose operation's target blob options. */ @@ -965,14 +929,6 @@ public Builder setTargetOptions(BlobTargetOption... options) { return this; } - /** - * Sets compose operation's target blob options. - */ - @Deprecated - public Builder targetOptions(Iterable options) { - return setTargetOptions(options); - } - /** * Sets compose operation's target blob options. */ @@ -997,14 +953,6 @@ private ComposeRequest(Builder builder) { targetOptions = ImmutableList.copyOf(builder.targetOptions); } - /** - * Returns compose operation's source blobs. - */ - @Deprecated - public List sourceBlobs() { - return getSourceBlobs(); - } - /** * Returns compose operation's source blobs. */ @@ -1012,14 +960,6 @@ public List getSourceBlobs() { return sourceBlobs; } - /** - * Returns compose operation's target blob. - */ - @Deprecated - public BlobInfo target() { - return getTarget(); - } - /** * Returns compose operation's target blob. */ @@ -1027,14 +967,6 @@ public BlobInfo getTarget() { return target; } - /** - * Returns compose operation's target blob's options. - */ - @Deprecated - public List targetOptions() { - return getTargetOptions(); - } - /** * Returns compose operation's target blob's options. */ @@ -1063,14 +995,6 @@ public static ComposeRequest of(String bucket, Iterable sources, String return of(sources, BlobInfo.newBuilder(BlobId.of(bucket, target)).build()); } - /** - * Returns a {@code ComposeRequest} builder. - */ - @Deprecated - public static Builder builder() { - return newBuilder(); - } - /** * Returns a {@code ComposeRequest} builder. */ @@ -1102,16 +1026,6 @@ public static class Builder { private BlobInfo target; private Long megabytesCopiedPerChunk; - /** - * Sets the blob to copy given bucket and blob name. - * - * @return the builder - */ - @Deprecated - public Builder source(String bucket, String blob) { - return setSource(bucket, blob); - } - /** * Sets the blob to copy given bucket and blob name. * @@ -1122,16 +1036,6 @@ public Builder setSource(String bucket, String blob) { return this; } - /** - * Sets the blob to copy given a {@link BlobId}. - * - * @return the builder - */ - @Deprecated - public Builder source(BlobId source) { - return setSource(source); - } - /** * Sets the blob to copy given a {@link BlobId}. * @@ -1142,16 +1046,6 @@ public Builder setSource(BlobId source) { return this; } - /** - * Sets blob's source options. - * - * @return the builder - */ - @Deprecated - public Builder sourceOptions(BlobSourceOption... options) { - return setSourceOptions(options); - } - /** * Sets blob's source options. * @@ -1162,16 +1056,6 @@ public Builder setSourceOptions(BlobSourceOption... options) { return this; } - /** - * Sets blob's source options. - * - * @return the builder - */ - @Deprecated - public Builder sourceOptions(Iterable options) { - return setSourceOptions(options); - } - /** * Sets blob's source options. * @@ -1182,16 +1066,6 @@ public Builder setSourceOptions(Iterable options) { return this; } - /** - * Sets the copy target. Target blob information is copied from source. - * - * @return the builder - */ - @Deprecated - public Builder target(BlobId targetId) { - return setTarget(targetId); - } - /** * Sets the copy target. Target blob information is copied from source. * @@ -1203,19 +1077,6 @@ public Builder setTarget(BlobId targetId) { return this; } - /** - * Sets the copy target and target options. {@code target} parameter is used to override - * source blob information (e.g. {@code contentType}, {@code contentLanguage}). Target blob - * information is set exactly to {@code target}, no information is inherited from the source - * blob. - * - * @return the builder - */ - @Deprecated - public Builder target(BlobInfo target, BlobTargetOption... options) { - return setTarget(target, options); - } - /** * Sets the copy target. Target blob information is copied from source, except for those * options specified in {@code options}. @@ -1244,19 +1105,6 @@ public Builder setTarget(BlobInfo target, BlobTargetOption... options) { return this; } - /** - * Sets the copy target and target options. {@code target} parameter is used to override - * source blob information (e.g. {@code contentType}, {@code contentLanguage}). Target blob - * information is set exactly to {@code target}, no information is inherited from the source - * blob. - * - * @return the builder - */ - @Deprecated - public Builder target(BlobInfo target, Iterable options) { - return setTarget(target, options); - } - /** * Sets the copy target and target options. {@code target} parameter is used to override * source blob information (e.g. {@code contentType}, {@code contentLanguage}). Target blob @@ -1285,18 +1133,6 @@ public Builder setTarget(BlobId targetId, Iterable options) { return this; } - /** - * Sets the maximum number of megabytes to copy for each RPC call. This parameter is ignored - * if source and target blob share the same location and storage class as copy is made with - * one single RPC. - * - * @return the builder - */ - @Deprecated - public Builder megabytesCopiedPerChunk(Long megabytesCopiedPerChunk) { - return setMegabytesCopiedPerChunk(megabytesCopiedPerChunk); - } - /** * Sets the maximum number of megabytes to copy for each RPC call. This parameter is ignored * if source and target blob share the same location and storage class as copy is made with @@ -1326,14 +1162,6 @@ private CopyRequest(Builder builder) { megabytesCopiedPerChunk = builder.megabytesCopiedPerChunk; } - /** - * Returns the blob to copy, as a {@link BlobId}. - */ - @Deprecated - public BlobId source() { - return getSource(); - } - /** * Returns the blob to copy, as a {@link BlobId}. */ @@ -1341,14 +1169,6 @@ public BlobId getSource() { return source; } - /** - * Returns blob's source options. - */ - @Deprecated - public List sourceOptions() { - return getSourceOptions(); - } - /** * Returns blob's source options. */ @@ -1356,14 +1176,6 @@ public List getSourceOptions() { return sourceOptions; } - /** - * Returns the {@link BlobInfo} for the target blob. - */ - @Deprecated - public BlobInfo target() { - return getTarget(); - } - /** * Returns the {@link BlobInfo} for the target blob. */ @@ -1372,8 +1184,8 @@ public BlobInfo getTarget() { } /** - * Returns whether to override the target blob information with {@link #target()}. - * If {@code true}, the value of {@link #target()} is used to replace source blob information + * Returns whether to override the target blob information with {@link #getTarget()}. + * If {@code true}, the value of {@link #getTarget()} is used to replace source blob information * (e.g. {@code contentType}, {@code contentLanguage}). Target blob information is set exactly * to this value, no information is inherited from the source blob. If {@code false}, target * blob information is inherited from the source blob. @@ -1382,14 +1194,6 @@ public boolean overrideInfo() { return overrideInfo; } - /** - * Returns blob's target options. - */ - @Deprecated - public List targetOptions() { - return getTargetOptions(); - } - /** * Returns blob's target options. */ @@ -1397,16 +1201,6 @@ public List getTargetOptions() { return targetOptions; } - /** - * Returns the maximum number of megabytes to copy for each RPC call. This parameter is ignored - * if source and target blob share the same location and storage class as copy is made with - * one single RPC. - */ - @Deprecated - public Long megabytesCopiedPerChunk() { - return getMegabytesCopiedPerChunk(); - } - /** * Returns the maximum number of megabytes to copy for each RPC call. This parameter is ignored * if source and target blob share the same location and storage class as copy is made with @@ -1497,14 +1291,6 @@ public static CopyRequest of(BlobId sourceBlobId, BlobId targetBlobId) { .build(); } - /** - * Creates a builder for {@code CopyRequest} objects. - */ - @Deprecated - public static Builder builder() { - return newBuilder(); - } - /** * Creates a builder for {@code CopyRequest} objects. */ @@ -1598,7 +1384,7 @@ public static Builder newBuilder() { * String blobName = "my_blob_name"; * String encryptionKey = "my_encryption_key"; * InputStream content = new ByteArrayInputStream("Hello, World!".getBytes(UTF_8)); - * + * * BlobId blobId = BlobId.of(bucketName, blobName); * BlobInfo blobInfo = BlobInfo.newBuilder(blobId) * .setContentType("text/plain") @@ -1890,15 +1676,15 @@ public static Builder newBuilder() { * Sends a copy request. This method copies both blob's data and information. To override source * blob's information supply a {@code BlobInfo} to the * {@code CopyRequest} using either - * {@link Storage.CopyRequest.Builder#target(BlobInfo, Storage.BlobTargetOption...)} or - * {@link Storage.CopyRequest.Builder#target(BlobInfo, Iterable)}. + * {@link Storage.CopyRequest.Builder#setTarget(BlobInfo, Storage.BlobTargetOption...)} or + * {@link Storage.CopyRequest.Builder#setTarget(BlobInfo, Iterable)}. * *

    This method returns a {@link CopyWriter} object for the provided {@code CopyRequest}. If * source and destination objects share the same location and storage class the source blob is - * copied with one request and {@link CopyWriter#result()} immediately returns, regardless of the - * {@link CopyRequest#megabytesCopiedPerChunk} parameter. If source and destination have different - * location or storage class {@link CopyWriter#result()} might issue multiple RPC calls depending - * on blob's size. + * copied with one request and {@link CopyWriter#getResult()} immediately returns, regardless of + * the {@link CopyRequest#megabytesCopiedPerChunk} parameter. If source and destination have + * different location or storage class {@link CopyWriter#getResult()} might issue multiple RPC + * calls depending on blob's size. * *

    Example of copying a blob. *

     {@code
    @@ -2010,7 +1796,7 @@ public static Builder newBuilder() {
        *   public void success(Boolean result) {
        *     // deleted successfully
        *   }
    -   * 
    +   *
        *   public void error(StorageException exception) {
        *     // delete failed
        *   }
    @@ -2026,7 +1812,7 @@ public static Builder newBuilder() {
     
       /**
        * Returns a channel for reading the blob's content. The blob's latest generation is read. If the
    -   * blob changes while reading (i.e. {@link BlobInfo#etag()} changes), subsequent calls to
    +   * blob changes while reading (i.e. {@link BlobInfo#getEtag()} changes), subsequent calls to
        * {@code blobReadChannel.read(ByteBuffer)} may throw {@link StorageException}.
        *
        * 

    Example of reading a blob's content through a reader. @@ -2051,7 +1837,7 @@ public static Builder newBuilder() { * Returns a channel for reading the blob's content. If {@code blob.generation()} is set * data corresponding to that generation is read. If {@code blob.generation()} is {@code null} * the blob's latest generation is read. If the blob changes while reading (i.e. - * {@link BlobInfo#etag()} changes), subsequent calls to {@code blobReadChannel.read(ByteBuffer)} + * {@link BlobInfo#getEtag()} changes), subsequent calls to {@code blobReadChannel.read(ByteBuffer)} * may throw {@link StorageException}. * *

    The {@link BlobSourceOption#generationMatch()} and diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageImpl.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageImpl.java index 5e0db04fd274..55d4ead5bf0a 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageImpl.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageImpl.java @@ -211,18 +211,13 @@ private static class BucketPageFetcher implements NextPageFetcher { this.serviceOptions = serviceOptions; } - @Override - @Deprecated - public Page nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listBuckets(serviceOptions, requestOptions); } } + private static class BlobPageFetcher implements NextPageFetcher { private static final long serialVersionUID = 81807334445874098L; @@ -238,18 +233,13 @@ private static class BlobPageFetcher implements NextPageFetcher { this.bucket = bucket; } - @Override - @Deprecated - public Page nextPage() { - return getNextPage(); - } - @Override public Page getNextPage() { return listBlobs(bucket, serviceOptions, requestOptions); } } + @Override public Page list(BucketListOption... options) { return listBuckets(getOptions(), optionMap(options)); diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java index d0adf15f7ad7..e747fa129c55 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java @@ -84,13 +84,6 @@ protected Set getScopes() { return SCOPES; } - /** - * Returns a default {@code StorageOptions} instance. - */ - @Deprecated - public static StorageOptions defaultInstance() { - return getDefaultInstance(); - } /** * Returns a default {@code StorageOptions} instance. @@ -115,10 +108,6 @@ public boolean equals(Object obj) { return obj instanceof StorageOptions && baseEquals((StorageOptions) obj); } - @Deprecated - public static Builder builder() { - return newBuilder(); - } public static Builder newBuilder() { return new Builder(); diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/testing/RemoteStorageHelper.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/testing/RemoteStorageHelper.java index d5379178a808..9806da27f481 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/testing/RemoteStorageHelper.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/testing/RemoteStorageHelper.java @@ -58,14 +58,6 @@ private RemoteStorageHelper(StorageOptions options) { this.options = options; } - /** - * Returns a {@link StorageOptions} object to be used for testing. - */ - @Deprecated - public StorageOptions options() { - return getOptions(); - } - /** * Returns a {@link StorageOptions} object to be used for testing. */ diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/AclTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/AclTest.java index eaefcf96ff11..2e462ba96eba 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/AclTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/AclTest.java @@ -39,8 +39,6 @@ public class AclTest { private static final String ETAG = "etag"; private static final String ID = "id"; private static final Acl ACL = Acl.newBuilder(ENTITY, ROLE).setEtag(ETAG).setId(ID).build(); - private static final Acl DEPRECATED_ACL = - Acl.builder(ENTITY, ROLE).setEtag(ETAG).setId(ID).build(); @Test public void testBuilder() { @@ -50,14 +48,6 @@ public void testBuilder() { assertEquals(ID, ACL.getId()); } - @Test - public void testBuilderDeprecated() { - assertEquals(ROLE, DEPRECATED_ACL.role()); - assertEquals(ENTITY, DEPRECATED_ACL.entity()); - assertEquals(ETAG, DEPRECATED_ACL.etag()); - assertEquals(ID, DEPRECATED_ACL.id()); - } - @Test public void testToBuilder() { assertEquals(ACL, ACL.toBuilder().build()); @@ -73,21 +63,6 @@ public void testToBuilder() { assertEquals("otherId", acl.getId()); } - @Test - public void testToBuilderDeprecated() { - assertEquals(DEPRECATED_ACL, DEPRECATED_ACL.toBuilder().build()); - Acl acl = DEPRECATED_ACL.toBuilder() - .setEtag("otherEtag") - .setId("otherId") - .role(Role.READER) - .entity(User.ofAllUsers()) - .build(); - assertEquals(Role.READER, acl.role()); - assertEquals(User.ofAllUsers(), acl.entity()); - assertEquals("otherEtag", acl.etag()); - assertEquals("otherId", acl.id()); - } - @Test public void testToAndFromPb() { assertEquals(ACL, Acl.fromPb(ACL.toBucketPb())); @@ -103,15 +78,6 @@ public void testDomainEntity() { assertEquals(acl, Entity.fromPb(pb)); } - @Test - public void testDomainEntityDeprecated() { - Domain acl = new Domain("d1"); - assertEquals("d1", acl.domain()); - assertEquals(Type.DOMAIN, acl.type()); - String pb = acl.toPb(); - assertEquals(acl, Entity.fromPb(pb)); - } - @Test public void testGroupEntity() { Group acl = new Group("g1"); @@ -121,15 +87,6 @@ public void testGroupEntity() { assertEquals(acl, Entity.fromPb(pb)); } - @Test - public void testGroupEntityDeprecated() { - Group acl = new Group("g1"); - assertEquals("g1", acl.email()); - assertEquals(Type.GROUP, acl.type()); - String pb = acl.toPb(); - assertEquals(acl, Entity.fromPb(pb)); - } - @Test public void testUserEntity() { User acl = new User("u1"); @@ -139,15 +96,6 @@ public void testUserEntity() { assertEquals(acl, Entity.fromPb(pb)); } - @Test - public void testUserEntityDeprecated() { - User acl = new User("u1"); - assertEquals("u1", acl.email()); - assertEquals(Type.USER, acl.type()); - String pb = acl.toPb(); - assertEquals(acl, Entity.fromPb(pb)); - } - @Test public void testProjectEntity() { Project acl = new Project(ProjectRole.VIEWERS, "p1"); @@ -158,16 +106,6 @@ public void testProjectEntity() { assertEquals(acl, Entity.fromPb(pb)); } - @Test - public void testProjectEntityDeprecated() { - Project acl = new Project(ProjectRole.VIEWERS, "p1"); - assertEquals(ProjectRole.VIEWERS, acl.projectRole()); - assertEquals("p1", acl.projectId()); - assertEquals(Type.PROJECT, acl.type()); - String pb = acl.toPb(); - assertEquals(acl, Entity.fromPb(pb)); - } - @Test public void testRawEntity() { Entity acl = new RawEntity("bla"); @@ -177,15 +115,6 @@ public void testRawEntity() { assertEquals(acl, Entity.fromPb(pb)); } - @Test - public void testRawEntityDeprecated() { - Entity acl = new RawEntity("bla"); - assertEquals("bla", acl.value()); - assertEquals(Type.UNKNOWN, acl.type()); - String pb = acl.toPb(); - assertEquals(acl, Entity.fromPb(pb)); - } - @Test public void testOf() { Acl acl = Acl.of(User.ofAllUsers(), Role.READER); diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobIdTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobIdTest.java index d1d16170b3c3..83946d135ec0 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobIdTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobIdTest.java @@ -31,13 +31,6 @@ public void testOf() { assertEquals("n", blobId.getName()); } - @Test - public void testOfDeprecated() { - BlobId blobId = BlobId.of("b", "n"); - assertEquals("b", blobId.bucket()); - assertEquals("n", blobId.name()); - } - @Test public void testEquals() { compareBlobIds(BLOB, BlobId.of("b", "n")); diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobInfoTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobInfoTest.java index 7af723c45040..a10180f5bacb 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobInfoTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobInfoTest.java @@ -93,33 +93,6 @@ public class BlobInfoTest { .setSize(0L) .setIsDirectory(true) .build(); - private static final BlobInfo DEPRECATED_BLOB_INFO = BlobInfo.builder("b", "n", GENERATION) - .acl(ACL) - .setComponentCount(COMPONENT_COUNT) - .contentType(CONTENT_TYPE) - .cacheControl(CACHE_CONTROL) - .contentDisposition(CONTENT_DISPOSITION) - .contentEncoding(CONTENT_ENCODING) - .contentLanguage(CONTENT_LANGUAGE) - .setCustomerEncryption(CUSTOMER_ENCRYPTION) - .crc32c(CRC32) - .setDeleteTime(DELETE_TIME) - .setEtag(ETAG) - .setGeneratedId(GENERATED_ID) - .md5(MD5) - .setMediaLink(MEDIA_LINK) - .metadata(METADATA) - .setMetageneration(META_GENERATION) - .setOwner(OWNER) - .setSelfLink(SELF_LINK) - .setSize(SIZE) - .setUpdateTime(UPDATE_TIME) - .setCreateTime(CREATE_TIME) - .build(); - private static final BlobInfo DEPRECATED_DIRECTORY_INFO = BlobInfo.builder("b", "n/") - .setSize(0L) - .setIsDirectory(true) - .build(); @Test public void testCustomerEncryption() { @@ -127,12 +100,6 @@ public void testCustomerEncryption() { assertEquals(KEY_SHA256, CUSTOMER_ENCRYPTION.getKeySha256()); } - @Test - public void testCustomerEncryptionDeprecated() { - assertEquals(ENCRYPTION_ALGORITHM, CUSTOMER_ENCRYPTION.encryptionAlgorithm()); - assertEquals(KEY_SHA256, CUSTOMER_ENCRYPTION.keySha256()); - } - @Test public void testToBuilder() { compareBlobs(BLOB_INFO, BLOB_INFO.toBuilder().build()); @@ -156,12 +123,6 @@ public void testToBuilderIncomplete() { compareBlobs(incompleteBlobInfo, incompleteBlobInfo.toBuilder().build()); } - @Test - public void testToBuilderIncompleteDeprecated() { - BlobInfo incompleteBlobInfo = BlobInfo.builder(BlobId.of("b2", "n2")).build(); - compareBlobs(incompleteBlobInfo, incompleteBlobInfo.toBuilder().build()); - } - @Test public void testBuilder() { assertEquals("b", BLOB_INFO.getBucket()); @@ -216,60 +177,6 @@ public void testBuilder() { assertTrue(DIRECTORY_INFO.isDirectory()); } - @Test - public void testBuilderDeprecated() { - assertEquals("b", DEPRECATED_BLOB_INFO.bucket()); - assertEquals("n", DEPRECATED_BLOB_INFO.name()); - assertEquals(ACL, DEPRECATED_BLOB_INFO.acl()); - assertEquals(COMPONENT_COUNT, DEPRECATED_BLOB_INFO.componentCount()); - assertEquals(CONTENT_TYPE, DEPRECATED_BLOB_INFO.contentType()); - assertEquals(CACHE_CONTROL, DEPRECATED_BLOB_INFO.cacheControl()); - assertEquals(CONTENT_DISPOSITION, DEPRECATED_BLOB_INFO.contentDisposition()); - assertEquals(CONTENT_ENCODING, DEPRECATED_BLOB_INFO.contentEncoding()); - assertEquals(CONTENT_LANGUAGE, DEPRECATED_BLOB_INFO.contentLanguage()); - assertEquals(CUSTOMER_ENCRYPTION, DEPRECATED_BLOB_INFO.customerEncryption()); - assertEquals(CRC32, DEPRECATED_BLOB_INFO.crc32c()); - assertEquals(DELETE_TIME, DEPRECATED_BLOB_INFO.deleteTime()); - assertEquals(ETAG, DEPRECATED_BLOB_INFO.etag()); - assertEquals(GENERATION, DEPRECATED_BLOB_INFO.generation()); - assertEquals(GENERATED_ID, DEPRECATED_BLOB_INFO.generatedId()); - assertEquals(MD5, DEPRECATED_BLOB_INFO.md5()); - assertEquals(MEDIA_LINK, DEPRECATED_BLOB_INFO.mediaLink()); - assertEquals(METADATA, DEPRECATED_BLOB_INFO.metadata()); - assertEquals(META_GENERATION, DEPRECATED_BLOB_INFO.metageneration()); - assertEquals(OWNER, DEPRECATED_BLOB_INFO.owner()); - assertEquals(SELF_LINK, DEPRECATED_BLOB_INFO.selfLink()); - assertEquals(SIZE, DEPRECATED_BLOB_INFO.size()); - assertEquals(UPDATE_TIME, DEPRECATED_BLOB_INFO.updateTime()); - assertEquals(CREATE_TIME, DEPRECATED_BLOB_INFO.createTime()); - assertFalse(DEPRECATED_BLOB_INFO.isDirectory()); - assertEquals("b", DEPRECATED_DIRECTORY_INFO.bucket()); - assertEquals("n/", DEPRECATED_DIRECTORY_INFO.name()); - assertNull(DEPRECATED_DIRECTORY_INFO.acl()); - assertNull(DEPRECATED_DIRECTORY_INFO.componentCount()); - assertNull(DEPRECATED_DIRECTORY_INFO.contentType()); - assertNull(DEPRECATED_DIRECTORY_INFO.cacheControl()); - assertNull(DEPRECATED_DIRECTORY_INFO.contentDisposition()); - assertNull(DEPRECATED_DIRECTORY_INFO.contentEncoding()); - assertNull(DEPRECATED_DIRECTORY_INFO.contentLanguage()); - assertNull(DEPRECATED_DIRECTORY_INFO.customerEncryption()); - assertNull(DEPRECATED_DIRECTORY_INFO.crc32c()); - assertNull(DEPRECATED_DIRECTORY_INFO.createTime()); - assertNull(DEPRECATED_DIRECTORY_INFO.deleteTime()); - assertNull(DEPRECATED_DIRECTORY_INFO.etag()); - assertNull(DEPRECATED_DIRECTORY_INFO.generation()); - assertNull(DEPRECATED_DIRECTORY_INFO.generatedId()); - assertNull(DEPRECATED_DIRECTORY_INFO.md5()); - assertNull(DEPRECATED_DIRECTORY_INFO.mediaLink()); - assertNull(DEPRECATED_DIRECTORY_INFO.metadata()); - assertNull(DEPRECATED_DIRECTORY_INFO.metageneration()); - assertNull(DEPRECATED_DIRECTORY_INFO.owner()); - assertNull(DEPRECATED_DIRECTORY_INFO.selfLink()); - assertEquals(0L, (long) DEPRECATED_DIRECTORY_INFO.size()); - assertNull(DEPRECATED_DIRECTORY_INFO.updateTime()); - assertTrue(DEPRECATED_DIRECTORY_INFO.isDirectory()); - } - private void compareBlobs(BlobInfo expected, BlobInfo value) { assertEquals(expected, value); assertEquals(expected.getBucket(), value.getBucket()); @@ -309,7 +216,7 @@ private void compareCustomerEncryptions(CustomerEncryption expected, CustomerEnc public void testToPbAndFromPb() { compareCustomerEncryptions(CUSTOMER_ENCRYPTION, CustomerEncryption.fromPb(CUSTOMER_ENCRYPTION.toPb())); - compareBlobs(DEPRECATED_BLOB_INFO, BlobInfo.fromPb(DEPRECATED_BLOB_INFO.toPb())); + compareBlobs(BLOB_INFO, BlobInfo.fromPb(BLOB_INFO.toPb())); BlobInfo blobInfo = BlobInfo.newBuilder(BlobId.of("b", "n")).build(); compareBlobs(blobInfo, BlobInfo.fromPb(blobInfo.toPb())); StorageObject object = new StorageObject() diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobTest.java index 718e9edfc635..adf617a1d083 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/BlobTest.java @@ -517,88 +517,4 @@ public void testBuilder() { assertNull(blob.getUpdateTime()); assertTrue(blob.isDirectory()); } - - @Test - public void testBuilderDeprecated() { - initializeExpectedBlob(4); - expect(storage.getOptions()).andReturn(mockOptions).times(6); - replay(storage); - Blob.Builder builder = new Blob.Builder(new Blob(storage, new BlobInfo.BuilderImpl(BLOB_INFO))); - Blob blob = builder.acl(ACLS) - .setComponentCount(COMPONENT_COUNT) - .contentType(CONTENT_TYPE) - .cacheControl(CACHE_CONTROL) - .contentDisposition(CONTENT_DISPOSITION) - .contentEncoding(CONTENT_ENCODING) - .contentLanguage(CONTENT_LANGUAGE) - .crc32c(CRC32) - .setCreateTime(CREATE_TIME) - .setCustomerEncryption(CUSTOMER_ENCRYPTION) - .setDeleteTime(DELETE_TIME) - .setEtag(ETAG) - .setGeneratedId(GENERATED_ID) - .md5(MD5) - .setMediaLink(MEDIA_LINK) - .metadata(METADATA) - .setMetageneration(META_GENERATION) - .setOwner(OWNER) - .setSelfLink(SELF_LINK) - .setSize(SIZE) - .setUpdateTime(UPDATE_TIME) - .build(); - assertEquals("b", blob.bucket()); - assertEquals("n", blob.name()); - assertEquals(ACLS, blob.acl()); - assertEquals(COMPONENT_COUNT, blob.componentCount()); - assertEquals(CONTENT_TYPE, blob.contentType()); - assertEquals(CACHE_CONTROL, blob.cacheControl()); - assertEquals(CONTENT_DISPOSITION, blob.contentDisposition()); - assertEquals(CONTENT_ENCODING, blob.contentEncoding()); - assertEquals(CONTENT_LANGUAGE, blob.contentLanguage()); - assertEquals(CRC32, blob.crc32c()); - assertEquals(CREATE_TIME, blob.createTime()); - assertEquals(CUSTOMER_ENCRYPTION, blob.customerEncryption()); - assertEquals(DELETE_TIME, blob.deleteTime()); - assertEquals(ETAG, blob.etag()); - assertEquals(GENERATED_ID, blob.generatedId()); - assertEquals(MD5, blob.md5()); - assertEquals(MEDIA_LINK, blob.mediaLink()); - assertEquals(METADATA, blob.metadata()); - assertEquals(META_GENERATION, blob.metageneration()); - assertEquals(OWNER, blob.owner()); - assertEquals(SELF_LINK, blob.selfLink()); - assertEquals(SIZE, blob.size()); - assertEquals(UPDATE_TIME, blob.updateTime()); - assertEquals(storage.getOptions(), blob.storage().getOptions()); - assertFalse(blob.isDirectory()); - builder = new Blob.Builder(new Blob(storage, new BlobInfo.BuilderImpl(DIRECTORY_INFO))); - blob = builder.blobId(BlobId.of("b", "n/")) - .setIsDirectory(true) - .setSize(0L) - .build(); - assertEquals("b", blob.bucket()); - assertEquals("n/", blob.name()); - assertNull(blob.acl()); - assertNull(blob.componentCount()); - assertNull(blob.contentType()); - assertNull(blob.cacheControl()); - assertNull(blob.contentDisposition()); - assertNull(blob.contentEncoding()); - assertNull(blob.contentLanguage()); - assertNull(blob.crc32c()); - assertNull(blob.createTime()); - assertNull(blob.customerEncryption()); - assertNull(blob.deleteTime()); - assertNull(blob.etag()); - assertNull(blob.generatedId()); - assertNull(blob.md5()); - assertNull(blob.mediaLink()); - assertNull(blob.metadata()); - assertNull(blob.metageneration()); - assertNull(blob.owner()); - assertNull(blob.selfLink()); - assertEquals(0L, (long) blob.size()); - assertNull(blob.updateTime()); - assertTrue(blob.isDirectory()); - } } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketInfoTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketInfoTest.java index 2ccf8283d417..67fa85aa312b 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketInfoTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketInfoTest.java @@ -76,23 +76,6 @@ public class BucketInfoTest { .setStorageClass(STORAGE_CLASS) .setVersioningEnabled(VERSIONING_ENABLED) .build(); - private static final BucketInfo DEPRECATED_BUCKET_INFO = BucketInfo.builder("b") - .acl(ACL) - .setEtag(ETAG) - .setGeneratedId(GENERATED_ID) - .setMetageneration(META_GENERATION) - .setOwner(OWNER) - .setSelfLink(SELF_LINK) - .cors(CORS) - .setCreateTime(CREATE_TIME) - .defaultAcl(DEFAULT_ACL) - .deleteRules(DELETE_RULES) - .indexPage(INDEX_PAGE) - .notFoundPage(NOT_FOUND_PAGE) - .location(LOCATION) - .storageClass(STORAGE_CLASS) - .versioningEnabled(VERSIONING_ENABLED) - .build(); @Test public void testToBuilder() { @@ -104,28 +87,12 @@ public void testToBuilder() { compareBuckets(BUCKET_INFO, bucketInfo); } - @Test - public void testToBuilderDeprecated() { - compareBuckets(BUCKET_INFO, BUCKET_INFO.toBuilder().build()); - BucketInfo bucketInfo = BUCKET_INFO.toBuilder().name("B").setGeneratedId("id").build(); - assertEquals("B", bucketInfo.name()); - assertEquals("id", bucketInfo.generatedId()); - bucketInfo = bucketInfo.toBuilder().name("b").setGeneratedId(GENERATED_ID).build(); - compareBuckets(BUCKET_INFO, bucketInfo); - } - @Test public void testToBuilderIncomplete() { BucketInfo incompleteBucketInfo = BucketInfo.newBuilder("b").build(); compareBuckets(incompleteBucketInfo, incompleteBucketInfo.toBuilder().build()); } - @Test - public void testToBuilderIncompleteDeprecated() { - BucketInfo incompleteBucketInfo = BucketInfo.builder("b").build(); - compareBuckets(incompleteBucketInfo, incompleteBucketInfo.toBuilder().build()); - } - @Test public void testOf() { BucketInfo bucketInfo = BucketInfo.of("bucket"); @@ -152,26 +119,6 @@ public void testBuilder() { assertEquals(VERSIONING_ENABLED, BUCKET_INFO.versioningEnabled()); } - @Test - public void testBuilderDeprecated() { - assertEquals("b", DEPRECATED_BUCKET_INFO.name()); - assertEquals(ACL, DEPRECATED_BUCKET_INFO.acl()); - assertEquals(ETAG, DEPRECATED_BUCKET_INFO.etag()); - assertEquals(GENERATED_ID, DEPRECATED_BUCKET_INFO.generatedId()); - assertEquals(META_GENERATION, DEPRECATED_BUCKET_INFO.metageneration()); - assertEquals(OWNER, DEPRECATED_BUCKET_INFO.owner()); - assertEquals(SELF_LINK, DEPRECATED_BUCKET_INFO.selfLink()); - assertEquals(CREATE_TIME, DEPRECATED_BUCKET_INFO.createTime()); - assertEquals(CORS, DEPRECATED_BUCKET_INFO.cors()); - assertEquals(DEFAULT_ACL, DEPRECATED_BUCKET_INFO.defaultAcl()); - assertEquals(DELETE_RULES, DEPRECATED_BUCKET_INFO.deleteRules()); - assertEquals(INDEX_PAGE, DEPRECATED_BUCKET_INFO.indexPage()); - assertEquals(NOT_FOUND_PAGE, DEPRECATED_BUCKET_INFO.notFoundPage()); - assertEquals(LOCATION, DEPRECATED_BUCKET_INFO.location()); - assertEquals(STORAGE_CLASS, DEPRECATED_BUCKET_INFO.storageClass()); - assertEquals(VERSIONING_ENABLED, DEPRECATED_BUCKET_INFO.versioningEnabled()); - } - @Test public void testToPbAndFromPb() { compareBuckets(BUCKET_INFO, BucketInfo.fromPb(BUCKET_INFO.toPb())); @@ -228,34 +175,4 @@ public void testDeleteRules() { assertEquals(delRule, DeleteRule.fromPb(delRule.toPb())); } } - - @Test - public void testDeleteRulesDeprecated() { - AgeDeleteRule ageRule = new AgeDeleteRule(10); - assertEquals(10, ageRule.daysToLive()); - assertEquals(10, ageRule.getDaysToLive()); - assertEquals(Type.AGE, ageRule.type()); - assertEquals(Type.AGE, ageRule.getType()); - CreatedBeforeDeleteRule createBeforeRule = new CreatedBeforeDeleteRule(1); - assertEquals(1, createBeforeRule.timeMillis()); - assertEquals(1, createBeforeRule.getTimeMillis()); - assertEquals(Type.CREATE_BEFORE, createBeforeRule.type()); - NumNewerVersionsDeleteRule versionsRule = new NumNewerVersionsDeleteRule(2); - assertEquals(2, versionsRule.numNewerVersions()); - assertEquals(2, versionsRule.getNumNewerVersions()); - assertEquals(Type.NUM_NEWER_VERSIONS, versionsRule.type()); - IsLiveDeleteRule isLiveRule = new IsLiveDeleteRule(true); - assertTrue(isLiveRule.isLive()); - assertEquals(Type.IS_LIVE, isLiveRule.type()); - assertEquals(Type.IS_LIVE, isLiveRule.getType()); - Rule rule = new Rule().set("a", "b"); - RawDeleteRule rawRule = new RawDeleteRule(rule); - assertEquals(Type.IS_LIVE, isLiveRule.type()); - assertEquals(Type.IS_LIVE, isLiveRule.getType()); - ImmutableList rules = ImmutableList - .of(ageRule, createBeforeRule, versionsRule, isLiveRule, rawRule); - for (DeleteRule delRule : rules) { - assertEquals(delRule, DeleteRule.fromPb(delRule.toPb())); - } - } } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketTest.java index 15886adb2e95..39d134891f47 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/BucketTest.java @@ -681,46 +681,4 @@ public void testBuilder() { assertEquals(VERSIONING_ENABLED, bucket.versioningEnabled()); assertEquals(storage.getOptions(), bucket.getStorage().getOptions()); } - - @Test - public void testBuilderDeprecated() { - initializeExpectedBucket(4); - expect(storage.getOptions()).andReturn(mockOptions).times(4); - replay(storage); - Bucket.Builder builder = - new Bucket.Builder(new Bucket(storage, new BucketInfo.BuilderImpl(BUCKET_INFO))); - Bucket bucket = builder.acl(ACLS) - .setEtag(ETAG) - .setGeneratedId(GENERATED_ID) - .setMetageneration(META_GENERATION) - .setOwner(OWNER) - .setSelfLink(SELF_LINK) - .cors(CORS) - .setCreateTime(CREATE_TIME) - .defaultAcl(DEFAULT_ACL) - .deleteRules(DELETE_RULES) - .indexPage(INDEX_PAGE) - .notFoundPage(NOT_FOUND_PAGE) - .location(LOCATION) - .storageClass(STORAGE_CLASS) - .versioningEnabled(VERSIONING_ENABLED) - .build(); - assertEquals("b", bucket.name()); - assertEquals(ACLS, bucket.acl()); - assertEquals(ETAG, bucket.etag()); - assertEquals(GENERATED_ID, bucket.generatedId()); - assertEquals(META_GENERATION, bucket.metageneration()); - assertEquals(OWNER, bucket.owner()); - assertEquals(SELF_LINK, bucket.selfLink()); - assertEquals(CREATE_TIME, bucket.createTime()); - assertEquals(CORS, bucket.cors()); - assertEquals(DEFAULT_ACL, bucket.defaultAcl()); - assertEquals(DELETE_RULES, bucket.deleteRules()); - assertEquals(INDEX_PAGE, bucket.indexPage()); - assertEquals(NOT_FOUND_PAGE, bucket.notFoundPage()); - assertEquals(LOCATION, bucket.location()); - assertEquals(STORAGE_CLASS, bucket.storageClass()); - assertEquals(VERSIONING_ENABLED, bucket.versioningEnabled()); - assertEquals(storage.getOptions(), bucket.storage().getOptions()); - } } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/CopyRequestTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/CopyRequestTest.java index f517c3246ceb..1c1b00a4e981 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/CopyRequestTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/CopyRequestTest.java @@ -79,40 +79,6 @@ public void testCopyRequest() { copyRequest3.getTargetOptions()); } - @Test - public void testCopyRequestDeprecated() { - Storage.CopyRequest copyRequest1 = Storage.CopyRequest.builder() - .source(SOURCE_BLOB_ID) - .sourceOptions(BlobSourceOption.generationMatch(1)) - .target(TARGET_BLOB_INFO, BlobTargetOption.predefinedAcl(PUBLIC_READ)) - .build(); - assertEquals(SOURCE_BLOB_ID, copyRequest1.source()); - assertEquals(1, copyRequest1.sourceOptions().size()); - assertEquals(BlobSourceOption.generationMatch(1), copyRequest1.sourceOptions().get(0)); - assertEquals(TARGET_BLOB_INFO, copyRequest1.target()); - assertTrue(copyRequest1.overrideInfo()); - assertEquals(1, copyRequest1.targetOptions().size()); - assertEquals(BlobTargetOption.predefinedAcl(PUBLIC_READ), copyRequest1.targetOptions().get(0)); - - Storage.CopyRequest copyRequest2 = Storage.CopyRequest.builder() - .source(SOURCE_BUCKET_NAME, SOURCE_BLOB_NAME) - .target(TARGET_BLOB_ID) - .build(); - assertEquals(SOURCE_BLOB_ID, copyRequest2.source()); - assertEquals(BlobInfo.builder(TARGET_BLOB_ID).build(), copyRequest2.target()); - assertFalse(copyRequest2.overrideInfo()); - - Storage.CopyRequest copyRequest3 = Storage.CopyRequest.builder() - .source(SOURCE_BLOB_ID) - .target(TARGET_BLOB_INFO, ImmutableList.of(BlobTargetOption.predefinedAcl(PUBLIC_READ))) - .build(); - assertEquals(SOURCE_BLOB_ID, copyRequest3.source()); - assertEquals(TARGET_BLOB_INFO, copyRequest3.target()); - assertTrue(copyRequest3.overrideInfo()); - assertEquals(ImmutableList.of(BlobTargetOption.predefinedAcl(PUBLIC_READ)), - copyRequest3.targetOptions()); - } - @Test public void testCopyRequestOf() { Storage.CopyRequest copyRequest1 = Storage.CopyRequest.of(SOURCE_BLOB_ID, TARGET_BLOB_INFO); diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/CopyWriterTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/CopyWriterTest.java index 604a4a4c6b8f..fba04665b8b0 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/CopyWriterTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/CopyWriterTest.java @@ -93,18 +93,6 @@ public void tearDown() throws Exception { verify(rpcFactoryMock, storageRpcMock); } - @Test - public void testRewriteDeprecated() { - EasyMock.expect(storageRpcMock.continueRewrite(RESPONSE_WITH_OBJECT)) - .andReturn(RESPONSE_WITH_OBJECT_DONE); - EasyMock.replay(storageRpcMock); - copyWriter = new CopyWriter(options, RESPONSE_WITH_OBJECT); - assertEquals(result, copyWriter.result()); - assertTrue(copyWriter.isDone()); - assertEquals(42L, copyWriter.totalBytesCopied()); - assertEquals(42L, copyWriter.blobSize()); - } - @Test public void testRewriteWithObject() { EasyMock.expect(storageRpcMock.continueRewrite(RESPONSE_WITH_OBJECT)) diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/CorsTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/CorsTest.java index a7223aff4100..81bad41ec6ab 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/CorsTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/CorsTest.java @@ -51,22 +51,4 @@ public void corsTest() { assertEquals(methods, cors.getMethods()); assertEquals(headers, cors.getResponseHeaders()); } - - @Test - public void corsTestDeprecated() { - List origins = ImmutableList.of(Origin.any(), Origin.of("o")); - List headers = ImmutableList.of("h1", "h2"); - List methods = ImmutableList.of(HttpMethod.GET); - Cors cors = Cors.builder() - .maxAgeSeconds(100) - .origins(origins) - .responseHeaders(headers) - .methods(methods) - .build(); - - assertEquals(Integer.valueOf(100), cors.maxAgeSeconds()); - assertEquals(origins, cors.origins()); - assertEquals(methods, cors.methods()); - assertEquals(headers, cors.responseHeaders()); - } } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/testing/RemoteStorageHelperTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/testing/RemoteStorageHelperTest.java index c4bc103edb33..04b54a5ae59a 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/testing/RemoteStorageHelperTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/testing/RemoteStorageHelperTest.java @@ -83,6 +83,8 @@ public class RemoteStorageHelperTest { private List blobList; private Page blobPage; + + @Rule public ExpectedException thrown = ExpectedException.none(); @@ -92,33 +94,18 @@ public void setUp() { blob2 = EasyMock.createMock(Blob.class); blobList = ImmutableList.of(blob1, blob2); blobPage = new Page() { - @Override - @Deprecated - public String nextPageCursor() { - return "nextPageCursor"; - } @Override public String getNextPageCursor() { return "nextPageCursor"; } - @Override - @Deprecated - public Page nextPage() { - return null; - } @Override public Page getNextPage() { return null; } - @Override - @Deprecated - public Iterable values() { - return blobList; - } @Override public Iterable getValues() { @@ -220,7 +207,6 @@ public void testForceDeleteNoTimeoutFail() { public void testCreateFromStream() { RemoteStorageHelper helper = RemoteStorageHelper.create(PROJECT_ID, JSON_KEY_STREAM); StorageOptions options = helper.getOptions(); - assertEquals(options, helper.options()); assertEquals(PROJECT_ID, options.getProjectId()); assertEquals(60000, options.getConnectTimeout()); assertEquals(60000, options.getReadTimeout()); diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/Detection.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/Detection.java index 9157ca2cb9ff..78dc5a519555 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/Detection.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/Detection.java @@ -41,16 +41,6 @@ private Detection(String language, Float confidence) { this.confidence = confidence; } - /** - * Returns the code of the detected language. - * - * @see - * Supported Languages - */ - @Deprecated - public String language() { - return getLanguage(); - } /** * Returns the code of the detected language. @@ -62,15 +52,6 @@ public String getLanguage() { return language; } - /** - * Returns an optional confidence value in the interval [0,1]. The closer this value is to 1, the - * higher the confidence level for the language detection. Note that this value is not always - * available. - */ - @Deprecated - public float confidence() { - return getConfidence(); - } /** * Returns an optional confidence value in the interval [0,1]. The closer this value is to 1, the diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/Language.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/Language.java index 6a8b99b8a07f..a6c626c0fbff 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/Language.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/Language.java @@ -51,13 +51,6 @@ private Language(String code, String name) { this.name = name; } - /** - * Returns the code of the language. - */ - @Deprecated - public String code() { - return getCode(); - } /** * Returns the code of the language. @@ -66,13 +59,6 @@ public String getCode() { return code; } - /** - * Returns the name of the language. - */ - @Deprecated - public String name() { - return getName(); - } /** * Returns the name of the language. diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/Translate.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/Translate.java index aa1d44036ae1..e73d4b41fb6b 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/Translate.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/Translate.java @@ -42,7 +42,8 @@ private LanguageListOption(TranslateRpc.Option rpcOption, String value) { /** * Returns an option for setting the target language. If this option is not provided, the value * returned by {@link TranslateOptions#getTargetLanguage()} is used. When provided, the returned - * {@link Language#name()} will be in the language specified by the {@code targetLanguage} code. + * {@link Language#getName()} will be in the language specified by the {@code targetLanguage} + * code. * * @param targetLanguage the target language code */ diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/TranslateOptions.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/TranslateOptions.java index b7c1e40731a6..785c4ad17df6 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/TranslateOptions.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/TranslateOptions.java @@ -78,16 +78,6 @@ private Builder(TranslateOptions options) { this.apiKey = options.apiKey; } - /** - * Sets project id. Setting a project id has no impact on the {@link Translate} service. - * - * @return the builder - */ - @Override - @Deprecated - public Builder projectId(String projectId) { - return setProjectId(projectId); - } /** * Sets project id. Setting a project id has no impact on the {@link Translate} service. @@ -100,15 +90,6 @@ public Builder setProjectId(String projectId) { return self(); } - /** - * Sets the API key used to issue requets. If not set, the API key is looked for in the - * {@code GOOGLE_API_KEY} environment variable. For instructions on how to get an API key see - * Translate quickstart. - */ - @Deprecated - public Builder apiKey(String apiKey) { - return setApiKey(apiKey); - } /** * Sets the API key used to issue requets. If not set, the API key is looked for in the @@ -120,19 +101,6 @@ public Builder setApiKey(String apiKey) { return this; } - /** - * Sets the code for the default target language. If not set, english ({@code en}) is used. - * {@link Translate#translate(List, TranslateOption...)} and - * {@link Translate#translate(String, TranslateOption...)} calls will use this - * value unless a {@link TranslateOption#targetLanguage(String)} option is explicitly - * provided. - * - * @return the builder - */ - @Deprecated - public Builder targetLanguage(String targetLanguage) { - return setTargetLanguage(targetLanguage); - } /** * Sets the code for the default target language. If not set, english ({@code en}) is used. @@ -185,22 +153,11 @@ protected String getDefaultHost() { return DEFAULT_HOST; } - @Deprecated - protected String defaultApiKey() { - return getDefaultApiKey(); - } protected String getDefaultApiKey() { return System.getProperty(API_KEY_ENV_NAME, System.getenv(API_KEY_ENV_NAME)); } - /** - * Returns the API key, to be used used to send requests. - */ - @Deprecated - public String apiKey() { - return getApiKey(); - } /** * Returns the API key, to be used used to send requests. @@ -209,13 +166,6 @@ public String getApiKey() { return apiKey; } - /** - * Returns the code for the default target language. - */ - @Deprecated - public String targetLanguage() { - return getTargetLanguage(); - } /** * Returns the code for the default target language. @@ -246,13 +196,6 @@ public boolean equals(Object obj) { && Objects.equals(targetLanguage, options.targetLanguage); } - /** - * Returns a default {@code TranslateOptions} instance. - */ - @Deprecated - public static TranslateOptions defaultInstance() { - return getDefaultInstance(); - } /** * Returns a default {@code TranslateOptions} instance. @@ -261,13 +204,6 @@ public static TranslateOptions getDefaultInstance() { return newBuilder().build(); } - /** - * Returns a builder for {@code TranslateOptions} objects. - */ - @Deprecated - public static Builder builder() { - return newBuilder(); - } /** * Returns a builder for {@code TranslateOptions} objects. diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/Translation.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/Translation.java index 119f9ff67238..0acd10857654 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/Translation.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/Translation.java @@ -52,13 +52,6 @@ private Translation(String translatedText, String sourceLanguage, String model) this.model = model; } - /** - * Returns the translated text. - */ - @Deprecated - public String translatedText() { - return translatedText; - } /** * Returns the translated text. @@ -67,14 +60,6 @@ public String getTranslatedText() { return translatedText; } - /** - * Returns the language code of the source text. If no source language was provided this value is - * the source language as detected by the Google Translate service. - */ - @Deprecated - public String sourceLanguage() { - return getSourceLanguage(); - } /** * Returns the language code of the source text. If no source language was provided this value is diff --git a/google-cloud-translate/src/main/java/com/google/cloud/translate/testing/RemoteTranslateHelper.java b/google-cloud-translate/src/main/java/com/google/cloud/translate/testing/RemoteTranslateHelper.java index 4819d9dd4be6..5938f526e5ea 100644 --- a/google-cloud-translate/src/main/java/com/google/cloud/translate/testing/RemoteTranslateHelper.java +++ b/google-cloud-translate/src/main/java/com/google/cloud/translate/testing/RemoteTranslateHelper.java @@ -38,13 +38,6 @@ private RemoteTranslateHelper(TranslateOptions options) { this.options = options; } - /** - * Returns a {@link TranslateOptions} object to be used for testing. - */ - @Deprecated - public TranslateOptions options() { - return getOptions(); - } /** * Returns a {@link TranslateOptions} object to be used for testing. diff --git a/google-cloud-translate/src/test/java/com/google/cloud/translate/DetectionTest.java b/google-cloud-translate/src/test/java/com/google/cloud/translate/DetectionTest.java index 5e2b5c4182c7..0e20b6dcfaa0 100644 --- a/google-cloud-translate/src/test/java/com/google/cloud/translate/DetectionTest.java +++ b/google-cloud-translate/src/test/java/com/google/cloud/translate/DetectionTest.java @@ -37,12 +37,6 @@ public void testFromPb() { compareDetection(DETECTION, Detection.fromPb(DETECTION_PB)); } - @Test - public void testFromPbDeprecated() { - assertEquals(LANGUAGE, DETECTION.language()); - assertEquals(CONFIDENCE, DETECTION.confidence(), 0); - compareDetection(DETECTION, Detection.fromPb(DETECTION_PB)); - } private void compareDetection(Detection expected, Detection value) { assertEquals(expected, value); diff --git a/google-cloud-translate/src/test/java/com/google/cloud/translate/LanguageTest.java b/google-cloud-translate/src/test/java/com/google/cloud/translate/LanguageTest.java index 3eefb2853b37..68acfbef116f 100644 --- a/google-cloud-translate/src/test/java/com/google/cloud/translate/LanguageTest.java +++ b/google-cloud-translate/src/test/java/com/google/cloud/translate/LanguageTest.java @@ -41,15 +41,6 @@ public void testFromPb() { compareLanguage(LANGUAGE, Language.fromPb(LANGUAGE_PB)); } - @Test - public void testFromPbDeprecated() { - assertEquals(CODE, LANGUAGE.code()); - assertEquals(NAME, LANGUAGE.name()); - Language language = Language.fromPb(new LanguagesResource().setLanguage(CODE)); - assertEquals(CODE, language.code()); - assertNull(language.name()); - compareLanguage(LANGUAGE, Language.fromPb(LANGUAGE_PB)); - } private void compareLanguage(Language expected, Language value) { assertEquals(expected, value); diff --git a/google-cloud-translate/src/test/java/com/google/cloud/translate/TranslationTest.java b/google-cloud-translate/src/test/java/com/google/cloud/translate/TranslationTest.java index 1e70aaa40044..e41a199c7df1 100644 --- a/google-cloud-translate/src/test/java/com/google/cloud/translate/TranslationTest.java +++ b/google-cloud-translate/src/test/java/com/google/cloud/translate/TranslationTest.java @@ -38,12 +38,6 @@ public void testFromPb() { compareTranslation(TRANSLATION, Translation.fromPb(TRANSLATION_PB)); } - @Test - public void testFromPbDeprecated() { - assertEquals(TRANSLATED_TEXT, TRANSLATION.translatedText()); - assertEquals(SOURCE_LANGUAGE, TRANSLATION.sourceLanguage()); - compareTranslation(TRANSLATION, Translation.fromPb(TRANSLATION_PB)); - } private void compareTranslation(Translation expected, Translation value) { assertEquals(expected, value);