Package ubic.gemma.rest.util.args
Class AbstractArrayArg<T>
- Type Parameters:
T- the type of elements the array contains
- Direct Known Subclasses:
AbstractEntityArrayArg,ExcludeArg,StringArrayArg
Represents a comma-delimited array API argument.
If you use this alongside a QueryParam, make sure that you include a Parameter
with the 'explode' attribute set to Explode.FALSE, otherwise the
serialization will not be correct.
- Author:
- tesarst
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class ubic.gemma.rest.util.args.AbstractArg
getValue, toString
-
Field Details
-
ARRAY_SCHEMA_DESCRIPTION_PREFIX
Prefix to use to describe the array schema in subclasses.- See Also:
-
ARRAY_SCHEMA_COMPRESSION_DESCRIPTION
A description of the base64-gzip encoding to use in array schema descriptions in subclasses.- See Also:
-
-
Constructor Details
-
AbstractArrayArg
-
-
Method Details
-
valueOf
protected static <T extends AbstractArrayArg<?>> T valueOf(String arg, String ofWhat, Function<List<String>, T> func, boolean decompressArg) throws MalformedArgExceptionEvaluate an input array argument.Split a string by the ',' comma character and trim the resulting pieces.
This is meant to be used for parsing query arguments that use a comma as a delimiter.
- Parameters:
arg- the string to processofWhat- a description of what is expectedfunc- a function to convert the resulting list of string to the specific array argumentdecompressArg- decompress the argument as perArgUtils.decodeCompressedArg(String)- Returns:
- trimmed strings exploded from the input.
- Throws:
MalformedArgException- wrapping any raisedIllegalArgumentExceptionwhich may be caused by an empty string, an invalid base64-gzip encoded input or such an exception raised by the passed function
-