Class Platform


  • final class Platform
    extends java.lang.Object
    Methods factored out so that they can be emulated differently in GWT.
    • Field Detail

      • logger

        private static final java.util.logging.Logger logger
    • Constructor Detail

      • Platform

        private Platform()
    • Method Detail

      • systemNanoTime

        static long systemNanoTime()
        Calls System.nanoTime().
      • 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()