Class UrlUtf8

  • All Implemented Interfaces:

    
    public class UrlUtf8
    
                        

    Helper to encode and decode URLs to and from UTF-8.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      UrlUtf8()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static String encodePChars(@Nullable() String text) Accepts a text and encodes it as valid pchar according to RFC3986.
      static String encodePChars(@Nullable() String text, boolean escapeAmpersand) Accepts a text and encodes it as valid pchar according to RFC3986.
      static String decodePChars(@Nullable() String text) Accepts a text and decodes it as pchar according to RFC3986.
      • Methods inherited from class java.lang.Object

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

      • UrlUtf8

        UrlUtf8()
    • Method Detail

      • encodePChars

         static String encodePChars(@Nullable() String text)

        Accepts a text and encodes it as valid pchar according to RFC3986.

        Parameters:
        text - the text to encode.
        Returns:

        the encoded text or an empty string if text was null.

      • encodePChars

         static String encodePChars(@Nullable() String text, boolean escapeAmpersand)

        Accepts a text and encodes it as valid pchar according to RFC3986.

        Parameters:
        text - the text to encode.
        escapeAmpersand - percent-encode ampersands (&) in the text.
        Returns:

        the encoded text or an empty string if text was null.

      • decodePChars

         static String decodePChars(@Nullable() String text)

        Accepts a text and decodes it as pchar according to RFC3986.

        Parameters:
        text - the text to decode.
        Returns:

        the encoded text or an empty string if text was null.