Class RequestPathParams
- All Implemented Interfaces:
- Serializable,- Cloneable,- Iterable<RequestPathParam>,- Collection<RequestPathParam>,- List<RequestPathParam>,- RandomAccess
   The RequestPathParams object is the API for accessing the matched variables
   and remainder on the URL path.
 
   
Example:
   
Some important methods on this class are:
- RequestPathParams- Methods for retrieving path parameters:
- Methods overridding path parameters:
- Other methods:
 
See Also:
- See Also:
- 
Field SummaryFields inherited from class java.util.AbstractListmodCount
- 
Constructor SummaryConstructorsConstructorDescriptionRequestPathParams(RestSession session, RestRequest req, boolean caseSensitive) Constructor.
- 
Method SummaryModifier and TypeMethodDescriptionAdds a parameter value.add(NameValuePair... parameters) Adds request parameter values.addDefault(String name, String value) Adds a default entry to the query parameters.addDefault(List<NameValuePair> pairs) Adds default entries to these parameters.addDefault(NameValuePair... pairs) Adds default entries to these parameters.caseSensitive(boolean value) Sets case sensitivity for names in this list.booleanReturnstrue if the parameters with the specified name is present.booleancontainsAny(String... names) Returnstrue if the parameter with any of the specified names are present.copy()Makes a copy of these parameters.<T> Optional<T>Returns the path parameter as the specified bean type.Returns the last parameter with the specified name.Returns all the parameters with the specified name.Returns the first parameter with the specified name.Returns the last parameter with the specified name.getNames()Returns all the unique header names in this list.Returns the decoded remainder of the URL following any path pattern matches.Same asgetRemainder()but doesn't decode characters.Returns all headers in sorted order.parser(HttpPartParserSession value) Sets the parser to use for part values.Remove parameters.Sets a parameter value.set(NameValuePair... parameters) Sets request header values.Returns all headers with the specified name.Returns a copy of this object but only with the specified param names copied.toString()Methods inherited from class java.util.ArrayListadd, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollectioncontainsAllMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.CollectionparallelStream, stream, toArrayMethods inherited from interface java.util.ListcontainsAll
- 
Constructor Details- 
RequestPathParamsConstructor.- Parameters:
- session- The current HTTP request session.
- req- The current HTTP request.
- caseSensitive- Whether case-sensitive name matching is enabled.
 
 
- 
- 
Method Details- 
parserSets the parser to use for part values.- Parameters:
- value- The new value for this setting.
- Returns:
- This object.
 
- 
caseSensitiveSets case sensitivity for names in this list.- Parameters:
- value- The new value for this setting.
- Returns:
- This object (for method chaining).
 
- 
addDefaultAdds default entries to these parameters.Similar to set(String, Object)but doesn't override existing values.- Parameters:
- pairs- The default entries.
 Can be- null .
- Returns:
- This object.
 
- 
addDefaultAdds default entries to these parameters.Similar to set(String, Object)but doesn't override existing values.- Parameters:
- pairs- The default entries.
 Can be- null .
- Returns:
- This object.
 
- 
addDefaultAdds a default entry to the query parameters.- Parameters:
- name- The name.
- value- The value.
- Returns:
- This object.
 
- 
addAdds a parameter value.Parameter is added to the end. 
 Existing parameter with the same name are not changed.- Parameters:
- name- The parameter name. Must not be- null .
- value- The parameter value.
- Returns:
- This object.
 
- 
addAdds request parameter values.Parameters are added to the end. 
 Existing parameters with the same name are not changed.- Parameters:
- parameters- The parameter objects. Must not be- null .
- Returns:
- This object.
 
- 
setSets a parameter value.Parameter is added to the end. 
 Any previous parameters with the same name are removed.- Parameters:
- name- The parameter name. Must not be- null .
- value- The parameter value.
 Converted to a string using- Object.toString().
 Can be- null .
- Returns:
- This object.
 
- 
setSets request header values.Parameters are added to the end of the headers. 
 Any previous parameters with the same name are removed.- Parameters:
- parameters- The parameters to set. Must not be- null or contain- null .
- Returns:
- This object.
 
- 
removeRemove parameters.- Parameters:
- name- The parameter name. Must not be- null .
- Returns:
- This object.
 
- 
subsetReturns a copy of this object but only with the specified param names copied.- Parameters:
- names- The list to include in the copy.
- Returns:
- A new list object.
 
- 
containsReturnstrue if the parameters with the specified name is present.- Parameters:
- name- The parameter name. Must not be- null .
- Returns:
- true if the parameters with the specified name is present.
 
- 
containsAnyReturnstrue if the parameter with any of the specified names are present.- Parameters:
- names- The parameter names. Must not be- null .
- Returns:
- true if the parameter with any of the specified names are present.
 
- 
getAllReturns all the parameters with the specified name.- Parameters:
- name- The parameter name.
- Returns:
- The list of all parameters with the specified name, or an empty list if none are found.
 
- 
streamReturns all headers with the specified name.- Parameters:
- name- The header name.
- Returns:
- The stream of all headers with matching names.  Never null .
 
- 
getSortedReturns all headers in sorted order.- Returns:
- The stream of all headers in sorted order.
 
- 
getNamesReturns all the unique header names in this list.- Returns:
- The list of all unique header names in this list.
 
- 
getFirstReturns the first parameter with the specified name.Note that this method never returns null and thatRequestHttpPart.isPresent()can be used to test for the existence of the parameter.- Parameters:
- name- The parameter name.
- Returns:
- The parameter.  Never null .
 
- 
getLastReturns the last parameter with the specified name.Note that this method never returns null and thatRequestHttpPart.isPresent()can be used to test for the existence of the parameter.- Parameters:
- name- The parameter name.
- Returns:
- The parameter.  Never null .
 
- 
getReturns the last parameter with the specified name.This is equivalent to getLast(String).- Parameters:
- name- The parameter name.
- Returns:
- The parameter value, or Optional.empty()if it doesn't exist.
 
- 
getReturns the path parameter as the specified bean type.Type must have a name specified via the Pathannotation and a public constructor that takes in eithervalue orname,value as strings.- Type Parameters:
- T- The bean type to create.
- Parameters:
- type- The bean type to create.
- Returns:
- The bean, never null .
 
- 
copyMakes a copy of these parameters.- Returns:
- A new parameters object.
 
- 
getRemainderReturns the decoded remainder of the URL following any path pattern matches.The behavior of path remainder is shown below given the path pattern "/foo/*": URL Path Remainder /foo null /foo/ "" /foo// "/" /foo/// "//" /foo/a/b "a/b" /foo//a/b/ "/a/b/" /foo/a%2Fb "a/b" Example:// REST method @RestGet ("/foo/{bar}/*" )public String doGetById(RequestPathParamspath ,int bar ) {return path .remainder().orElse(null ); }The remainder can also be retrieved by calling get(."/**" )- Returns:
- The path remainder string.
 
- 
getRemainderUndecodedSame asgetRemainder()but doesn't decode characters.The undecoded remainder can also be retrieved by calling get(."/*" )- Returns:
- The un-decoded path remainder.
 
- 
toString- Overrides:
- toStringin class- AbstractCollection<RequestPathParam>
 
 
-