Class 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.
    • 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • EXPECT_FAILURE_WARNING_IF_GWT

        static final java.lang.String EXPECT_FAILURE_WARNING_IF_GWT
        See Also:
        Constant Field Values
    • Constructor Detail

      • Platform

        private Platform()
    • 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.