Skip to content

Commit

Permalink
Updated BaseRequestOptions.transform api (update for issue #2875) (#3365
Browse files Browse the repository at this point in the history
)
  • Loading branch information
aleien authored and sjudd committed Oct 26, 2018
1 parent 6782541 commit 8a26a6b
Show file tree
Hide file tree
Showing 21 changed files with 245 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ public String apply(ParameterSpec input) {
.add(");\n")
.build());

if (methodToOverride.getSimpleName().toString().equals("transforms")) {
if (methodToOverride.getSimpleName().toString().contains("transform")
&& methodToOverride.isVarArgs()) {
result
.addModifiers(Modifier.FINAL)
.addAnnotation(SafeVarargs.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.bumptech.glide.request.RequestOptions;
import java.lang.Class;
import java.lang.Cloneable;
import java.lang.Deprecated;
import java.lang.Override;
import java.lang.SafeVarargs;
import java.lang.SuppressWarnings;
Expand Down Expand Up @@ -558,6 +559,16 @@ public GlideOptions transform(@NonNull Transformation<Bitmap> transformation) {
@SuppressWarnings("varargs")
@NonNull
@CheckResult
public final GlideOptions transform(@NonNull Transformation<Bitmap>... transformations) {
return (GlideOptions) super.transform(transformations);
}

@Override
@SafeVarargs
@SuppressWarnings("varargs")
@Deprecated
@NonNull
@CheckResult
public final GlideOptions transforms(@NonNull Transformation<Bitmap>... transformations) {
return (GlideOptions) super.transforms(transformations);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,23 @@ public GlideRequest<TranscodeType> transform(@NonNull Transformation<Bitmap> tra
return (GlideRequest<TranscodeType>) super.transform(transformation);
}

/**
* @see GlideOptions#transform(Transformation<Bitmap>[])
*/
@NonNull
@CheckResult
@SuppressWarnings({
"unchecked",
"varargs"
})
public GlideRequest<TranscodeType> transform(@NonNull Transformation<Bitmap>... transformations) {
return (GlideRequest<TranscodeType>) super.transform(transformations);
}

/**
* @see GlideOptions#transforms(Transformation<Bitmap>[])
*/
@Deprecated
@NonNull
@CheckResult
@SuppressWarnings({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.bumptech.glide.request.RequestOptions;
import java.lang.Class;
import java.lang.Cloneable;
import java.lang.Deprecated;
import java.lang.Override;
import java.lang.SafeVarargs;
import java.lang.SuppressWarnings;
Expand Down Expand Up @@ -561,6 +562,16 @@ public GlideOptions transform(@NonNull Transformation<Bitmap> transformation) {
@SuppressWarnings("varargs")
@NonNull
@CheckResult
public final GlideOptions transform(@NonNull Transformation<Bitmap>... transformations) {
return (GlideOptions) super.transform(transformations);
}

@Override
@SafeVarargs
@SuppressWarnings("varargs")
@Deprecated
@NonNull
@CheckResult
public final GlideOptions transforms(@NonNull Transformation<Bitmap>... transformations) {
return (GlideOptions) super.transforms(transformations);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,23 @@ public GlideRequest<TranscodeType> transform(@NonNull Transformation<Bitmap> tra
return (GlideRequest<TranscodeType>) super.transform(transformation);
}

/**
* @see GlideOptions#transform(Transformation<Bitmap>[])
*/
@NonNull
@CheckResult
@SuppressWarnings({
"unchecked",
"varargs"
})
public GlideRequest<TranscodeType> transform(@NonNull Transformation<Bitmap>... transformations) {
return (GlideRequest<TranscodeType>) super.transform(transformations);
}

/**
* @see GlideOptions#transforms(Transformation<Bitmap>[])
*/
@Deprecated
@NonNull
@CheckResult
@SuppressWarnings({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.bumptech.glide.request.RequestOptions;
import java.lang.Class;
import java.lang.Cloneable;
import java.lang.Deprecated;
import java.lang.Override;
import java.lang.SafeVarargs;
import java.lang.SuppressWarnings;
Expand Down Expand Up @@ -552,6 +553,16 @@ public GlideOptions transform(@NonNull Transformation<Bitmap> transformation) {
@SuppressWarnings("varargs")
@NonNull
@CheckResult
public final GlideOptions transform(@NonNull Transformation<Bitmap>... transformations) {
return (GlideOptions) super.transform(transformations);
}

@Override
@SafeVarargs
@SuppressWarnings("varargs")
@Deprecated
@NonNull
@CheckResult
public final GlideOptions transforms(@NonNull Transformation<Bitmap>... transformations) {
return (GlideOptions) super.transforms(transformations);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,23 @@ public GlideRequest<TranscodeType> transform(@NonNull Transformation<Bitmap> tra
return (GlideRequest<TranscodeType>) super.transform(transformation);
}

/**
* @see GlideOptions#transform(Transformation<Bitmap>[])
*/
@NonNull
@CheckResult
@SuppressWarnings({
"unchecked",
"varargs"
})
public GlideRequest<TranscodeType> transform(@NonNull Transformation<Bitmap>... transformations) {
return (GlideRequest<TranscodeType>) super.transform(transformations);
}

/**
* @see GlideOptions#transforms(Transformation<Bitmap>[])
*/
@Deprecated
@NonNull
@CheckResult
@SuppressWarnings({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.bumptech.glide.request.RequestOptions;
import java.lang.Class;
import java.lang.Cloneable;
import java.lang.Deprecated;
import java.lang.Override;
import java.lang.SafeVarargs;
import java.lang.SuppressWarnings;
Expand Down Expand Up @@ -542,6 +543,16 @@ public GlideOptions transform(@NonNull Transformation<Bitmap> transformation) {
@SuppressWarnings("varargs")
@NonNull
@CheckResult
public final GlideOptions transform(@NonNull Transformation<Bitmap>... transformations) {
return (GlideOptions) super.transform(transformations);
}

@Override
@SafeVarargs
@SuppressWarnings("varargs")
@Deprecated
@NonNull
@CheckResult
public final GlideOptions transforms(@NonNull Transformation<Bitmap>... transformations) {
return (GlideOptions) super.transforms(transformations);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,23 @@ public GlideRequest<TranscodeType> transform(@NonNull Transformation<Bitmap> tra
return (GlideRequest<TranscodeType>) super.transform(transformation);
}

/**
* @see GlideOptions#transform(Transformation<Bitmap>[])
*/
@NonNull
@CheckResult
@SuppressWarnings({
"unchecked",
"varargs"
})
public GlideRequest<TranscodeType> transform(@NonNull Transformation<Bitmap>... transformations) {
return (GlideRequest<TranscodeType>) super.transform(transformations);
}

/**
* @see GlideOptions#transforms(Transformation<Bitmap>[])
*/
@Deprecated
@NonNull
@CheckResult
@SuppressWarnings({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.bumptech.glide.request.RequestOptions;
import java.lang.Class;
import java.lang.Cloneable;
import java.lang.Deprecated;
import java.lang.Override;
import java.lang.SafeVarargs;
import java.lang.SuppressWarnings;
Expand Down Expand Up @@ -552,6 +553,16 @@ public GlideOptions transform(@NonNull Transformation<Bitmap> transformation) {
@SuppressWarnings("varargs")
@NonNull
@CheckResult
public final GlideOptions transform(@NonNull Transformation<Bitmap>... transformations) {
return (GlideOptions) super.transform(transformations);
}

@Override
@SafeVarargs
@SuppressWarnings("varargs")
@Deprecated
@NonNull
@CheckResult
public final GlideOptions transforms(@NonNull Transformation<Bitmap>... transformations) {
return (GlideOptions) super.transforms(transformations);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,23 @@ public GlideRequest<TranscodeType> transform(@NonNull Transformation<Bitmap> tra
return (GlideRequest<TranscodeType>) super.transform(transformation);
}

/**
* @see GlideOptions#transform(Transformation<Bitmap>[])
*/
@NonNull
@CheckResult
@SuppressWarnings({
"unchecked",
"varargs"
})
public GlideRequest<TranscodeType> transform(@NonNull Transformation<Bitmap>... transformations) {
return (GlideRequest<TranscodeType>) super.transform(transformations);
}

/**
* @see GlideOptions#transforms(Transformation<Bitmap>[])
*/
@Deprecated
@NonNull
@CheckResult
@SuppressWarnings({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.bumptech.glide.request.RequestOptions;
import java.lang.Class;
import java.lang.Cloneable;
import java.lang.Deprecated;
import java.lang.Override;
import java.lang.SafeVarargs;
import java.lang.SuppressWarnings;
Expand Down Expand Up @@ -559,6 +560,16 @@ public GlideOptions transform(@NonNull Transformation<Bitmap> transformation) {
@SuppressWarnings("varargs")
@NonNull
@CheckResult
public final GlideOptions transform(@NonNull Transformation<Bitmap>... transformations) {
return (GlideOptions) super.transform(transformations);
}

@Override
@SafeVarargs
@SuppressWarnings("varargs")
@Deprecated
@NonNull
@CheckResult
public final GlideOptions transforms(@NonNull Transformation<Bitmap>... transformations) {
return (GlideOptions) super.transforms(transformations);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,23 @@ public GlideRequest<TranscodeType> transform(@NonNull Transformation<Bitmap> tra
return (GlideRequest<TranscodeType>) super.transform(transformation);
}

/**
* @see GlideOptions#transform(Transformation<Bitmap>[])
*/
@NonNull
@CheckResult
@SuppressWarnings({
"unchecked",
"varargs"
})
public GlideRequest<TranscodeType> transform(@NonNull Transformation<Bitmap>... transformations) {
return (GlideRequest<TranscodeType>) super.transform(transformations);
}

/**
* @see GlideOptions#transforms(Transformation<Bitmap>[])
*/
@Deprecated
@NonNull
@CheckResult
@SuppressWarnings({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.bumptech.glide.request.RequestOptions;
import java.lang.Class;
import java.lang.Cloneable;
import java.lang.Deprecated;
import java.lang.Override;
import java.lang.SafeVarargs;
import java.lang.SuppressWarnings;
Expand Down Expand Up @@ -559,6 +560,16 @@ public GlideOptions transform(@NonNull Transformation<Bitmap> transformation) {
@SuppressWarnings("varargs")
@NonNull
@CheckResult
public final GlideOptions transform(@NonNull Transformation<Bitmap>... transformations) {
return (GlideOptions) super.transform(transformations);
}

@Override
@SafeVarargs
@SuppressWarnings("varargs")
@Deprecated
@NonNull
@CheckResult
public final GlideOptions transforms(@NonNull Transformation<Bitmap>... transformations) {
return (GlideOptions) super.transforms(transformations);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,23 @@ public GlideRequest<TranscodeType> transform(@NonNull Transformation<Bitmap> tra
return (GlideRequest<TranscodeType>) super.transform(transformation);
}

/**
* @see GlideOptions#transform(Transformation<Bitmap>[])
*/
@NonNull
@CheckResult
@SuppressWarnings({
"unchecked",
"varargs"
})
public GlideRequest<TranscodeType> transform(@NonNull Transformation<Bitmap>... transformations) {
return (GlideRequest<TranscodeType>) super.transform(transformations);
}

/**
* @see GlideOptions#transforms(Transformation<Bitmap>[])
*/
@Deprecated
@NonNull
@CheckResult
@SuppressWarnings({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.bumptech.glide.request.RequestOptions;
import java.lang.Class;
import java.lang.Cloneable;
import java.lang.Deprecated;
import java.lang.Override;
import java.lang.SafeVarargs;
import java.lang.SuppressWarnings;
Expand Down Expand Up @@ -559,6 +560,16 @@ public GlideOptions transform(@NonNull Transformation<Bitmap> transformation) {
@SuppressWarnings("varargs")
@NonNull
@CheckResult
public final GlideOptions transform(@NonNull Transformation<Bitmap>... transformations) {
return (GlideOptions) super.transform(transformations);
}

@Override
@SafeVarargs
@SuppressWarnings("varargs")
@Deprecated
@NonNull
@CheckResult
public final GlideOptions transforms(@NonNull Transformation<Bitmap>... transformations) {
return (GlideOptions) super.transforms(transformations);
}
Expand Down
Loading

0 comments on commit 8a26a6b

Please sign in to comment.
  翻译: