Package com.google.common.base
Class Platform
- java.lang.Object
-
- com.google.common.base.Platform
-
final class Platform extends java.lang.Object
Methods factored out so that they can be emulated differently in GWT.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
Platform.JdkPatternCompiler
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
logger
private static PatternCompiler
patternCompiler
-
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
checkGwtRpcEnabled()
(package private) static CommonPattern
compilePattern(java.lang.String pattern)
(package private) static java.lang.String
emptyToNull(java.lang.String string)
Returns the string if it is not empty, or a null string otherwise.(package private) static java.lang.String
formatCompact4Digits(double value)
(package private) static <T extends java.lang.Enum<T>>
Optional<T>getEnumIfPresent(java.lang.Class<T> enumClass, java.lang.String value)
private static PatternCompiler
loadPatternCompiler()
private static void
logPatternCompilerError(java.util.ServiceConfigurationError e)
(package private) static java.lang.String
nullToEmpty(java.lang.String string)
Returns the string if it is not null, or an empty string otherwise.(package private) static boolean
patternCompilerIsPcreLike()
(package private) static CharMatcher
precomputeCharMatcher(CharMatcher matcher)
(package private) static boolean
stringIsNullOrEmpty(java.lang.String string)
(package private) static long
systemNanoTime()
CallsSystem.nanoTime()
.
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
patternCompiler
private static final PatternCompiler patternCompiler
-
-
Method Detail
-
systemNanoTime
static long systemNanoTime()
CallsSystem.nanoTime()
.
-
precomputeCharMatcher
static CharMatcher precomputeCharMatcher(CharMatcher matcher)
-
getEnumIfPresent
static <T extends java.lang.Enum<T>> Optional<T> getEnumIfPresent(java.lang.Class<T> enumClass, java.lang.String value)
-
formatCompact4Digits
static java.lang.String formatCompact4Digits(double value)
-
stringIsNullOrEmpty
static boolean stringIsNullOrEmpty(@CheckForNull java.lang.String string)
-
nullToEmpty
static java.lang.String nullToEmpty(@CheckForNull java.lang.String string)
Returns the string if it is not null, or an empty string otherwise.- Parameters:
string
- the string to test and possibly return- Returns:
string
if it is not null;""
otherwise
-
emptyToNull
@CheckForNull static java.lang.String emptyToNull(@CheckForNull java.lang.String string)
Returns the string if it is not empty, or a null string otherwise.- Parameters:
string
- the string to test and possibly return- Returns:
string
if it is not empty;null
otherwise
-
compilePattern
static CommonPattern compilePattern(java.lang.String pattern)
-
patternCompilerIsPcreLike
static boolean patternCompilerIsPcreLike()
-
loadPatternCompiler
private static PatternCompiler loadPatternCompiler()
-
logPatternCompilerError
private static void logPatternCompilerError(java.util.ServiceConfigurationError e)
-
checkGwtRpcEnabled
static void checkGwtRpcEnabled()
-
-