Package com.google.common.truth
Class Platform
- java.lang.Object
-
- com.google.common.truth.Platform
-
final class Platform extends java.lang.ObjectExtracted routines that need to be swapped in for GWT, to allow for minimal deltas between the GWT and non-GWT version.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classPlatform.JavaLikeOptions(package private) static interfacePlatform.JUnitTestRuleA GWT-swapped version of test rule interface that does nothing.private static interfacePlatform.NativeNumberprivate static classPlatform.NativeRegExp(package private) static classPlatform.PlatformComparisonFailureprivate static interfacePlatform.ToLocaleStringOptions
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.StringEXPECT_FAILURE_WARNING_IF_GWT
-
Constructor Summary
Constructors Modifier Constructor Description privatePlatform()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static voidcleanStackTrace(java.lang.Throwable throwable)private static Platform.NativeRegExpcompile(java.lang.String pattern)(package private) static booleancontainsMatch(java.lang.String subject, java.lang.String regex)Determines if the given subject contains a match for the given regex.(package private) static java.lang.StringdoubleToString(double value)(package private) static java.lang.StringfloatToString(float value)(package private) static java.lang.StringgetStackTraceAsString(java.lang.Throwable throwable)Returns a human readable string representation of the throwable's stack trace.(package private) static java.lang.Throwable[]getSuppressed(java.lang.Throwable throwable)Returns an array containing all of the exceptions that were suppressed to deliver the given exception.(package private) static java.lang.StringinferDescription()(package private) static booleanisAndroid()Tests if current platform is Android which is always false.(package private) static booleanisInstanceOfType(java.lang.Object instance, java.lang.Class<?> clazz)Returns true if the instance is assignable to the type Clazz.(package private) static com.google.common.collect.ImmutableList<Fact>makeDiff(java.lang.String expected, java.lang.String actual)private static java.lang.StringtoLocaleString(double value)
-
-
-
Field Detail
-
EXPECT_FAILURE_WARNING_IF_GWT
static final java.lang.String EXPECT_FAILURE_WARNING_IF_GWT
- See Also:
- Constant Field Values
-
-
Method Detail
-
isInstanceOfType
static boolean isInstanceOfType(java.lang.Object instance, java.lang.Class<?> clazz)Returns true if the instance is assignable to the type Clazz.
-
containsMatch
static boolean containsMatch(java.lang.String subject, java.lang.String regex)Determines if the given subject contains a match for the given regex.
-
getSuppressed
static java.lang.Throwable[] getSuppressed(java.lang.Throwable throwable)
Returns an array containing all of the exceptions that were suppressed to deliver the given exception. Delegates to the getSuppressed() method on Throwable that is available in Java 1.7+
-
cleanStackTrace
static void cleanStackTrace(java.lang.Throwable throwable)
-
inferDescription
static java.lang.String inferDescription()
-
makeDiff
static com.google.common.collect.ImmutableList<Fact> makeDiff(java.lang.String expected, java.lang.String actual)
-
doubleToString
static java.lang.String doubleToString(double value)
-
floatToString
static java.lang.String floatToString(float value)
-
toLocaleString
private static java.lang.String toLocaleString(double value)
-
isAndroid
static boolean isAndroid()
Tests if current platform is Android which is always false.
-
getStackTraceAsString
static java.lang.String getStackTraceAsString(java.lang.Throwable throwable)
Returns a human readable string representation of the throwable's stack trace.
-
compile
private static Platform.NativeRegExp compile(java.lang.String pattern)
-
-