Skip to content

Commit

Permalink
Add javadoc for RequestOptions.apply/RequestBuilder.apply.
Browse files Browse the repository at this point in the history
Related to #2858.
  • Loading branch information
sjudd committed Feb 5, 2018
1 parent fa1b0ff commit e60c451
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
8 changes: 6 additions & 2 deletions library/src/main/java/com/bumptech/glide/RequestBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,12 @@ protected RequestBuilder(Class<TranscodeType> transcodeClass, RequestBuilder<?>
}

/**
* Applies the given options to the request, options set or unset in the given options will
* replace those previously set in options in this class.
* Applies the given options to the request.
*
* <p>As with {@link RequestOptions#apply(RequestOptions)}, {@code #apply} only replaces those
* values that are explicitly set in the given {@link RequestOptions} object. If you need to
* completely reset all previously set options, create a new {@code RequestBuilder} instead of
* using this method.
*
* @see RequestOptions#apply(RequestOptions)
* @return This request builder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,21 @@ public RequestOptions dontAnimate() {
return set(GifOptions.DISABLE_ANIMATION, true);
}

/**
* Updates this options set with any options that are explicitly set in the given
* {@code RequestOptions} object and returns this object if {@link #autoClone()} is disabled or
* a new {@code RequestOptions} object if {@link #autoClone()} is enabled.
*
* <p>{@code #apply} only replaces those values that are explicitly set in the given
* {@code RequestOptions}. If you need to completely reset all previously set options, create a
* new {@code RequestOptions} object instead of using this method.
*
* <p>The options that will be set to values in the returned {@code RequestOptions} object is the
* intersection of the set of options in this {@code RequestOptions} object and the given
* {@code RequestOptions} object that were explicitly set. If the values of any of the options
* conflict, the values in the returned {@code RequestOptions} object will be set to those in the
* given {@code RequestOptions} object.
*/
@NonNull
@CheckResult
public RequestOptions apply(@NonNull RequestOptions other) {
Expand Down

0 comments on commit e60c451

Please sign in to comment.