Skip to content

Commit

Permalink
Add nullability annotations to library module (1/n) (#2681)
Browse files Browse the repository at this point in the history
* Add nullability annotations

Signed-off-by: Alex Saveau <[email protected]>
  • Loading branch information
SUPERCILEX authored and sjudd committed Dec 12, 2017
1 parent fb5d608 commit 0cffd1d
Show file tree
Hide file tree
Showing 31 changed files with 547 additions and 145 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import android.support.v4.app.FragmentActivity;
Expand Down Expand Up @@ -31,23 +32,24 @@ private GlideApp() {
* @see Glide#getPhotoCacheDir(Context)
*/
@Nullable
public static File getPhotoCacheDir(Context context) {
return Glide.getPhotoCacheDir(context);
public static File getPhotoCacheDir(Context arg0) {
return Glide.getPhotoCacheDir(arg0);
}

/**
* @see Glide#getPhotoCacheDir(Context, String)
*/
@Nullable
public static File getPhotoCacheDir(Context context, String cacheName) {
return Glide.getPhotoCacheDir(context, cacheName);
public static File getPhotoCacheDir(Context arg0, String arg1) {
return Glide.getPhotoCacheDir(arg0, arg1);
}

/**
* @see Glide#get(Context)
*/
public static Glide get(Context context) {
return Glide.get(context);
@NonNull
public static Glide get(Context arg0) {
return Glide.get(arg0);
}

/**
Expand All @@ -65,8 +67,8 @@ public static void init(Glide glide) {
*/
@VisibleForTesting
@SuppressLint("VisibleForTests")
public static void init(Context context, GlideBuilder builder) {
Glide.init(context, builder);
public static void init(Context arg0, GlideBuilder arg1) {
Glide.init(arg0, arg1);
}

/**
Expand All @@ -81,42 +83,42 @@ public static void tearDown() {
/**
* @see Glide#with(Context)
*/
public static GlideRequests with(Context context) {
return (GlideRequests) Glide.with(context);
public static GlideRequests with(Context arg0) {
return (GlideRequests) Glide.with(arg0);
}

/**
* @see Glide#with(Activity)
*/
public static GlideRequests with(Activity activity) {
return (GlideRequests) Glide.with(activity);
public static GlideRequests with(Activity arg0) {
return (GlideRequests) Glide.with(arg0);
}

/**
* @see Glide#with(FragmentActivity)
*/
public static GlideRequests with(FragmentActivity activity) {
return (GlideRequests) Glide.with(activity);
public static GlideRequests with(FragmentActivity arg0) {
return (GlideRequests) Glide.with(arg0);
}

/**
* @see Glide#with(Fragment)
*/
public static GlideRequests with(Fragment fragment) {
return (GlideRequests) Glide.with(fragment);
public static GlideRequests with(Fragment arg0) {
return (GlideRequests) Glide.with(arg0);
}

/**
* @see Glide#with(Fragment)
*/
public static GlideRequests with(android.support.v4.app.Fragment fragment) {
return (GlideRequests) Glide.with(fragment);
public static GlideRequests with(android.support.v4.app.Fragment arg0) {
return (GlideRequests) Glide.with(arg0);
}

/**
* @see Glide#with(View)
*/
public static GlideRequests with(View view) {
return (GlideRequests) Glide.with(view);
public static GlideRequests with(View arg0) {
return (GlideRequests) Glide.with(arg0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -608,35 +608,41 @@ public GlideRequest<TranscodeType> dontAnimate() {
}

@Override
@NonNull
@CheckResult
public GlideRequest<TranscodeType> apply(@NonNull RequestOptions arg0) {
return (GlideRequest<TranscodeType>) super.apply(arg0);
}

@Override
@NonNull
@CheckResult
public GlideRequest<TranscodeType> transition(@NonNull TransitionOptions<?, ? super TranscodeType> arg0) {
return (GlideRequest<TranscodeType>) super.transition(arg0);
}

@Override
@NonNull
@CheckResult
public GlideRequest<TranscodeType> listener(@Nullable RequestListener<TranscodeType> arg0) {
return (GlideRequest<TranscodeType>) super.listener(arg0);
}

@Override
@NonNull
public GlideRequest<TranscodeType> error(@Nullable RequestBuilder<TranscodeType> arg0) {
return (GlideRequest<TranscodeType>) super.error(arg0);
}

@Override
@NonNull
@CheckResult
public GlideRequest<TranscodeType> thumbnail(@Nullable RequestBuilder<TranscodeType> arg0) {
return (GlideRequest<TranscodeType>) super.thumbnail(arg0);
}

@Override
@NonNull
@CheckResult
@SafeVarargs
@SuppressWarnings("varargs")
Expand All @@ -645,48 +651,56 @@ public final GlideRequest<TranscodeType> thumbnail(@Nullable RequestBuilder<Tran
}

@Override
@NonNull
@CheckResult
public GlideRequest<TranscodeType> thumbnail(float sizeMultiplier) {
return (GlideRequest<TranscodeType>) super.thumbnail(sizeMultiplier);
}

@Override
@NonNull
@CheckResult
public GlideRequest<TranscodeType> load(@Nullable Object arg0) {
return (GlideRequest<TranscodeType>) super.load(arg0);
}

@Override
@NonNull
@CheckResult
public GlideRequest<TranscodeType> load(@Nullable Bitmap arg0) {
return (GlideRequest<TranscodeType>) super.load(arg0);
}

@Override
@NonNull
@CheckResult
public GlideRequest<TranscodeType> load(@Nullable Drawable arg0) {
return (GlideRequest<TranscodeType>) super.load(arg0);
}

@Override
@NonNull
@CheckResult
public GlideRequest<TranscodeType> load(@Nullable String arg0) {
return (GlideRequest<TranscodeType>) super.load(arg0);
}

@Override
@NonNull
@CheckResult
public GlideRequest<TranscodeType> load(@Nullable Uri arg0) {
return (GlideRequest<TranscodeType>) super.load(arg0);
}

@Override
@NonNull
@CheckResult
public GlideRequest<TranscodeType> load(@Nullable File arg0) {
return (GlideRequest<TranscodeType>) super.load(arg0);
}

@Override
@NonNull
@CheckResult
public GlideRequest<TranscodeType> load(@RawRes @DrawableRes @Nullable Integer arg0) {
return (GlideRequest<TranscodeType>) super.load(arg0);
Expand All @@ -700,6 +714,7 @@ public GlideRequest<TranscodeType> load(@Nullable URL arg0) {
}

@Override
@NonNull
@CheckResult
public GlideRequest<TranscodeType> load(@Nullable byte[] arg0) {
return (GlideRequest<TranscodeType>) super.load(arg0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,64 +43,73 @@ public <ResourceType> GlideRequest<ResourceType> as(Class<ResourceType> resource
}

@Override
public GlideRequests applyDefaultRequestOptions(RequestOptions requestOptions) {
return (GlideRequests) super.applyDefaultRequestOptions(requestOptions);
public GlideRequests applyDefaultRequestOptions(@NonNull RequestOptions arg0) {
return (GlideRequests) super.applyDefaultRequestOptions(arg0);
}

@Override
public GlideRequests setDefaultRequestOptions(RequestOptions requestOptions) {
return (GlideRequests) super.setDefaultRequestOptions(requestOptions);
public GlideRequests setDefaultRequestOptions(@NonNull RequestOptions arg0) {
return (GlideRequests) super.setDefaultRequestOptions(arg0);
}

@Override
@NonNull
@CheckResult
public GlideRequest<Bitmap> asBitmap() {
return (GlideRequest<Bitmap>) super.asBitmap();
}

@Override
@NonNull
@CheckResult
public GlideRequest<GifDrawable> asGif() {
return (GlideRequest<GifDrawable>) super.asGif();
}

@Override
@NonNull
@CheckResult
public GlideRequest<Drawable> asDrawable() {
return (GlideRequest<Drawable>) super.asDrawable();
}

@Override
@NonNull
@CheckResult
public GlideRequest<Drawable> load(@Nullable Bitmap arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@NonNull
@CheckResult
public GlideRequest<Drawable> load(@Nullable Drawable arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@NonNull
@CheckResult
public GlideRequest<Drawable> load(@Nullable String arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@NonNull
@CheckResult
public GlideRequest<Drawable> load(@Nullable Uri arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@NonNull
@CheckResult
public GlideRequest<Drawable> load(@Nullable File arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@NonNull
@CheckResult
public GlideRequest<Drawable> load(@Nullable Integer arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
Expand All @@ -114,30 +123,35 @@ public GlideRequest<Drawable> load(@Nullable URL arg0) {
}

@Override
@NonNull
@CheckResult
public GlideRequest<Drawable> load(@Nullable byte[] arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@NonNull
@CheckResult
public GlideRequest<Drawable> load(@Nullable Object arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@NonNull
@CheckResult
public GlideRequest<File> downloadOnly() {
return (GlideRequest<File>) super.downloadOnly();
}

@Override
@NonNull
@CheckResult
public GlideRequest<File> download(@Nullable Object arg0) {
return (GlideRequest<File>) super.download(arg0);
}

@Override
@NonNull
@CheckResult
public GlideRequest<File> asFile() {
return (GlideRequest<File>) super.asFile();
Expand Down
Loading

0 comments on commit 0cffd1d

Please sign in to comment.