org.checkerframework.checker.nullness.qual.NonNull.<init>()方法的使用及代码示例

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

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

NonNull.<init>介绍

暂无

代码示例

代码示例来源:origin: ben-manes/caffeine

/**
 * Asynchronously computes or retrieves the value corresponding to {@code key}.
 *
 * @param key the non-null key whose value should be loaded
 * @param executor the executor with which the entry is asynchronously loaded
 * @return the future value associated with {@code key}
 */
@NonNull
CompletableFuture<V> asyncLoad(@NonNull K key, @NonNull Executor executor);

代码示例来源:origin: ben-manes/caffeine

/**
  * Returns a view of the entries stored in this cache as a synchronous {@link Cache}. A mapping is
  * not present if the value is currently being loaded. Modifications made to the synchronous cache
  * directly affect the asynchronous cache. If a modification is made to a mapping that is
  * currently loading, the operation blocks until the computation completes.
  *
  * @return a thread-safe synchronous view of this cache
  */
 @NonNull
 Cache<K, V> synchronous();
}

代码示例来源:origin: ben-manes/caffeine

/**
 * Returns a snapshot of this counter's values. Note that this may be an inconsistent view, as it
 * may be interleaved with update operations.
 *
 * @return a snapshot of this counter's values
 */
@NonNull
CacheStats snapshot();

代码示例来源:origin: ben-manes/caffeine

/**
 * Returns an accumulator that does not record any cache events.
 *
 * @return an accumulator that does not record metrics
 */
static @NonNull StatsCounter disabledStatsCounter() {
 return DisabledStatsCounter.INSTANCE;
}

代码示例来源:origin: ben-manes/caffeine

/**
 * Returns a statistics instance where no cache events have been recorded.
 *
 * @return an empty statistics instance
 */
@NonNull
public static CacheStats empty() {
 return EMPTY_STATS;
}

代码示例来源:origin: ben-manes/caffeine

/**
 * Discards any cached values for the {@code keys}. The behavior of this operation is undefined
 * for an entry that is being loaded and is otherwise not present.
 *
 * @param keys the keys whose associated values are to be removed
 * @throws NullPointerException if the specified collection is null or contains a null element
 */
void invalidateAll(@NonNull Iterable<?> keys);

代码示例来源:origin: ben-manes/caffeine

/**
 * Returns a current snapshot of this cache's cumulative statistics. All statistics are
 * initialized to zero, and are monotonically increasing over the lifetime of the cache.
 * <p>
 * Due to the performance penalty of maintaining statistics, some implementations may not record
 * the usage history immediately or at all.
 *
 * @return the current snapshot of the statistics of this cache
 */
@NonNull
CacheStats stats();

代码示例来源:origin: ben-manes/caffeine

/**
 * Returns a view of the entries stored in this cache as a thread-safe map. Modifications made to
 * the map directly affect the cache.
 * <p>
 * Iterators from the returned map are at least <i>weakly consistent</i>: they are safe for
 * concurrent use, but if the cache is modified (including by eviction) after the iterator is
 * created, it is undefined which of the changes (if any) will be reflected in that iterator.
 *
 * @return a thread-safe view of this cache supporting all of the optional {@link Map} operations
 */
@NonNull
ConcurrentMap<@NonNull K, @NonNull V> asMap();

代码示例来源:origin: ben-manes/caffeine

/** Returns the last node in the linked list. */
@NonNull static <E> Node<E> findLast(@NonNull Node<E> node) {
 Node<E> next;
 while ((next = node.getNextRelaxed()) != null) {
  node = next;
 }
 return node;
}

代码示例来源:origin: ben-manes/caffeine

/**
  * Returns an accumulator that suppresses and logs any exception thrown by the delegate
  * <tt>statsCounter</tt>.
  *
  * @param statsCounter the accumulator to delegate to
  * @return an accumulator that suppresses and logs any exception thrown by the delegate
  */
 static @NonNull StatsCounter guardedStatsCounter(@NonNull StatsCounter statsCounter) {
  return new GuardedStatsCounter(statsCounter);
 }
}

