当前位置: 首页>>代码示例>>Java>>正文


Java ExoPlayerLibraryInfo.ASSERTIONS_ENABLED属性代码示例

本文整理汇总了Java中com.google.android.exoplayer.ExoPlayerLibraryInfo.ASSERTIONS_ENABLED属性的典型用法代码示例。如果您正苦于以下问题:Java ExoPlayerLibraryInfo.ASSERTIONS_ENABLED属性的具体用法?Java ExoPlayerLibraryInfo.ASSERTIONS_ENABLED怎么用?Java ExoPlayerLibraryInfo.ASSERTIONS_ENABLED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.google.android.exoplayer.ExoPlayerLibraryInfo的用法示例。


在下文中一共展示了ExoPlayerLibraryInfo.ASSERTIONS_ENABLED属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkMainThread

/**
 * Ensures that the calling thread is the application's main thread.
 *
 * @throws IllegalStateException If the calling thread is not the application's main thread.
 */
public static void checkMainThread() {
  if (ExoPlayerLibraryInfo.ASSERTIONS_ENABLED && Looper.myLooper() != Looper.getMainLooper()) {
    throw new IllegalStateException("Not in applications main thread");
  }
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:10,代码来源:Assertions.java

示例2: checkNotNull

/**
 * Ensures that an object reference is not null.
 *
 * @param reference An object reference.
 * @return The non-null reference that was validated.
 * @throws NullPointerException If {@code reference} is null.
 */
public static <T> T checkNotNull(T reference) {
  if (ExoPlayerLibraryInfo.ASSERTIONS_ENABLED && reference == null) {
    throw new NullPointerException();
  }
  return reference;
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:13,代码来源:Assertions.java

示例3: checkNotEmpty

/**
 * Ensures that a string passed as an argument to the calling method is not null or 0-length.
 *
 * @param string A string.
 * @return The non-null, non-empty string that was validated.
 * @throws IllegalArgumentException If {@code string} is null or 0-length.
 */
public static String checkNotEmpty(String string) {
  if (ExoPlayerLibraryInfo.ASSERTIONS_ENABLED && TextUtils.isEmpty(string)) {
    throw new IllegalArgumentException();
  }
  return string;
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:13,代码来源:Assertions.java

示例4: checkNotNull

/**
 * Ensures that an object reference is not null.
 *
 * @param reference An object reference.
 * @param errorMessage The exception message to use if the check fails. The message is converted
 *     to a string using {@link String#valueOf(Object)}.
 * @return The non-null reference that was validated.
 * @throws NullPointerException If {@code reference} is null.
 */
public static <T> T checkNotNull(T reference, Object errorMessage) {
  if (ExoPlayerLibraryInfo.ASSERTIONS_ENABLED && reference == null) {
    throw new NullPointerException(String.valueOf(errorMessage));
  }
  return reference;
}
 
开发者ID:Weco,项目名称:android-exoplayer,代码行数:15,代码来源:Assertions.java

示例5: checkNotEmpty

/**
 * Ensures that a string passed as an argument to the calling method is not null or 0-length.
 *
 * @param string A string.
 * @param errorMessage The exception message to use if the check fails. The message is converted
 *     to a string using {@link String#valueOf(Object)}.
 * @return The non-null, non-empty string that was validated.
 * @throws IllegalArgumentException If {@code string} is null or 0-length.
 */
public static String checkNotEmpty(String string, Object errorMessage) {
  if (ExoPlayerLibraryInfo.ASSERTIONS_ENABLED && TextUtils.isEmpty(string)) {
    throw new IllegalArgumentException(String.valueOf(errorMessage));
  }
  return string;
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:15,代码来源:Assertions.java

示例6: checkArgument

/**
 * Ensures the truth of an expression involving one or more arguments passed to the calling
 * method.
 *
 * @param expression A boolean expression.
 * @throws IllegalArgumentException If {@code expression} is false.
 */
public static void checkArgument(boolean expression) {
  if (ExoPlayerLibraryInfo.ASSERTIONS_ENABLED && !expression) {
    throw new IllegalArgumentException();
  }
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:12,代码来源:Assertions.java

示例7: checkState

/**
 * Ensures the truth of an expression involving the state of the calling instance.
 *
 * @param expression A boolean expression.
 * @throws IllegalStateException If {@code expression} is false.
 */
public static void checkState(boolean expression) {
  if (ExoPlayerLibraryInfo.ASSERTIONS_ENABLED && !expression) {
    throw new IllegalStateException();
  }
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:11,代码来源:Assertions.java


注:本文中的com.google.android.exoplayer.ExoPlayerLibraryInfo.ASSERTIONS_ENABLED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。