Class Platform

java.lang.Object
com.google.common.truth.Platform

final class Platform extends Object
Extracted routines that need to be swapped in for GWT, to allow for minimal deltas between the GWT and non-GWT version.
  • Field Details

  • Constructor Details

    • Platform

      private Platform()
  • Method Details

    • isInstanceOfType

      static boolean isInstanceOfType(Object instance, Class<?> clazz)
      Returns true if the instance is assignable to the type Clazz.
    • containsMatch

      static boolean containsMatch(String actual, String regex)
      Determines if the given subject contains a match for the given regex.
    • getSuppressed

      static Throwable[] getSuppressed(Throwable throwable)
      Returns an array containing all of the exceptions that were suppressed to deliver the given exception. If suppressed exceptions are not supported (pre-Java 1.7), an empty array will be returned.
    • cleanStackTrace

      static void cleanStackTrace(Throwable throwable)
    • inferDescription

      static String inferDescription()
      Tries to infer a name for the root actual value from the bytecode. The "root" actual value is the value passed to assertThat or that, as distinct from any later actual values produced by chaining calls like hasMessageThat.
    • makeDiff

      static com.google.common.collect.ImmutableList<Fact> makeDiff(String expected, String actual)
    • splitLines

      private static com.google.common.collect.ImmutableList<String> splitLines(String s)
    • doubleToString

      static String doubleToString(double value)
    • floatToString

      static String floatToString(float value)
    • getStackTraceAsString

      static String getStackTraceAsString(Throwable throwable)
      Returns a human readable string representation of the throwable's stack trace.
    • isAndroid

      static boolean isAndroid()
      Tests if current platform is Android.
    • isInferDescriptionDisabled

      private static boolean isInferDescriptionDisabled()