Top Description Fields Constructors Methods
rx.internal.util

public final Class PlatformDependent

extends Object
Class Inheritance

Allow platform dependent logic such as checks for Android. Modeled after Netty with some code copy/pasted from: https://github.com/netty/netty/blob/master/common/src/main/java/io/netty/util/internal/PlatformDependent.java

Field Summary

Modifier and TypeField and Description
private static final int
public static final int
ANDROID_API_VERSION_IS_NOT_ANDROID

Possible value of getAndroidApiVersion() which means that the current platform is not Android.

private static final boolean

Constructor Summary

AccessConstructor and Description
private
PlatformDependent()

Utility class.

Method Summary

Modifier and TypeMethod and Description
public static int

Returns:

version of Android API or ANDROID_API_VERSION_IS_NOT_ANDROID if version can not be resolved or if current platform is not Android.
getAndroidApiVersion
()

Returns version of Android API.

public static boolean

Returns:

true if and only if the current platform is Android
isAndroid
()

Returns true if and only if the current platform is Android.

private static int

Returns:

version of Android API or ANDROID_API_VERSION_IS_NOT_ANDROID if version can not be resolved or if the current platform is not Android.
resolveAndroidApiVersion
()

Resolves version of Android API.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ANDROID_API_VERSIONback to summary
private static final int ANDROID_API_VERSION
ANDROID_API_VERSION_IS_NOT_ANDROIDback to summary
public static final int ANDROID_API_VERSION_IS_NOT_ANDROID

Possible value of getAndroidApiVersion() which means that the current platform is not Android.

IS_ANDROIDback to summary
private static final boolean IS_ANDROID

Constructor Detail

PlatformDependentback to summary
private PlatformDependent()

Utility class.

Method Detail

getAndroidApiVersionback to summary
public static int getAndroidApiVersion()

Returns version of Android API.

Returns:int

version of Android API or ANDROID_API_VERSION_IS_NOT_ANDROID if version can not be resolved or if current platform is not Android.

isAndroidback to summary
public static boolean isAndroid()

Returns true if and only if the current platform is Android.

Returns:boolean

true if and only if the current platform is Android

resolveAndroidApiVersionback to summary
private static int resolveAndroidApiVersion()

Resolves version of Android API.

Returns:int

version of Android API or ANDROID_API_VERSION_IS_NOT_ANDROID if version can not be resolved or if the current platform is not Android.

See Also
Documentation