Skip to content

Commit

Permalink
fix(builder): Rename builder.setExtraHeader => `builder.addExtraHea…
Browse files Browse the repository at this point in the history
…der`

Closes #433
  • Loading branch information
ElPicador committed Jan 23, 2018
1 parent f0385ee commit bb97acc
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@ public AppEngineAPIClientBuilder setUserAgent(
}

@Override
@Deprecated
public AppEngineAPIClientBuilder setExtraHeader(@Nonnull String key, String value) {
super.setExtraHeader(key, value);
return this;
}

@Override
public GenericAPIClientBuilder addExtraHeader(@Nonnull String key, String value) {
return super.addExtraHeader(key, value);
}

@Override
public AppEngineAPIClientBuilder setConnectTimeout(int connectTimeout) {
super.setConnectTimeout(connectTimeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@ public AsyncHttpAPIClientBuilder setUserAgent(
}

@Override
@Deprecated
public AsyncHttpAPIClientBuilder setExtraHeader(@Nonnull String key, String value) {
super.setExtraHeader(key, value);
return this;
}

@Override
public GenericAPIClientBuilder addExtraHeader(@Nonnull String key, String value) {
return super.addExtraHeader(key, value);
}

@Override
public AsyncHttpAPIClientBuilder setConnectTimeout(int connectTimeout) {
super.setConnectTimeout(connectTimeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,17 @@ public APIClientBuilder setUserAgent(
return this;
}

/**
* Set extra headers to the requests
*
* @param key name of the header
* @param value value of the header
* @return this
*/
@Override
public APIClientBuilder setExtraHeader(@Nonnull String key, String value) {
super.setExtraHeader(key, value);
return this;
}

@Override
public GenericAPIClientBuilder addExtraHeader(@Nonnull String key, String value) {
return super.addExtraHeader(key, value);
}

/**
* Set the connect timeout of the HTTP client
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,18 @@ public AsyncAPIClientBuilder setUserAgent(
return this;
}

/**
* Set extra headers to the requests
*
* @param key name of the header
* @param value value of the header
* @return this
*/
@Override
@Deprecated
public AsyncAPIClientBuilder setExtraHeader(@Nonnull String key, String value) {
super.setExtraHeader(key, value);
return this;
}

@Override
public GenericAPIClientBuilder addExtraHeader(@Nonnull String key, String value) {
return super.addExtraHeader(key, value);
}

/**
* Set the connect timeout of the HTTP client
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,21 @@ public GenericAPIClientBuilder setUserAgent(
return this;
}

/** Deprecated: use {@link #addExtraHeader(String, String)} */
@Deprecated
public GenericAPIClientBuilder setExtraHeader(@Nonnull String key, String value) {
customHeaders.put(key, value);
return this;
}

/**
* Set extra headers to the requests
* Add extra headers to the requests
*
* @param key name of the header
* @param value value of the header
* @return this
*/
public GenericAPIClientBuilder setExtraHeader(@Nonnull String key, String value) {
public GenericAPIClientBuilder addExtraHeader(@Nonnull String key, String value) {
customHeaders.put(key, value);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,17 @@ public ApacheAPIClientBuilder setUserAgent(
}

@Override
@Deprecated
public ApacheAPIClientBuilder setExtraHeader(@Nonnull String key, String value) {
super.setExtraHeader(key, value);
return this;
}

@Override
public GenericAPIClientBuilder addExtraHeader(@Nonnull String key, String value) {
return super.addExtraHeader(key, value);
}

@Override
public ApacheAPIClientBuilder setConnectTimeout(int connectTimeout) {
super.setConnectTimeout(connectTimeout);
Expand Down

0 comments on commit bb97acc

Please sign in to comment.