Class Platform

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

public 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

    • TYPE_PATTERN

      public static final Pattern TYPE_PATTERN
  • Constructor Details

    • Platform

      private Platform()
  • Method Details

    • isInstanceOfType

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

      @GwtIncompatible("Reflection") static boolean isInstanceOfTypeJava(Object instance, Class<?> clazz)
      Returns true if the instance is assignable to the type Clazz (suitable for a JVM environment).
    • isInstanceOfTypeGWT

      static boolean isInstanceOfTypeGWT(Object instance, Class<?> clazz)
      Returns true if the instance is assignable to the type Clazz (suitable for a GWT environment).
    • addInterfaceNames

      private static void addInterfaceNames(Class<?>[] interfaces, Set<String> types)
    • addTypeNames

      private static void addTypeNames(Class<?> clazz, Set<String> types)
    • compressType

      public static String compressType(String type)
      Inspired by JavaWriter.
    • typeOnly

      private static String typeOnly(String type)
    • stripIfPrefixed

      private static String stripIfPrefixed(String string, String prefix)
    • stripIfInPackage

      private static String stripIfInPackage(String type, String packagePrefix)
    • comparisonFailure

      public static AssertionError comparisonFailure(String message, String expected, String actual)