android.support.annotation.NonNull类的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(421)

本文整理了Java中android.support.annotation.NonNull类的一些代码示例,展示了NonNull类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NonNull类的具体详情如下:
包路径:android.support.annotation.NonNull
类名称:NonNull

NonNull介绍

暂无

代码示例

代码示例来源:origin: bumptech/glide

/**
 * Internal method.
 */
@NonNull
public RequestManagerRetriever getRequestManagerRetriever() {
 return requestManagerRetriever;
}

代码示例来源:origin: bumptech/glide

@Override
 public void applyOptions(@NonNull Context context, @NonNull GlideBuilder builder) {
  // Default empty impl.
 }
}

代码示例来源:origin: bumptech/glide

/**
 * Returns the {@link RequestManagerTreeNode} for this fragment.
 */
@NonNull
public RequestManagerTreeNode getRequestManagerTreeNode() {
 return requestManagerTreeNode;
}

代码示例来源:origin: bumptech/glide

/**
  * Returns the class of data this factory can produce
  * {@link com.bumptech.glide.load.data.DataRewinder}s for.
  */
 @NonNull
 Class<T> getDataClass();
}

代码示例来源:origin: bumptech/glide

@NonNull
@Override
public DataSource getDataSource() {
 return DataSource.LOCAL;
}

代码示例来源:origin: bumptech/glide

@NonNull
 @Override
 public Class<InputStream> getDataClass() {
  return InputStream.class;
 }
}

代码示例来源:origin: bumptech/glide

/**
  * Removes the given listener from the set of listeners managed by this Lifecycle implementation,
  * returning {@code true} if the listener was removed successfully, and {@code false} otherwise.
  *
  * <p>This is an optimization only, there is no guarantee that every added listener will
  * eventually be removed.
  */
 void removeListener(@NonNull LifecycleListener listener);
}

代码示例来源:origin: bumptech/glide

@NonNull
@Override
public Class<InputStream> getDataClass() {
 return InputStream.class;
}

代码示例来源:origin: bumptech/glide

@NonNull
 @Override
 public DataSource getDataSource() {
  return DataSource.REMOTE;
 }
}

代码示例来源:origin: bumptech/glide

@NonNull
 ConnectivityMonitor build(
   @NonNull Context context,
   @NonNull ConnectivityMonitor.ConnectivityListener listener);
}

代码示例来源:origin: bumptech/glide

@NonNull
@Override
public Object rewindAndGet() {
 return data;
}

代码示例来源:origin: bumptech/glide

/**
  * Writes data to the file and returns true if the write was successful and should be committed,
  * and false if the write should be aborted.
  *
  * @param file The File the Writer should write to.
  */
 boolean write(@NonNull File file);
}

代码示例来源:origin: bumptech/glide

/**
  * Called when the load fails.
  *
  * @param e a non-null {@link Exception} indicating why the load failed.
  */
 void onLoadFailed(@NonNull Exception e);
}

代码示例来源:origin: bumptech/glide

/**
  * Lazily apply options to a {@link com.bumptech.glide.GlideBuilder} immediately before the Glide
  * singleton is created.
  *
  * <p> This method will be called once and only once per implementation. </p>
  *
  * @param context An Application {@link android.content.Context}.
  * @param builder The {@link com.bumptech.glide.GlideBuilder} that will be used to create Glide.
  */
 void applyOptions(@NonNull Context context, @NonNull GlideBuilder builder);
}

代码示例来源:origin: bumptech/glide

/**
 * Helper constructor that accepts an {@link FragmentActivity}.
 */
public RecyclerViewPreloader(@NonNull FragmentActivity fragmentActivity,
  @NonNull PreloadModelProvider<T> preloadModelProvider,
  @NonNull PreloadSizeProvider<T> preloadDimensionProvider,
  int maxPreload) {
 this(Glide.with(fragmentActivity), preloadModelProvider, preloadDimensionProvider, maxPreload);
}

代码示例来源:origin: bumptech/glide

/**
 * Helper constructor that accepts an {@link Fragment}.
 */
public RecyclerViewPreloader(@NonNull Fragment fragment,
  @NonNull PreloadModelProvider<T> preloadModelProvider,
  @NonNull PreloadSizeProvider<T> preloadDimensionProvider,
  int maxPreload) {
 this(Glide.with(fragment), preloadModelProvider, preloadDimensionProvider, maxPreload);
}

代码示例来源:origin: bumptech/glide

@Nullable
 @Override
 public Resource<Z> transcode(@NonNull Resource<Z> toTranscode, @NonNull Options options) {
  return toTranscode;
 }
}

代码示例来源:origin: bumptech/glide

/**
 * @deprecated Use {@link #BitmapDrawableTranscoder(Resources)}, {@code bitmapPool} is unused.
 */
@Deprecated
public BitmapDrawableTranscoder(
  @NonNull Resources resources, @SuppressWarnings("unused") BitmapPool bitmapPool) {
 this(resources);
}

代码示例来源:origin: bumptech/glide

@NonNull
 private CharSequence safeSequence(@Nullable CharSequence sequence) {
  if (sequence == null) {
   return EMPTY_SEQUENCE;
  } else {
   return sequence;
  }
 }
}

代码示例来源:origin: bumptech/glide

/**
 * Add bitmap to the cache with the given key.
 *
 * @param key      The key to retrieve the bitmap.
 * @param resource The {@link com.bumptech.glide.load.engine.EngineResource} to store.
 * @return The old value of key (null if key is not in map).
 */
@Nullable
Resource<?> put(@NonNull Key key, @Nullable Resource<?> resource);

相关文章