Class StringUtils


  • public class StringUtils
    extends java.lang.Object
    String utility methods.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static char[] HEX_CHARS  
    • Constructor Summary

      Constructors 
      Constructor Description
      StringUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String javaScriptString​(java.lang.String value)
      Generate JavaScript code that evaluates to the supplied string.
      static java.lang.String toHexString​(byte[] bytes)
      Returns a string representation of the byte array as a series of hexadecimal characters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • HEX_CHARS

        public static char[] HEX_CHARS
    • Constructor Detail

      • StringUtils

        public StringUtils()
    • Method Detail

      • javaScriptString

        public static java.lang.String javaScriptString​(java.lang.String value)
        Generate JavaScript code that evaluates to the supplied string. Adapted from ScriptRuntime.escapeString(String) . The difference is that we quote with either " or ' depending on which one is used less inside the string.
      • toHexString

        public static java.lang.String toHexString​(byte[] bytes)
        Returns a string representation of the byte array as a series of hexadecimal characters.
        Parameters:
        bytes - byte array to convert
        Returns:
        a string representation of the byte array as a series of hexadecimal characters