Enum AsciiStringURLCodec

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      SINGLETON  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.CharSequence decode​(io.netty.util.AsciiString s, java.nio.charset.Charset enc)
      Decodes a application/x-www-form-urlencoded string using a specific encoding scheme.
      static io.netty.util.AsciiString encode​(java.lang.CharSequence s, java.nio.charset.Charset enc)
      Translates a string into application/x-www-form-urlencoded format using a specific encoding scheme.
      static AsciiStringURLCodec valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static AsciiStringURLCodec[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • values

        public static AsciiStringURLCodec[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (AsciiStringURLCodec c : AsciiStringURLCodec.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static AsciiStringURLCodec valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • encode

        @Nonnull
        public static io.netty.util.AsciiString encode​(@Nonnull
                                                       java.lang.CharSequence s,
                                                       @Nonnull
                                                       java.nio.charset.Charset enc)
        Translates a string into application/x-www-form-urlencoded format using a specific encoding scheme. This method uses the supplied encoding scheme to obtain the bytes for unsafe characters.

        Note: The World Wide Web Consortium Recommendation states that UTF-8 should be used. Not doing so may introduce incompatibilities.

        Parameters:
        s - CharSequence to be translated.
        enc - The name of a supported character encoding.
        Returns:
        the translated AsciiString.
        See Also:
        URLEncoder.encode(java.lang.String, java.lang.String)
      • decode

        @Nonnull
        public static java.lang.CharSequence decode​(@Nonnull
                                                    io.netty.util.AsciiString s,
                                                    @Nonnull
                                                    java.nio.charset.Charset enc)
        Decodes a application/x-www-form-urlencoded string using a specific encoding scheme. The supplied encoding is used to determine what characters are represented by any consecutive sequences of the form "%xy".

        Note: The World Wide Web Consortium Recommendation states that UTF-8 should be used. Not doing so may introduce incompatibilities.

        Parameters:
        s - the AsciiString to decode
        enc - The name of a supported character encoding.
        Returns:
        the newly decoded CharSequence
        See Also:
        URLDecoder.decode(java.lang.String, java.lang.String)