Package com.google.common.truth
Class Platform
- java.lang.Object
-
- com.google.common.truth.Platform
-
public 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.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.regex.Pattern
TYPE_PATTERN
-
Constructor Summary
Constructors Modifier Constructor Description private
Platform()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
addInterfaceNames(java.lang.Class<?>[] interfaces, java.util.Set<java.lang.String> types)
private static void
addTypeNames(java.lang.Class<?> clazz, java.util.Set<java.lang.String> types)
static java.lang.AssertionError
comparisonFailure(java.lang.String message, java.lang.String expected, java.lang.String actual)
static java.lang.String
compressType(java.lang.String type)
Inspired by JavaWriter.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 boolean
isInstanceOfTypeGWT(java.lang.Object instance, java.lang.Class<?> clazz)
Returns true if the instance is assignable to the type Clazz (suitable for a GWT environment).(package private) static boolean
isInstanceOfTypeJava(java.lang.Object instance, java.lang.Class<?> clazz)
Returns true if the instance is assignable to the type Clazz (suitable for a JVM environment).private static java.lang.String
stripIfInPackage(java.lang.String type, java.lang.String packagePrefix)
private static java.lang.String
stripIfPrefixed(java.lang.String string, java.lang.String prefix)
private static java.lang.String
typeOnly(java.lang.String type)
-
-
-
Method Detail
-
isInstanceOfType
public static boolean isInstanceOfType(java.lang.Object instance, java.lang.Class<?> clazz)
Returns true if the instance is assignable to the type Clazz.
-
isInstanceOfTypeJava
@GwtIncompatible("Reflection") static boolean isInstanceOfTypeJava(java.lang.Object instance, java.lang.Class<?> clazz)
Returns true if the instance is assignable to the type Clazz (suitable for a JVM environment).
-
isInstanceOfTypeGWT
static boolean isInstanceOfTypeGWT(java.lang.Object instance, java.lang.Class<?> clazz)
Returns true if the instance is assignable to the type Clazz (suitable for a GWT environment).
-
addInterfaceNames
private static void addInterfaceNames(java.lang.Class<?>[] interfaces, java.util.Set<java.lang.String> types)
-
addTypeNames
private static void addTypeNames(java.lang.Class<?> clazz, java.util.Set<java.lang.String> types)
-
compressType
public static java.lang.String compressType(java.lang.String type)
Inspired by JavaWriter.
-
typeOnly
private static java.lang.String typeOnly(java.lang.String type)
-
stripIfPrefixed
private static java.lang.String stripIfPrefixed(java.lang.String string, java.lang.String prefix)
-
stripIfInPackage
private static java.lang.String stripIfInPackage(java.lang.String type, java.lang.String packagePrefix)
-
comparisonFailure
public static java.lang.AssertionError comparisonFailure(java.lang.String message, java.lang.String expected, java.lang.String actual)
-
-