Package org.apache.hc.core5.net
Enum URIBuilder.EncodingPolicy
- All Implemented Interfaces:
Serializable,Comparable<URIBuilder.EncodingPolicy>,java.lang.constant.Constable
- Enclosing class:
- URIBuilder
Defines the encoding policy for URI components in
URIBuilder.
This enum controls how characters are percent-encoded when constructing a URI,
allowing flexibility between strict encoding and RFC 3986-compliant behavior.- Since:
- 5.4
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionEncodes all reserved characters, allowing only unreserved characters (ALPHA, DIGIT, "-", ".", "_", "~") to remain unencoded.Follows RFC 3986 component-specific encoding rules. -
Method Summary
Modifier and TypeMethodDescriptionstatic URIBuilder.EncodingPolicyReturns the enum constant of this type with the specified name.static URIBuilder.EncodingPolicy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
ALL_RESERVED
Encodes all reserved characters, allowing only unreserved characters (ALPHA, DIGIT, "-", ".", "_", "~") to remain unencoded. This is a strict policy suitable for conservative URI production where maximum encoding is desired. -
RFC_3986
Follows RFC 3986 component-specific encoding rules. For example, query and fragment components allow unreserved characters, sub-delimiters ("!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "="), and additional characters (":", "@", "/", "?") to remain unencoded, as defined byPercentCodec.FRAGMENT. This policy ensures compliance with RFC 3986 while maintaining interoperability.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-