Package io.muserver.rest
Enum CollectionParameterStrategy
- java.lang.Object
-
- java.lang.Enum<CollectionParameterStrategy>
-
- io.muserver.rest.CollectionParameterStrategy
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<CollectionParameterStrategy>
public enum CollectionParameterStrategy extends java.lang.Enum<CollectionParameterStrategy>
Specifies how to handle lists or sets in querystring parametersThis can be used to allow clients to send lists of values in comma-separated values to query string parameters in JAX-RS methods.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description NO_TRANSFORM
No transformation is applied, for examplea,b,c
would result in a single string with value "a,b,c"SPLIT_ON_COMMA
Splits parameter values on commas, for examplea,b,c
would result in a list of 3 strings.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CollectionParameterStrategy
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static CollectionParameterStrategy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SPLIT_ON_COMMA
public static final CollectionParameterStrategy SPLIT_ON_COMMA
Splits parameter values on commas, for examplea,b,c
would result in a list of 3 strings.With this option enabled, values are trimmed and empty values are removed, so
a,%20b,
would be a list with 2 values ("a" and "b").
-
NO_TRANSFORM
public static final CollectionParameterStrategy NO_TRANSFORM
No transformation is applied, for examplea,b,c
would result in a single string with value "a,b,c"This option follows the JAX-RS standard.
-
-
Method Detail
-
values
public static CollectionParameterStrategy[] 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 (CollectionParameterStrategy c : CollectionParameterStrategy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CollectionParameterStrategy 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
-
-