代码示例来源:origin: ben-manes/caffeine

/**
 * Deletes the value corresponding to the {@code key} from the external resource. The cache will
 * communicate a delete when the entry is explicitly removed or evicted.
 *
 * @param key the non-null key whose value was removed
 * @param value the value associated with {@code key}, or {@code null} if collected
 * @param cause the reason for which the entry was removed
 * @throws RuntimeException or Error, in which case the mapping is unchanged
 */
void delete(@NonNull K key, @Nullable V value, @NonNull RemovalCause cause);

代码示例来源:origin: ben-manes/caffeine

/**
 * Returns the weight of a cache entry. There is no unit for entry weights; rather they are simply
 * relative to each other.
 *
 * @param key the key to weigh
 * @param value the value to weigh
 * @return the weight of the entry; must be non-negative
 */
@NonNegative
int weigh(@NonNull K key, @NonNull V value);

代码示例来源:origin: ben-manes/caffeine

@Override
default CompletableFuture<V> get(@NonNull K key,
  @NonNull Function<? super K, ? extends V> mappingFunction) {
 requireNonNull(mappingFunction);
 return get(key, (k1, executor) -> CompletableFuture.supplyAsync(
   () -> mappingFunction.apply(key), executor));
}

代码示例来源:origin: ben-manes/caffeine

/**
 * @return the cause for which the entry was removed
 */
@NonNull
public RemovalCause getCause() {
 return cause;
}

代码示例来源:origin: ben-manes/caffeine

/**
 * Returns the future associated with {@code key} in this cache, or {@code null} if there is no
 * cached future for {@code key}.
 *
 * @param key key whose associated value is to be returned
 * @return the current (existing or computed) future value to which the specified key is mapped,
 *         or {@code null} if this map contains no mapping for the key
 * @throws NullPointerException if the specified key is null
 */
@Nullable
CompletableFuture<V> getIfPresent(@NonNull Object key);

代码示例来源:origin: ben-manes/caffeine

/**
 * Returns a Caffeine cache wrapped in a Guava {@link Cache} facade.
 *
 * @param builder the configured cache builder
 * @return a cache exposed under the Guava APIs
 */
@NonNull
public static <K, V, K1 extends K, V1 extends V> Cache<K1, V1> build(
  @NonNull Caffeine<K, V> builder) {
 return new CaffeinatedGuavaCache<>(builder.build());
}

代码示例来源:origin: ben-manes/caffeine

/**
 * Returns the value associated with the {@code key} in this cache, or {@code null} if there is no
 * cached value for the {@code key}.
 *
 * @param key the key whose associated value is to be returned
 * @return the value to which the specified key is mapped, or {@code null} if this map contains no
 *         mapping for the key
 * @throws NullPointerException if the specified key is null
 */
@Nullable
V getIfPresent(@NonNull Object key);

代码示例来源:origin: ben-manes/caffeine

public JCacheExpiryPolicy(@NonNull Duration creation,
  @Nullable Duration update, @Nullable Duration access) {
 this.creation = requireNonNull(creation);
 this.update = update;
 this.access = access;
}

代码示例来源:origin: ben-manes/caffeine

public SoftValueReference(@NonNull Object keyReference,
  @Nullable V value, @Nullable ReferenceQueue<V> queue) {
 super(value, queue);
 this.keyReference = keyReference;
}

代码示例来源:origin: ben-manes/caffeine

/**
 * Removes a timer event for this entry if present.
 *
 * @param node the entry in the cache
 */
public void deschedule(@NonNull Node<K, V> node) {
 unlink(node);
 node.setNextInVariableOrder(null);
 node.setPreviousInVariableOrder(null);
}

相关文章

微信公众号

最新文章

更多

NonNull类方法