Package com.google.common.truth
Class Platform
- java.lang.Object
-
- com.google.common.truth.Platform
-
final class Platform extends java.lang.Object
Extracted 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 class
Platform.JavaLikeOptions
(package private) static interface
Platform.JUnitTestRule
A GWT-swapped version of test rule interface that does nothing.private static interface
Platform.NativeNumber
private static class
Platform.NativeRegExp
(package private) static class
Platform.PlatformComparisonFailure
private static interface
Platform.ToLocaleStringOptions
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String
EXPECT_FAILURE_WARNING_IF_GWT
-
Constructor Summary
Constructors Modifier Constructor Description private
Platform()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static void
cleanStackTrace(java.lang.Throwable throwable)
private static Platform.NativeRegExp
compile(java.lang.String pattern)
(package private) static boolean
containsMatch(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.String
doubleToString(double value)
(package private) static java.lang.String
floatToString(float value)
(package private) static java.lang.String
getStackTraceAsString(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.String
inferDescription()
(package private) static boolean
isAndroid()
Tests if current platform is Android which is always false.(package private) static boolean
isInstanceOfType(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.String
toLocaleString(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)
-
-