Tabnine Logo
Checks.notNull
Code IndexAdd Tabnine to your IDE (free)

How to use
notNull
method
in
vip.justlive.oxygen.core.util.Checks

Best Java code snippets using vip.justlive.oxygen.core.util.Checks.notNull (Showing top 20 results out of 315)

origin: justlive1/oxygen

/**
 * 设置失效清理策略
 *
 * @param cleanPolicy 失效清理策略
 * @return 构造器
 */
public Builder<K, V> cleanPolicy(CleanPolicy cleanPolicy) {
 Checks.notNull(cleanPolicy, "cleanPolicy can not be null");
 this.cleanPolicy = cleanPolicy;
 return this;
}
origin: justlive1/oxygen

/**
 * 设置失效策略
 *
 * @param expiringPolicy 失效策略
 * @return 构造器
 */
public Builder<K, V> expiringPolicy(ExpiringPolicy expiringPolicy) {
 Checks.notNull(expiringPolicy, "expiringPolicy can not be null");
 this.expiringPolicy = expiringPolicy;
 return this;
}
origin: justlive1/oxygen

/**
 * 非空检查
 *
 * @param obj 校验值
 * @param <T> 泛型类
 * @return 传入值
 */
public static <T> T notNull(T obj) {
 return notNull(obj, "can not be null");
}
origin: justlive1/oxygen

/**
 * 通过{@link File}创建一个 {@code FileSystemResource}
 *
 * @param file 文件
 */
public FileSystemResource(File file) {
 this.file = Checks.notNull(file);
}
origin: justlive1/oxygen

/**
 * 校验合法
 *
 * @return conf
 */
public DataSourceConf validate() {
 vip.justlive.oxygen.core.util.Checks.notNull(driverClassName, "driverClassName cannot be null");
 vip.justlive.oxygen.core.util.Checks.notNull(url, "url cannot be null");
 vip.justlive.oxygen.core.util.Checks.notNull(username, "username cannot be null");
 return this;
}
origin: justlive1/oxygen

/**
 * 增加异步失效监听列表
 *
 * @param listeners 监听
 * @return 构造器
 */
public Builder<K, V> asyncExpiredListeners(List<ExpiredListener<K, V>> listeners) {
 Checks.notNull(listeners, "listeners can not be null");
 asyncExpiredListeners = listeners;
 return this;
}
origin: justlive1/oxygen

/**
 * 使用{@code URL}创建{@code UrlResource}
 *
 * @param url URL
 */
public UrlResource(URL url) {
 this.url = Checks.notNull(url);
}
origin: justlive1/oxygen

/**
 * Sets the {@link UncaughtExceptionHandler} for new threads created with this ThreadFactory.
 *
 * @param uncaughtExceptionHandler the uncaught exception handler for new Threads created with
 * this ThreadFactory
 * @return this for the builder pattern
 */
public ThreadFactoryBuilder setUncaughtExceptionHandler(
  UncaughtExceptionHandler uncaughtExceptionHandler) {
 this.uncaughtExceptionHandler = Checks.notNull(uncaughtExceptionHandler);
 return this;
}
origin: justlive1/oxygen

/**
 * Sets the backing {@link ThreadFactory} for new threads created with this ThreadFactory. Threads
 * will be created by invoking #newThread(Runnable) on this backing {@link ThreadFactory}.
 *
 * @param backingThreadFactory the backing {@link ThreadFactory} which will be delegated to during
 * thread creation.
 * @return this for the builder pattern
 */
public ThreadFactoryBuilder setThreadFactory(ThreadFactory backingThreadFactory) {
 this.backingThreadFactory = Checks.notNull(backingThreadFactory);
 return this;
}
origin: justlive1/oxygen

/**
 * 失败监听,最终失败时触发
 *
 * @param listener 监听
 * @return builder
 */
public RetryBuilder<T> onFinalFail(Consumer<Attempt<T>> listener) {
 failListeners.add(Checks.notNull(listener));
 return this;
}
origin: justlive1/oxygen

/**
 * 重试监听,当重试时触发
 *
 * @param listener 监听
 * @return builder
 */
public RetryBuilder<T> onRetry(Consumer<Attempt<T>> listener) {
 retryListeners.add(Checks.notNull(listener));
 return this;
}
origin: justlive1/oxygen

/**
 * 通过{@link Path}创建一个 {@code FileSystemResource}
 *
 * @param path 路径
 */
public FileSystemResource(Path path) {
 this.path = Checks.notNull(path);
 this.file = path.toFile();
}
origin: justlive1/oxygen

public FixedTimeLimiter(long timeout, TimeUnit timeUnit,
  ExecutorService executorService) {
 if (timeout <= 0) {
  throw new IllegalArgumentException(String.format("timeout must be positive:%s", timeout));
 }
 this.timeout = timeout;
 this.timeUnit = Checks.notNull(timeUnit);
 this.executorService = Checks.notNull(executorService);
}
origin: justlive1/oxygen

/**
 * 通过文件路径创建一个 {@code FileSystemResource}
 *
 * @param filePath 文件路径
 */
public FileSystemResource(String filePath) {
 this.file = new File(Checks.notNull(filePath));
 this.filePath = file.toPath().normalize().toString();
}
origin: justlive1/oxygen

/**
 * 替换所有占位格式 {@code ${name}}
 *
 * @param value 需要转换的属性
 * @param properties 配置集合
 * @return 替换后的字符串
 */
public String replacePlaceholders(String value, final Properties properties) {
 Checks.notNull(properties, "'properties' must not be null");
 Checks.notNull(value, "'value' must not be null");
 return parseStringValue(value, properties, new HashSet<>());
}
origin: justlive1/oxygen

/**
 * 使用{@code ClassLoader}创建{@code ClassPathResource}
 *
 * @param path 路径
 * @param classLoader 类加载器
 */
public ClassPathResource(String path, ClassLoader classLoader) {
 this.path = this.cutRootPath(Checks.notNull(path));
 this.classLoader = classLoader;
}
origin: justlive1/oxygen

/**
 * 使用{@code Class}创建{@code ClassPathResource}
 *
 * @param path 路径
 * @param clazz 类
 */
public ClassPathResource(String path, Class<?> clazz) {
 this.path = this.cutRootPath(Checks.notNull(path));
 this.clazz = clazz;
}
origin: justlive1/oxygen

@SuppressWarnings("unchecked")
@Override
public ConverterRegistry addConverter(Converter<?, ?> converter) {
 Checks.notNull(converter);
 for (ConverterTypePair pair : converter.pairs()) {
  converters.put(pair, (Converter<Object, Object>) converter);
 }
 return this;
}
origin: justlive1/oxygen

@Override
public ConverterRegistry addArrayConverter(ArrayConverter converter) {
 Checks.notNull(converter);
 arrayConverters.put(converter.pair(), converter);
 return this;
}
origin: justlive1/oxygen

@Override
public ConverterRegistry addConverterFactory(ConverterFactory<?, ?> factory) {
 Checks.notNull(factory);
 List<Converter<Object, Object>> list = factory.converters();
 for (Converter<?, ?> converter : list) {
  addConverter(converter);
 }
 return this;
}
vip.justlive.oxygen.core.utilChecksnotNull

Javadoc

非空检查

Popular methods of Checks

  • blankSpace
  • chinese
  • decimals
  • digit
  • email
  • idCard
  • ip
  • mobile
  • phone
  • postcode

Popular in Java

  • Start an intent from android
  • startActivity (Activity)
  • getSharedPreferences (Context)
  • onRequestPermissionsResult (Fragment)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now