Package org.apache.juneau.rest.client
Enum Class CollectionFormat
- All Implemented Interfaces:
Serializable,Comparable<CollectionFormat>,Constable
Specifies how collection-valued query/form parameters are serialized to a single string.
When a parameter value is an Iterable or array, the elements are joined using the delimiter
corresponding to the selected format. REPEATED instead emits one name=value pair per element.
- Since:
- 9.2.1
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionReturns the delimiter string, ornullforREPEATED.Serializes the given values to a single string using this format's delimiter.static CollectionFormatReturns the enum constant of this class with the specified name.static CollectionFormat[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
COMMA
Elements joined with,— e.g.colors=red,green,blue. -
PIPE
Elements joined with|— e.g.colors=red|green|blue. -
SPACE
Elements joined with a space — e.g.colors=red green blue. -
TAB
Elements joined with\t(tab) — e.g.colors=red\tgreen\tblue. -
REPEATED
One parameter per element — e.g.colors=red&colors=green&colors=blue. Handled specially by the request builder.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
getDelimiter
Returns the delimiter string, ornullforREPEATED.- Returns:
- The delimiter, possibly
null .
-
join
Serializes the given values to a single string using this format's delimiter.Only valid for non-
REPEATEDformats.- Parameters:
values- The values to join. Must not benull .- Returns:
- The joined string. Never
null . - Throws:
IllegalArgumentException- If called onREPEATED.
-