Package com.linkedin.alpini.netty4.misc
Enum AsciiStringURLCodec
- java.lang.Object
-
- java.lang.Enum<AsciiStringURLCodec>
-
- com.linkedin.alpini.netty4.misc.AsciiStringURLCodec
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<AsciiStringURLCodec>
public enum AsciiStringURLCodec extends java.lang.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.CharSequencedecode(io.netty.util.AsciiString s, java.nio.charset.Charset enc)Decodes aapplication/x-www-form-urlencodedstring using a specific encoding scheme.static io.netty.util.AsciiStringencode(java.lang.CharSequence s, java.nio.charset.Charset enc)Translates a string intoapplication/x-www-form-urlencodedformat using a specific encoding scheme.static AsciiStringURLCodecvalueOf(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.
-
-
-
Enum Constant Detail
-
SINGLETON
public static final AsciiStringURLCodec SINGLETON
-
-
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 namejava.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 intoapplication/x-www-form-urlencodedformat 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-CharSequenceto 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 aapplication/x-www-form-urlencodedstring 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- theAsciiStringto decodeenc- The name of a supported character encoding.- Returns:
- the newly decoded
CharSequence - See Also:
URLDecoder.decode(java.lang.String, java.lang.String)
-
-