juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesbog...@apache.org
Subject [09/51] [partial] incubator-juneau-website git commit: Support for passing in more class types to REST methods.
Date Mon, 08 May 2017 15:32:39 GMT
http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/f1f17bc3/content/site/apidocs/src-html/org/apache/juneau/rest/RequestHeaders.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/src-html/org/apache/juneau/rest/RequestHeaders.html b/content/site/apidocs/src-html/org/apache/juneau/rest/RequestHeaders.html
new file mode 100644
index 0000000..4e18519
--- /dev/null
+++ b/content/site/apidocs/src-html/org/apache/juneau/rest/RequestHeaders.html
@@ -0,0 +1,747 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+<title>Source code</title>
+<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style">
+</head>
+<body>
+<div class="sourceContainer">
+<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a>
+<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *<a name="line.2"></a>
+<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *<a name="line.3"></a>
+<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *<a name="line.4"></a>
+<span class="sourceLineNo">005</span>// * with the License.  You may obtain a copy of the License at                                                              *<a name="line.5"></a>
+<span class="sourceLineNo">006</span>// *                                                                                                                         *<a name="line.6"></a>
+<span class="sourceLineNo">007</span>// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *<a name="line.7"></a>
+<span class="sourceLineNo">008</span>// *                                                                                                                         *<a name="line.8"></a>
+<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *<a name="line.9"></a>
+<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *<a name="line.10"></a>
+<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License.                                              *<a name="line.11"></a>
+<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a>
+<span class="sourceLineNo">013</span>package org.apache.juneau.rest;<a name="line.13"></a>
+<span class="sourceLineNo">014</span><a name="line.14"></a>
+<span class="sourceLineNo">015</span>import java.lang.reflect.*;<a name="line.15"></a>
+<span class="sourceLineNo">016</span>import java.util.*;<a name="line.16"></a>
+<span class="sourceLineNo">017</span><a name="line.17"></a>
+<span class="sourceLineNo">018</span>import org.apache.juneau.*;<a name="line.18"></a>
+<span class="sourceLineNo">019</span>import org.apache.juneau.http.*;<a name="line.19"></a>
+<span class="sourceLineNo">020</span>import org.apache.juneau.http.Date;<a name="line.20"></a>
+<span class="sourceLineNo">021</span>import org.apache.juneau.internal.*;<a name="line.21"></a>
+<span class="sourceLineNo">022</span>import org.apache.juneau.parser.*;<a name="line.22"></a>
+<span class="sourceLineNo">023</span>import org.apache.juneau.urlencoding.*;<a name="line.23"></a>
+<span class="sourceLineNo">024</span><a name="line.24"></a>
+<span class="sourceLineNo">025</span>/**<a name="line.25"></a>
+<span class="sourceLineNo">026</span> * Represents the headers in an HTTP request.<a name="line.26"></a>
+<span class="sourceLineNo">027</span> * &lt;p&gt;<a name="line.27"></a>
+<span class="sourceLineNo">028</span> * Entries are stored in a case-insensitive map.<a name="line.28"></a>
+<span class="sourceLineNo">029</span> */<a name="line.29"></a>
+<span class="sourceLineNo">030</span>public class RequestHeaders extends TreeMap&lt;String,String[]&gt; {<a name="line.30"></a>
+<span class="sourceLineNo">031</span>   private static final long serialVersionUID = 1L;<a name="line.31"></a>
+<span class="sourceLineNo">032</span><a name="line.32"></a>
+<span class="sourceLineNo">033</span>   private UrlEncodingParser parser;<a name="line.33"></a>
+<span class="sourceLineNo">034</span>   private BeanSession beanSession;<a name="line.34"></a>
+<span class="sourceLineNo">035</span>   private RequestQuery queryParams;<a name="line.35"></a>
+<span class="sourceLineNo">036</span><a name="line.36"></a>
+<span class="sourceLineNo">037</span>   RequestHeaders() {<a name="line.37"></a>
+<span class="sourceLineNo">038</span>      super(String.CASE_INSENSITIVE_ORDER);<a name="line.38"></a>
+<span class="sourceLineNo">039</span>   }<a name="line.39"></a>
+<span class="sourceLineNo">040</span><a name="line.40"></a>
+<span class="sourceLineNo">041</span>   RequestHeaders setParser(UrlEncodingParser parser) {<a name="line.41"></a>
+<span class="sourceLineNo">042</span>      this.parser = parser;<a name="line.42"></a>
+<span class="sourceLineNo">043</span>      return this;<a name="line.43"></a>
+<span class="sourceLineNo">044</span>   }<a name="line.44"></a>
+<span class="sourceLineNo">045</span><a name="line.45"></a>
+<span class="sourceLineNo">046</span>   RequestHeaders setBeanSession(BeanSession beanSession) {<a name="line.46"></a>
+<span class="sourceLineNo">047</span>      this.beanSession = beanSession;<a name="line.47"></a>
+<span class="sourceLineNo">048</span>      return this;<a name="line.48"></a>
+<span class="sourceLineNo">049</span>   }<a name="line.49"></a>
+<span class="sourceLineNo">050</span><a name="line.50"></a>
+<span class="sourceLineNo">051</span>   RequestHeaders setQueryParams(RequestQuery queryParams) {<a name="line.51"></a>
+<span class="sourceLineNo">052</span>      this.queryParams = queryParams;<a name="line.52"></a>
+<span class="sourceLineNo">053</span>      return this;<a name="line.53"></a>
+<span class="sourceLineNo">054</span>   }<a name="line.54"></a>
+<span class="sourceLineNo">055</span><a name="line.55"></a>
+<span class="sourceLineNo">056</span>   /**<a name="line.56"></a>
+<span class="sourceLineNo">057</span>    * Adds default entries to these headers.<a name="line.57"></a>
+<span class="sourceLineNo">058</span>    * &lt;p&gt;<a name="line.58"></a>
+<span class="sourceLineNo">059</span>    * This includes the default headers defined on the servlet and method levels.<a name="line.59"></a>
+<span class="sourceLineNo">060</span>    *<a name="line.60"></a>
+<span class="sourceLineNo">061</span>    * @param defaultEntries The default entries.  Can be &lt;jk&gt;null&lt;/jk&gt;.<a name="line.61"></a>
+<span class="sourceLineNo">062</span>    * @return This object (for method chaining).<a name="line.62"></a>
+<span class="sourceLineNo">063</span>    */<a name="line.63"></a>
+<span class="sourceLineNo">064</span>   public RequestHeaders addDefault(Map&lt;String,String&gt; defaultEntries) {<a name="line.64"></a>
+<span class="sourceLineNo">065</span>      if (defaultEntries != null) {<a name="line.65"></a>
+<span class="sourceLineNo">066</span>         for (Map.Entry&lt;String,String&gt; e : defaultEntries.entrySet()) {<a name="line.66"></a>
+<span class="sourceLineNo">067</span>            String key = e.getKey(), value = e.getValue();<a name="line.67"></a>
+<span class="sourceLineNo">068</span>            String[] v = get(key);<a name="line.68"></a>
+<span class="sourceLineNo">069</span>            if (v == null)<a name="line.69"></a>
+<span class="sourceLineNo">070</span>               put(key, new String[]{value});<a name="line.70"></a>
+<span class="sourceLineNo">071</span>         }<a name="line.71"></a>
+<span class="sourceLineNo">072</span>      }<a name="line.72"></a>
+<span class="sourceLineNo">073</span>      return this;<a name="line.73"></a>
+<span class="sourceLineNo">074</span>   }<a name="line.74"></a>
+<span class="sourceLineNo">075</span><a name="line.75"></a>
+<span class="sourceLineNo">076</span>   /**<a name="line.76"></a>
+<span class="sourceLineNo">077</span>    * Adds a set of header values to this object.<a name="line.77"></a>
+<span class="sourceLineNo">078</span>    *<a name="line.78"></a>
+<span class="sourceLineNo">079</span>    * @param name The header name.<a name="line.79"></a>
+<span class="sourceLineNo">080</span>    * @param values The header values.<a name="line.80"></a>
+<span class="sourceLineNo">081</span>    * @return This object (for method chaining).<a name="line.81"></a>
+<span class="sourceLineNo">082</span>    */<a name="line.82"></a>
+<span class="sourceLineNo">083</span>   public RequestHeaders put(String name, Enumeration&lt;String&gt; values) {<a name="line.83"></a>
+<span class="sourceLineNo">084</span>      // Optimized for enumerations of one entry, the most-common case.<a name="line.84"></a>
+<span class="sourceLineNo">085</span>      if (values.hasMoreElements()) {<a name="line.85"></a>
+<span class="sourceLineNo">086</span>         String v = values.nextElement();<a name="line.86"></a>
+<span class="sourceLineNo">087</span>         if (! v.isEmpty()) {<a name="line.87"></a>
+<span class="sourceLineNo">088</span>            String[] s = new String[]{v};<a name="line.88"></a>
+<span class="sourceLineNo">089</span>            while (values.hasMoreElements())<a name="line.89"></a>
+<span class="sourceLineNo">090</span>               s = ArrayUtils.append(s, values.nextElement());<a name="line.90"></a>
+<span class="sourceLineNo">091</span>            put(name, s);<a name="line.91"></a>
+<span class="sourceLineNo">092</span>         }<a name="line.92"></a>
+<span class="sourceLineNo">093</span>      }<a name="line.93"></a>
+<span class="sourceLineNo">094</span>      return this;<a name="line.94"></a>
+<span class="sourceLineNo">095</span>   }<a name="line.95"></a>
+<span class="sourceLineNo">096</span><a name="line.96"></a>
+<span class="sourceLineNo">097</span>   /**<a name="line.97"></a>
+<span class="sourceLineNo">098</span>    * Returns the specified header value, or &lt;jk&gt;null&lt;/jk&gt; if the header doesn't exist.<a name="line.98"></a>
+<span class="sourceLineNo">099</span>    * &lt;p&gt;<a name="line.99"></a>
+<span class="sourceLineNo">100</span>    * If {@code allowHeaderParams} init parameter is &lt;jk&gt;true&lt;/jk&gt;, then first looks for {@code &amp;HeaderName=x} in the URL query string.<a name="line.100"></a>
+<span class="sourceLineNo">101</span>    * &lt;p&gt;<a name="line.101"></a>
+<span class="sourceLineNo">102</span>    * @param name The header name.<a name="line.102"></a>
+<span class="sourceLineNo">103</span>    * @return The header value, or &lt;jk&gt;null&lt;/jk&gt; if it doesn't exist.<a name="line.103"></a>
+<span class="sourceLineNo">104</span>    */<a name="line.104"></a>
+<span class="sourceLineNo">105</span>   public String getFirst(String name) {<a name="line.105"></a>
+<span class="sourceLineNo">106</span>      return getFirst(name, null);<a name="line.106"></a>
+<span class="sourceLineNo">107</span>   }<a name="line.107"></a>
+<span class="sourceLineNo">108</span><a name="line.108"></a>
+<span class="sourceLineNo">109</span>   /**<a name="line.109"></a>
+<span class="sourceLineNo">110</span>    * Returns the specified header value, or a default value if the header doesn't exist.<a name="line.110"></a>
+<span class="sourceLineNo">111</span>    * &lt;p&gt;<a name="line.111"></a>
+<span class="sourceLineNo">112</span>    * If {@code allowHeaderParams} init parameter is &lt;jk&gt;true&lt;/jk&gt;, then first looks for {@code &amp;HeaderName=x} in the URL query string.<a name="line.112"></a>
+<span class="sourceLineNo">113</span>    *<a name="line.113"></a>
+<span class="sourceLineNo">114</span>    * @param name The HTTP header name.<a name="line.114"></a>
+<span class="sourceLineNo">115</span>    * @param def The default value to return if the header value isn't found.<a name="line.115"></a>
+<span class="sourceLineNo">116</span>    * @return The header value, or the default value if the header isn't present.<a name="line.116"></a>
+<span class="sourceLineNo">117</span>    */<a name="line.117"></a>
+<span class="sourceLineNo">118</span>   public String getFirst(String name, String def) {<a name="line.118"></a>
+<span class="sourceLineNo">119</span>      String[] v = null;<a name="line.119"></a>
+<span class="sourceLineNo">120</span>      if (queryParams != null)<a name="line.120"></a>
+<span class="sourceLineNo">121</span>         v = queryParams.get(name);<a name="line.121"></a>
+<span class="sourceLineNo">122</span>      if (v == null || v.length == 0)<a name="line.122"></a>
+<span class="sourceLineNo">123</span>         v = get(name);<a name="line.123"></a>
+<span class="sourceLineNo">124</span>      if (v == null || v.length == 0)<a name="line.124"></a>
+<span class="sourceLineNo">125</span>         return def;<a name="line.125"></a>
+<span class="sourceLineNo">126</span>      return v[0];<a name="line.126"></a>
+<span class="sourceLineNo">127</span>   }<a name="line.127"></a>
+<span class="sourceLineNo">128</span><a name="line.128"></a>
+<span class="sourceLineNo">129</span>   /**<a name="line.129"></a>
+<span class="sourceLineNo">130</span>    * Sets a request header value.<a name="line.130"></a>
+<span class="sourceLineNo">131</span>    *<a name="line.131"></a>
+<span class="sourceLineNo">132</span>    * @param name The header name.<a name="line.132"></a>
+<span class="sourceLineNo">133</span>    * @param value The header value.<a name="line.133"></a>
+<span class="sourceLineNo">134</span>    */<a name="line.134"></a>
+<span class="sourceLineNo">135</span>   public void put(String name, Object value) {<a name="line.135"></a>
+<span class="sourceLineNo">136</span>      super.put(name, new String[]{StringUtils.toString(value)});<a name="line.136"></a>
+<span class="sourceLineNo">137</span>   }<a name="line.137"></a>
+<span class="sourceLineNo">138</span><a name="line.138"></a>
+<span class="sourceLineNo">139</span>   /**<a name="line.139"></a>
+<span class="sourceLineNo">140</span>    * Returns the specified header value converted to a POJO.<a name="line.140"></a>
+<span class="sourceLineNo">141</span>    * &lt;p&gt;<a name="line.141"></a>
+<span class="sourceLineNo">142</span>    * The type can be any POJO type convertable from a &lt;code&gt;String&lt;/code&gt;<a name="line.142"></a>
+<span class="sourceLineNo">143</span>    * (See &lt;a class="doclink" href="package-summary.html#PojosConvertableFromString"&gt;POJOs Convertable From Strings&lt;/a&gt;).<a name="line.143"></a>
+<span class="sourceLineNo">144</span>    * &lt;p&gt;<a name="line.144"></a>
+<span class="sourceLineNo">145</span>    * &lt;h5 class='section'&gt;Examples:&lt;/h5&gt;<a name="line.145"></a>
+<span class="sourceLineNo">146</span>    * &lt;p class='bcode'&gt;<a name="line.146"></a>
+<span class="sourceLineNo">147</span>    *    &lt;jc&gt;// Parse into an integer.&lt;/jc&gt;<a name="line.147"></a>
+<span class="sourceLineNo">148</span>    *    &lt;jk&gt;int&lt;/jk&gt; myheader = req.getHeader(&lt;js&gt;"My-Header"&lt;/js&gt;, &lt;jk&gt;int&lt;/jk&gt;.&lt;jk&gt;class&lt;/jk&gt;);<a name="line.148"></a>
+<span class="sourceLineNo">149</span>    *<a name="line.149"></a>
+<span class="sourceLineNo">150</span>    *    &lt;jc&gt;// Parse a UUID.&lt;/jc&gt;<a name="line.150"></a>
+<span class="sourceLineNo">151</span>    *    UUID myheader = req.getHeader(&lt;js&gt;"My-Header"&lt;/js&gt;, UUID.&lt;jk&gt;class&lt;/jk&gt;);<a name="line.151"></a>
+<span class="sourceLineNo">152</span>    * &lt;/p&gt;<a name="line.152"></a>
+<span class="sourceLineNo">153</span>    *<a name="line.153"></a>
+<span class="sourceLineNo">154</span>    * @param name The HTTP header name.<a name="line.154"></a>
+<span class="sourceLineNo">155</span>    * @param type The class type to convert the header value to.<a name="line.155"></a>
+<span class="sourceLineNo">156</span>    * @param &lt;T&gt; The class type to convert the header value to.<a name="line.156"></a>
+<span class="sourceLineNo">157</span>    * @return The parameter value converted to the specified class type.<a name="line.157"></a>
+<span class="sourceLineNo">158</span>    */<a name="line.158"></a>
+<span class="sourceLineNo">159</span>   public &lt;T&gt; T get(String name, Class&lt;T&gt; type) {<a name="line.159"></a>
+<span class="sourceLineNo">160</span>      String h = getFirst(name);<a name="line.160"></a>
+<span class="sourceLineNo">161</span>      return beanSession.convertToType(h, type);<a name="line.161"></a>
+<span class="sourceLineNo">162</span>   }<a name="line.162"></a>
+<span class="sourceLineNo">163</span><a name="line.163"></a>
+<span class="sourceLineNo">164</span>   /**<a name="line.164"></a>
+<span class="sourceLineNo">165</span>    * Same as {@link #get(String, Class)} but returns a default value if not found.<a name="line.165"></a>
+<span class="sourceLineNo">166</span>    *<a name="line.166"></a>
+<span class="sourceLineNo">167</span>    * @param name The HTTP header name.<a name="line.167"></a>
+<span class="sourceLineNo">168</span>    * @param def The default value if the header was not specified or is &lt;jk&gt;null&lt;/jk&gt;.<a name="line.168"></a>
+<span class="sourceLineNo">169</span>    * @param type The class type to convert the header value to.<a name="line.169"></a>
+<span class="sourceLineNo">170</span>    * @param &lt;T&gt; The class type to convert the header value to.<a name="line.170"></a>
+<span class="sourceLineNo">171</span>    * @return The parameter value converted to the specified class type.<a name="line.171"></a>
+<span class="sourceLineNo">172</span>    */<a name="line.172"></a>
+<span class="sourceLineNo">173</span>   public &lt;T&gt; T get(String name, T def, Class&lt;T&gt; type) {<a name="line.173"></a>
+<span class="sourceLineNo">174</span>      String h = getFirst(name);<a name="line.174"></a>
+<span class="sourceLineNo">175</span>      if (h == null)<a name="line.175"></a>
+<span class="sourceLineNo">176</span>         return def;<a name="line.176"></a>
+<span class="sourceLineNo">177</span>      return beanSession.convertToType(h, type);<a name="line.177"></a>
+<span class="sourceLineNo">178</span>   }<a name="line.178"></a>
+<span class="sourceLineNo">179</span><a name="line.179"></a>
+<span class="sourceLineNo">180</span>   /**<a name="line.180"></a>
+<span class="sourceLineNo">181</span>    * Returns the specified header value converted to a POJO.<a name="line.181"></a>
+<span class="sourceLineNo">182</span>    * &lt;p&gt;<a name="line.182"></a>
+<span class="sourceLineNo">183</span>    * The type can be any POJO type convertable from a &lt;code&gt;String&lt;/code&gt;<a name="line.183"></a>
+<span class="sourceLineNo">184</span>    * (See &lt;a class="doclink" href="package-summary.html#PojosConvertableFromString"&gt;POJOs Convertable From Strings&lt;/a&gt;).<a name="line.184"></a>
+<span class="sourceLineNo">185</span>    * &lt;p&gt;<a name="line.185"></a>
+<span class="sourceLineNo">186</span>    * &lt;h5 class='section'&gt;Examples:&lt;/h5&gt;<a name="line.186"></a>
+<span class="sourceLineNo">187</span>    * &lt;p class='bcode'&gt;<a name="line.187"></a>
+<span class="sourceLineNo">188</span>    *    &lt;jc&gt;// Parse into a linked-list of strings.&lt;/jc&gt;<a name="line.188"></a>
+<span class="sourceLineNo">189</span>    *    List&amp;lt;String&amp;gt; myheader = req.getHeader(&lt;js&gt;"My-Header"&lt;/js&gt;, LinkedList.&lt;jk&gt;class&lt;/jk&gt;, String.&lt;jk&gt;class&lt;/jk&gt;);<a name="line.189"></a>
+<span class="sourceLineNo">190</span>    * &lt;/p&gt;<a name="line.190"></a>
+<span class="sourceLineNo">191</span>    *<a name="line.191"></a>
+<span class="sourceLineNo">192</span>    * @param name The HTTP header name.<a name="line.192"></a>
+<span class="sourceLineNo">193</span>    * @param type The type of object to create.<a name="line.193"></a>
+<span class="sourceLineNo">194</span>    *    &lt;br&gt;Can be any of the following: {@link ClassMeta}, {@link Class}, {@link ParameterizedType}, {@link GenericArrayType}<a name="line.194"></a>
+<span class="sourceLineNo">195</span>    * @param args The type arguments of the class if it's a collection or map.<a name="line.195"></a>
+<span class="sourceLineNo">196</span>    *    &lt;br&gt;Can be any of the following: {@link ClassMeta}, {@link Class}, {@link ParameterizedType}, {@link GenericArrayType}<a name="line.196"></a>
+<span class="sourceLineNo">197</span>    *    &lt;br&gt;Ignored if the main type is not a map or collection.<a name="line.197"></a>
+<span class="sourceLineNo">198</span>    * @param &lt;T&gt; The class type to convert the header value to.<a name="line.198"></a>
+<span class="sourceLineNo">199</span>    * @return The parameter value converted to the specified class type.<a name="line.199"></a>
+<span class="sourceLineNo">200</span>    * @throws ParseException If the header could not be converted to the specified type.<a name="line.200"></a>
+<span class="sourceLineNo">201</span>    */<a name="line.201"></a>
+<span class="sourceLineNo">202</span>   public &lt;T&gt; T get(String name, Type type, Type...args) throws ParseException {<a name="line.202"></a>
+<span class="sourceLineNo">203</span>      String h = getFirst(name);<a name="line.203"></a>
+<span class="sourceLineNo">204</span>      return parser.parsePart(h, type, args);<a name="line.204"></a>
+<span class="sourceLineNo">205</span>   }<a name="line.205"></a>
+<span class="sourceLineNo">206</span><a name="line.206"></a>
+<span class="sourceLineNo">207</span>   /**<a name="line.207"></a>
+<span class="sourceLineNo">208</span>    * Returns the &lt;code&gt;Accept&lt;/code&gt; header on the request.<a name="line.208"></a>
+<span class="sourceLineNo">209</span>    * &lt;p&gt;<a name="line.209"></a>
+<span class="sourceLineNo">210</span>    * Content-Types that are acceptable for the response.<a name="line.210"></a>
+<span class="sourceLineNo">211</span>    *<a name="line.211"></a>
+<span class="sourceLineNo">212</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.212"></a>
+<span class="sourceLineNo">213</span>    * &lt;p class='bcode'&gt;<a name="line.213"></a>
+<span class="sourceLineNo">214</span>    *    Accept: text/plain<a name="line.214"></a>
+<span class="sourceLineNo">215</span>    * &lt;/p&gt;<a name="line.215"></a>
+<span class="sourceLineNo">216</span>    *<a name="line.216"></a>
+<span class="sourceLineNo">217</span>    * @return The parsed &lt;code&gt;Accept&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.217"></a>
+<span class="sourceLineNo">218</span>    *<a name="line.218"></a>
+<span class="sourceLineNo">219</span>    */<a name="line.219"></a>
+<span class="sourceLineNo">220</span>   public Accept getAccept() {<a name="line.220"></a>
+<span class="sourceLineNo">221</span>      return Accept.forString(getFirst("Accept"));<a name="line.221"></a>
+<span class="sourceLineNo">222</span>   }<a name="line.222"></a>
+<span class="sourceLineNo">223</span><a name="line.223"></a>
+<span class="sourceLineNo">224</span>   /**<a name="line.224"></a>
+<span class="sourceLineNo">225</span>    * Returns the &lt;code&gt;Accept-Charset&lt;/code&gt; header on the request.<a name="line.225"></a>
+<span class="sourceLineNo">226</span>    * &lt;p&gt;<a name="line.226"></a>
+<span class="sourceLineNo">227</span>    * Character sets that are acceptable.<a name="line.227"></a>
+<span class="sourceLineNo">228</span>    *<a name="line.228"></a>
+<span class="sourceLineNo">229</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.229"></a>
+<span class="sourceLineNo">230</span>    * &lt;p class='bcode'&gt;<a name="line.230"></a>
+<span class="sourceLineNo">231</span>    *    Accept-Charset: utf-8<a name="line.231"></a>
+<span class="sourceLineNo">232</span>    * &lt;/p&gt;<a name="line.232"></a>
+<span class="sourceLineNo">233</span>    *<a name="line.233"></a>
+<span class="sourceLineNo">234</span>    * @return The parsed &lt;code&gt;Accept-Charset&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.234"></a>
+<span class="sourceLineNo">235</span>    */<a name="line.235"></a>
+<span class="sourceLineNo">236</span>   public AcceptCharset getAcceptCharset() {<a name="line.236"></a>
+<span class="sourceLineNo">237</span>      return AcceptCharset.forString(getFirst("Accept-Charset"));<a name="line.237"></a>
+<span class="sourceLineNo">238</span>   }<a name="line.238"></a>
+<span class="sourceLineNo">239</span><a name="line.239"></a>
+<span class="sourceLineNo">240</span>   /**<a name="line.240"></a>
+<span class="sourceLineNo">241</span>    * Returns the &lt;code&gt;Accept-Encoding&lt;/code&gt; header on the request.<a name="line.241"></a>
+<span class="sourceLineNo">242</span>    * &lt;p&gt;<a name="line.242"></a>
+<span class="sourceLineNo">243</span>    * List of acceptable encodings.<a name="line.243"></a>
+<span class="sourceLineNo">244</span>    *<a name="line.244"></a>
+<span class="sourceLineNo">245</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.245"></a>
+<span class="sourceLineNo">246</span>    * &lt;p class='bcode'&gt;<a name="line.246"></a>
+<span class="sourceLineNo">247</span>    *    Accept-Encoding: gzip, deflate<a name="line.247"></a>
+<span class="sourceLineNo">248</span>    * &lt;/p&gt;<a name="line.248"></a>
+<span class="sourceLineNo">249</span>    *<a name="line.249"></a>
+<span class="sourceLineNo">250</span>    * @return The parsed &lt;code&gt;Accept-Encoding&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.250"></a>
+<span class="sourceLineNo">251</span>    */<a name="line.251"></a>
+<span class="sourceLineNo">252</span>   public AcceptEncoding getAcceptEncoding() {<a name="line.252"></a>
+<span class="sourceLineNo">253</span>      return AcceptEncoding.forString(getFirst("Accept-Encoding"));<a name="line.253"></a>
+<span class="sourceLineNo">254</span>   }<a name="line.254"></a>
+<span class="sourceLineNo">255</span><a name="line.255"></a>
+<span class="sourceLineNo">256</span>   /**<a name="line.256"></a>
+<span class="sourceLineNo">257</span>    * Returns the &lt;code&gt;Accept-Language&lt;/code&gt; header on the request.<a name="line.257"></a>
+<span class="sourceLineNo">258</span>    * &lt;p&gt;<a name="line.258"></a>
+<span class="sourceLineNo">259</span>    * List of acceptable human languages for response.<a name="line.259"></a>
+<span class="sourceLineNo">260</span>    *<a name="line.260"></a>
+<span class="sourceLineNo">261</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.261"></a>
+<span class="sourceLineNo">262</span>    * &lt;p class='bcode'&gt;<a name="line.262"></a>
+<span class="sourceLineNo">263</span>    *    Accept-Language: en-US<a name="line.263"></a>
+<span class="sourceLineNo">264</span>    * &lt;/p&gt;<a name="line.264"></a>
+<span class="sourceLineNo">265</span>    *<a name="line.265"></a>
+<span class="sourceLineNo">266</span>    * @return The parsed &lt;code&gt;Accept-Language&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.266"></a>
+<span class="sourceLineNo">267</span>    */<a name="line.267"></a>
+<span class="sourceLineNo">268</span>   public AcceptLanguage getAcceptLanguage() {<a name="line.268"></a>
+<span class="sourceLineNo">269</span>      return AcceptLanguage.forString(getFirst("Accept-Language"));<a name="line.269"></a>
+<span class="sourceLineNo">270</span>   }<a name="line.270"></a>
+<span class="sourceLineNo">271</span><a name="line.271"></a>
+<span class="sourceLineNo">272</span>   /**<a name="line.272"></a>
+<span class="sourceLineNo">273</span>    * Returns the &lt;code&gt;Authorization&lt;/code&gt; header on the request.<a name="line.273"></a>
+<span class="sourceLineNo">274</span>    * &lt;p&gt;<a name="line.274"></a>
+<span class="sourceLineNo">275</span>    * Authentication credentials for HTTP authentication.<a name="line.275"></a>
+<span class="sourceLineNo">276</span>    *<a name="line.276"></a>
+<span class="sourceLineNo">277</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.277"></a>
+<span class="sourceLineNo">278</span>    * &lt;p class='bcode'&gt;<a name="line.278"></a>
+<span class="sourceLineNo">279</span>    *    Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==<a name="line.279"></a>
+<span class="sourceLineNo">280</span>    * &lt;/p&gt;<a name="line.280"></a>
+<span class="sourceLineNo">281</span>    *<a name="line.281"></a>
+<span class="sourceLineNo">282</span>    * @return The parsed &lt;code&gt;Authorization&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.282"></a>
+<span class="sourceLineNo">283</span>    */<a name="line.283"></a>
+<span class="sourceLineNo">284</span>   public Authorization getAuthorization() {<a name="line.284"></a>
+<span class="sourceLineNo">285</span>      return Authorization.forString(getFirst("Authorization"));<a name="line.285"></a>
+<span class="sourceLineNo">286</span>   }<a name="line.286"></a>
+<span class="sourceLineNo">287</span><a name="line.287"></a>
+<span class="sourceLineNo">288</span>   /**<a name="line.288"></a>
+<span class="sourceLineNo">289</span>    * Returns the &lt;code&gt;Cache-Control&lt;/code&gt; header on the request.<a name="line.289"></a>
+<span class="sourceLineNo">290</span>    * &lt;p&gt;<a name="line.290"></a>
+<span class="sourceLineNo">291</span>    * Used to specify directives that must be obeyed by all caching mechanisms along the request-response chain.<a name="line.291"></a>
+<span class="sourceLineNo">292</span>    *<a name="line.292"></a>
+<span class="sourceLineNo">293</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.293"></a>
+<span class="sourceLineNo">294</span>    * &lt;p class='bcode'&gt;<a name="line.294"></a>
+<span class="sourceLineNo">295</span>    *    Cache-Control: no-cache<a name="line.295"></a>
+<span class="sourceLineNo">296</span>    * &lt;/p&gt;<a name="line.296"></a>
+<span class="sourceLineNo">297</span>    *<a name="line.297"></a>
+<span class="sourceLineNo">298</span>    * @return The parsed &lt;code&gt;Cache-Control&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.298"></a>
+<span class="sourceLineNo">299</span>    */<a name="line.299"></a>
+<span class="sourceLineNo">300</span>   public CacheControl getCacheControl() {<a name="line.300"></a>
+<span class="sourceLineNo">301</span>      return CacheControl.forString(getFirst("Cache-Control"));<a name="line.301"></a>
+<span class="sourceLineNo">302</span>   }<a name="line.302"></a>
+<span class="sourceLineNo">303</span><a name="line.303"></a>
+<span class="sourceLineNo">304</span>   /**<a name="line.304"></a>
+<span class="sourceLineNo">305</span>    * Returns the &lt;code&gt;Connection&lt;/code&gt; header on the request.<a name="line.305"></a>
+<span class="sourceLineNo">306</span>    * &lt;p&gt;<a name="line.306"></a>
+<span class="sourceLineNo">307</span>    * Control options for the current connection and list of hop-by-hop request fields.<a name="line.307"></a>
+<span class="sourceLineNo">308</span>    *<a name="line.308"></a>
+<span class="sourceLineNo">309</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.309"></a>
+<span class="sourceLineNo">310</span>    * &lt;p class='bcode'&gt;<a name="line.310"></a>
+<span class="sourceLineNo">311</span>    *    Connection: keep-alive<a name="line.311"></a>
+<span class="sourceLineNo">312</span>    *    Connection: Upgrade<a name="line.312"></a>
+<span class="sourceLineNo">313</span>    * &lt;/p&gt;<a name="line.313"></a>
+<span class="sourceLineNo">314</span>    *<a name="line.314"></a>
+<span class="sourceLineNo">315</span>    * @return The parsed &lt;code&gt;&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.315"></a>
+<span class="sourceLineNo">316</span>    */<a name="line.316"></a>
+<span class="sourceLineNo">317</span>   public Connection getConnection() {<a name="line.317"></a>
+<span class="sourceLineNo">318</span>      return Connection.forString(getFirst("Connection"));<a name="line.318"></a>
+<span class="sourceLineNo">319</span>   }<a name="line.319"></a>
+<span class="sourceLineNo">320</span><a name="line.320"></a>
+<span class="sourceLineNo">321</span>   /**<a name="line.321"></a>
+<span class="sourceLineNo">322</span>    * Returns the &lt;code&gt;Content-Length&lt;/code&gt; header on the request.<a name="line.322"></a>
+<span class="sourceLineNo">323</span>    * &lt;p&gt;<a name="line.323"></a>
+<span class="sourceLineNo">324</span>    * The length of the request body in octets (8-bit bytes).<a name="line.324"></a>
+<span class="sourceLineNo">325</span>    *<a name="line.325"></a>
+<span class="sourceLineNo">326</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.326"></a>
+<span class="sourceLineNo">327</span>    * &lt;p class='bcode'&gt;<a name="line.327"></a>
+<span class="sourceLineNo">328</span>    *    Content-Length: 348<a name="line.328"></a>
+<span class="sourceLineNo">329</span>    * &lt;/p&gt;<a name="line.329"></a>
+<span class="sourceLineNo">330</span>    *<a name="line.330"></a>
+<span class="sourceLineNo">331</span>    * @return The parsed &lt;code&gt;Content-Length&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.331"></a>
+<span class="sourceLineNo">332</span>    */<a name="line.332"></a>
+<span class="sourceLineNo">333</span>   public ContentLength getContentLength() {<a name="line.333"></a>
+<span class="sourceLineNo">334</span>      return ContentLength.forString(getFirst("Content-Length"));<a name="line.334"></a>
+<span class="sourceLineNo">335</span>   }<a name="line.335"></a>
+<span class="sourceLineNo">336</span><a name="line.336"></a>
+<span class="sourceLineNo">337</span>   /**<a name="line.337"></a>
+<span class="sourceLineNo">338</span>    * Returns the &lt;code&gt;Content-Type&lt;/code&gt; header on the request.<a name="line.338"></a>
+<span class="sourceLineNo">339</span>    * &lt;p&gt;<a name="line.339"></a>
+<span class="sourceLineNo">340</span>    * The MIME type of the body of the request (used with POST and PUT requests).<a name="line.340"></a>
+<span class="sourceLineNo">341</span>    *<a name="line.341"></a>
+<span class="sourceLineNo">342</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.342"></a>
+<span class="sourceLineNo">343</span>    * &lt;p class='bcode'&gt;<a name="line.343"></a>
+<span class="sourceLineNo">344</span>    *    Content-Type: application/x-www-form-urlencoded<a name="line.344"></a>
+<span class="sourceLineNo">345</span>    * &lt;/p&gt;<a name="line.345"></a>
+<span class="sourceLineNo">346</span>    *<a name="line.346"></a>
+<span class="sourceLineNo">347</span>    * @return The parsed &lt;code&gt;Content-Type&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.347"></a>
+<span class="sourceLineNo">348</span>    */<a name="line.348"></a>
+<span class="sourceLineNo">349</span>   public ContentType getContentType() {<a name="line.349"></a>
+<span class="sourceLineNo">350</span>      return ContentType.forString(getFirst("Content-Type"));<a name="line.350"></a>
+<span class="sourceLineNo">351</span>   }<a name="line.351"></a>
+<span class="sourceLineNo">352</span><a name="line.352"></a>
+<span class="sourceLineNo">353</span>   /**<a name="line.353"></a>
+<span class="sourceLineNo">354</span>    * Returns the &lt;code&gt;Date&lt;/code&gt; header on the request.<a name="line.354"></a>
+<span class="sourceLineNo">355</span>    * &lt;p&gt;<a name="line.355"></a>
+<span class="sourceLineNo">356</span>    * The date and time that the message was originated (in "HTTP-date" format as defined by RFC 7231 Date/Time Formats).<a name="line.356"></a>
+<span class="sourceLineNo">357</span>    *<a name="line.357"></a>
+<span class="sourceLineNo">358</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.358"></a>
+<span class="sourceLineNo">359</span>    * &lt;p class='bcode'&gt;<a name="line.359"></a>
+<span class="sourceLineNo">360</span>    *    Date: Tue, 15 Nov 1994 08:12:31 GMT<a name="line.360"></a>
+<span class="sourceLineNo">361</span>    * &lt;/p&gt;<a name="line.361"></a>
+<span class="sourceLineNo">362</span>    *<a name="line.362"></a>
+<span class="sourceLineNo">363</span>    * @return The parsed &lt;code&gt;Date&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.363"></a>
+<span class="sourceLineNo">364</span>    */<a name="line.364"></a>
+<span class="sourceLineNo">365</span>   public Date getDate() {<a name="line.365"></a>
+<span class="sourceLineNo">366</span>      return Date.forString(getFirst("Date"));<a name="line.366"></a>
+<span class="sourceLineNo">367</span>   }<a name="line.367"></a>
+<span class="sourceLineNo">368</span><a name="line.368"></a>
+<span class="sourceLineNo">369</span>   /**<a name="line.369"></a>
+<span class="sourceLineNo">370</span>    * Returns the &lt;code&gt;Expect&lt;/code&gt; header on the request.<a name="line.370"></a>
+<span class="sourceLineNo">371</span>    * &lt;p&gt;<a name="line.371"></a>
+<span class="sourceLineNo">372</span>    * Indicates that particular server behaviors are required by the client.<a name="line.372"></a>
+<span class="sourceLineNo">373</span>    *<a name="line.373"></a>
+<span class="sourceLineNo">374</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.374"></a>
+<span class="sourceLineNo">375</span>    * &lt;p class='bcode'&gt;<a name="line.375"></a>
+<span class="sourceLineNo">376</span>    *    Expect: 100-continue<a name="line.376"></a>
+<span class="sourceLineNo">377</span>    * &lt;/p&gt;<a name="line.377"></a>
+<span class="sourceLineNo">378</span>    *<a name="line.378"></a>
+<span class="sourceLineNo">379</span>    * @return The parsed &lt;code&gt;Expect&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.379"></a>
+<span class="sourceLineNo">380</span>    */<a name="line.380"></a>
+<span class="sourceLineNo">381</span>   public Expect getExpect() {<a name="line.381"></a>
+<span class="sourceLineNo">382</span>      return Expect.forString(getFirst("Expect"));<a name="line.382"></a>
+<span class="sourceLineNo">383</span>   }<a name="line.383"></a>
+<span class="sourceLineNo">384</span><a name="line.384"></a>
+<span class="sourceLineNo">385</span>   /**<a name="line.385"></a>
+<span class="sourceLineNo">386</span>    * Returns the &lt;code&gt;From&lt;/code&gt; header on the request.<a name="line.386"></a>
+<span class="sourceLineNo">387</span>    * &lt;p&gt;<a name="line.387"></a>
+<span class="sourceLineNo">388</span>    * The email address of the user making the request.<a name="line.388"></a>
+<span class="sourceLineNo">389</span>    *<a name="line.389"></a>
+<span class="sourceLineNo">390</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.390"></a>
+<span class="sourceLineNo">391</span>    * &lt;p class='bcode'&gt;<a name="line.391"></a>
+<span class="sourceLineNo">392</span>    *    From: user@example.com<a name="line.392"></a>
+<span class="sourceLineNo">393</span>    * &lt;/p&gt;<a name="line.393"></a>
+<span class="sourceLineNo">394</span>    *<a name="line.394"></a>
+<span class="sourceLineNo">395</span>    * @return The parsed &lt;code&gt;From&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.395"></a>
+<span class="sourceLineNo">396</span>    */<a name="line.396"></a>
+<span class="sourceLineNo">397</span>   public From getFrom() {<a name="line.397"></a>
+<span class="sourceLineNo">398</span>      return From.forString(getFirst("From"));<a name="line.398"></a>
+<span class="sourceLineNo">399</span>   }<a name="line.399"></a>
+<span class="sourceLineNo">400</span><a name="line.400"></a>
+<span class="sourceLineNo">401</span>   /**<a name="line.401"></a>
+<span class="sourceLineNo">402</span>    * Returns the &lt;code&gt;Host&lt;/code&gt; header on the request.<a name="line.402"></a>
+<span class="sourceLineNo">403</span>    * &lt;p&gt;<a name="line.403"></a>
+<span class="sourceLineNo">404</span>    * The domain name of the server (for virtual hosting), and the TCP port number on which the server is listening.<a name="line.404"></a>
+<span class="sourceLineNo">405</span>    * The port number may be omitted if the port is the standard port for the service requested.<a name="line.405"></a>
+<span class="sourceLineNo">406</span>    *<a name="line.406"></a>
+<span class="sourceLineNo">407</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.407"></a>
+<span class="sourceLineNo">408</span>    * &lt;p class='bcode'&gt;<a name="line.408"></a>
+<span class="sourceLineNo">409</span>    *    Host: en.wikipedia.org:8080<a name="line.409"></a>
+<span class="sourceLineNo">410</span>    *    Host: en.wikipedia.org<a name="line.410"></a>
+<span class="sourceLineNo">411</span>    * &lt;/p&gt;<a name="line.411"></a>
+<span class="sourceLineNo">412</span>    *<a name="line.412"></a>
+<span class="sourceLineNo">413</span>    * @return The parsed &lt;code&gt;Host&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.413"></a>
+<span class="sourceLineNo">414</span>    */<a name="line.414"></a>
+<span class="sourceLineNo">415</span>   public Host getHost() {<a name="line.415"></a>
+<span class="sourceLineNo">416</span>      return Host.forString(getFirst("Host"));<a name="line.416"></a>
+<span class="sourceLineNo">417</span>   }<a name="line.417"></a>
+<span class="sourceLineNo">418</span><a name="line.418"></a>
+<span class="sourceLineNo">419</span>   /**<a name="line.419"></a>
+<span class="sourceLineNo">420</span>    * Returns the &lt;code&gt;If-Match&lt;/code&gt; header on the request.<a name="line.420"></a>
+<span class="sourceLineNo">421</span>    * &lt;p&gt;<a name="line.421"></a>
+<span class="sourceLineNo">422</span>    * Only perform the action if the client supplied entity matches the same entity on the server.<a name="line.422"></a>
+<span class="sourceLineNo">423</span>    * This is mainly for methods like PUT to only update a resource if it has not been modified since the user last updated it.<a name="line.423"></a>
+<span class="sourceLineNo">424</span>    *<a name="line.424"></a>
+<span class="sourceLineNo">425</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.425"></a>
+<span class="sourceLineNo">426</span>    * &lt;p class='bcode'&gt;<a name="line.426"></a>
+<span class="sourceLineNo">427</span>    *    If-Match: "737060cd8c284d8af7ad3082f209582d"<a name="line.427"></a>
+<span class="sourceLineNo">428</span>    * &lt;/p&gt;<a name="line.428"></a>
+<span class="sourceLineNo">429</span>    *<a name="line.429"></a>
+<span class="sourceLineNo">430</span>    * @return The parsed &lt;code&gt;If-Match&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.430"></a>
+<span class="sourceLineNo">431</span>    */<a name="line.431"></a>
+<span class="sourceLineNo">432</span>   public IfMatch getIfMatch() {<a name="line.432"></a>
+<span class="sourceLineNo">433</span>      return IfMatch.forString(getFirst("If-Match"));<a name="line.433"></a>
+<span class="sourceLineNo">434</span>   }<a name="line.434"></a>
+<span class="sourceLineNo">435</span><a name="line.435"></a>
+<span class="sourceLineNo">436</span>   /**<a name="line.436"></a>
+<span class="sourceLineNo">437</span>    * Returns the &lt;code&gt;If-Modified-Since&lt;/code&gt; header on the request.<a name="line.437"></a>
+<span class="sourceLineNo">438</span>    * &lt;p&gt;<a name="line.438"></a>
+<span class="sourceLineNo">439</span>    * Allows a 304 Not Modified to be returned if content is unchanged.<a name="line.439"></a>
+<span class="sourceLineNo">440</span>    *<a name="line.440"></a>
+<span class="sourceLineNo">441</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.441"></a>
+<span class="sourceLineNo">442</span>    * &lt;p class='bcode'&gt;<a name="line.442"></a>
+<span class="sourceLineNo">443</span>    *    If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT<a name="line.443"></a>
+<span class="sourceLineNo">444</span>    * &lt;/p&gt;<a name="line.444"></a>
+<span class="sourceLineNo">445</span>    *<a name="line.445"></a>
+<span class="sourceLineNo">446</span>    * @return The parsed &lt;code&gt;If-Modified-Since&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.446"></a>
+<span class="sourceLineNo">447</span>    */<a name="line.447"></a>
+<span class="sourceLineNo">448</span>   public IfModifiedSince getIfModifiedSince() {<a name="line.448"></a>
+<span class="sourceLineNo">449</span>      return IfModifiedSince.forString(getFirst("If-Modified-Since"));<a name="line.449"></a>
+<span class="sourceLineNo">450</span>   }<a name="line.450"></a>
+<span class="sourceLineNo">451</span><a name="line.451"></a>
+<span class="sourceLineNo">452</span>   /**<a name="line.452"></a>
+<span class="sourceLineNo">453</span>    * Returns the &lt;code&gt;If-None-Match&lt;/code&gt; header on the request.<a name="line.453"></a>
+<span class="sourceLineNo">454</span>    * &lt;p&gt;<a name="line.454"></a>
+<span class="sourceLineNo">455</span>    * Allows a 304 Not Modified to be returned if content is unchanged, see HTTP ETag.<a name="line.455"></a>
+<span class="sourceLineNo">456</span>    *<a name="line.456"></a>
+<span class="sourceLineNo">457</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.457"></a>
+<span class="sourceLineNo">458</span>    * &lt;p class='bcode'&gt;<a name="line.458"></a>
+<span class="sourceLineNo">459</span>    *    If-None-Match: "737060cd8c284d8af7ad3082f209582d"<a name="line.459"></a>
+<span class="sourceLineNo">460</span>    * &lt;/p&gt;<a name="line.460"></a>
+<span class="sourceLineNo">461</span>    *<a name="line.461"></a>
+<span class="sourceLineNo">462</span>    * @return The parsed &lt;code&gt;If-None-Match&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.462"></a>
+<span class="sourceLineNo">463</span>    */<a name="line.463"></a>
+<span class="sourceLineNo">464</span>   public IfNoneMatch getIfNoneMatch() {<a name="line.464"></a>
+<span class="sourceLineNo">465</span>      return IfNoneMatch.forString(getFirst("If-None-Match"));<a name="line.465"></a>
+<span class="sourceLineNo">466</span>   }<a name="line.466"></a>
+<span class="sourceLineNo">467</span><a name="line.467"></a>
+<span class="sourceLineNo">468</span>   /**<a name="line.468"></a>
+<span class="sourceLineNo">469</span>    * Returns the &lt;code&gt;If-Range&lt;/code&gt; header on the request.<a name="line.469"></a>
+<span class="sourceLineNo">470</span>    * &lt;p&gt;<a name="line.470"></a>
+<span class="sourceLineNo">471</span>    * If the entity is unchanged, send me the part(s) that I am missing; otherwise, send me the entire new entity.<a name="line.471"></a>
+<span class="sourceLineNo">472</span>    *<a name="line.472"></a>
+<span class="sourceLineNo">473</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.473"></a>
+<span class="sourceLineNo">474</span>    * &lt;p class='bcode'&gt;<a name="line.474"></a>
+<span class="sourceLineNo">475</span>    *    If-Range: "737060cd8c284d8af7ad3082f209582d"<a name="line.475"></a>
+<span class="sourceLineNo">476</span>    * &lt;/p&gt;<a name="line.476"></a>
+<span class="sourceLineNo">477</span>    *<a name="line.477"></a>
+<span class="sourceLineNo">478</span>    * @return The parsed &lt;code&gt;If-Range&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.478"></a>
+<span class="sourceLineNo">479</span>    */<a name="line.479"></a>
+<span class="sourceLineNo">480</span>   public IfRange getIfRange() {<a name="line.480"></a>
+<span class="sourceLineNo">481</span>      return IfRange.forString(getFirst("If-Range"));<a name="line.481"></a>
+<span class="sourceLineNo">482</span>   }<a name="line.482"></a>
+<span class="sourceLineNo">483</span><a name="line.483"></a>
+<span class="sourceLineNo">484</span>   /**<a name="line.484"></a>
+<span class="sourceLineNo">485</span>    * Returns the &lt;code&gt;If-Unmodified-Since&lt;/code&gt; header on the request.<a name="line.485"></a>
+<span class="sourceLineNo">486</span>    * &lt;p&gt;<a name="line.486"></a>
+<span class="sourceLineNo">487</span>    * Only send the response if the entity has not been modified since a specific time.<a name="line.487"></a>
+<span class="sourceLineNo">488</span>    *<a name="line.488"></a>
+<span class="sourceLineNo">489</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.489"></a>
+<span class="sourceLineNo">490</span>    * &lt;p class='bcode'&gt;<a name="line.490"></a>
+<span class="sourceLineNo">491</span>    *    If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT<a name="line.491"></a>
+<span class="sourceLineNo">492</span>    * &lt;/p&gt;<a name="line.492"></a>
+<span class="sourceLineNo">493</span>    *<a name="line.493"></a>
+<span class="sourceLineNo">494</span>    * @return The parsed &lt;code&gt;If-Unmodified-Since&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.494"></a>
+<span class="sourceLineNo">495</span>    */<a name="line.495"></a>
+<span class="sourceLineNo">496</span>   public IfUnmodifiedSince getIfUnmodifiedSince() {<a name="line.496"></a>
+<span class="sourceLineNo">497</span>      return IfUnmodifiedSince.forString(getFirst("If-Unmodified-Since"));<a name="line.497"></a>
+<span class="sourceLineNo">498</span>   }<a name="line.498"></a>
+<span class="sourceLineNo">499</span><a name="line.499"></a>
+<span class="sourceLineNo">500</span>   /**<a name="line.500"></a>
+<span class="sourceLineNo">501</span>    * Returns the &lt;code&gt;Max-Forwards&lt;/code&gt; header on the request.<a name="line.501"></a>
+<span class="sourceLineNo">502</span>    * &lt;p&gt;<a name="line.502"></a>
+<span class="sourceLineNo">503</span>    * Limit the number of times the message can be forwarded through proxies or gateways.<a name="line.503"></a>
+<span class="sourceLineNo">504</span>    *<a name="line.504"></a>
+<span class="sourceLineNo">505</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.505"></a>
+<span class="sourceLineNo">506</span>    * &lt;p class='bcode'&gt;<a name="line.506"></a>
+<span class="sourceLineNo">507</span>    *    Max-Forwards: 10<a name="line.507"></a>
+<span class="sourceLineNo">508</span>    * &lt;/p&gt;<a name="line.508"></a>
+<span class="sourceLineNo">509</span>    *<a name="line.509"></a>
+<span class="sourceLineNo">510</span>    * @return The parsed &lt;code&gt;Max-Forwards&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.510"></a>
+<span class="sourceLineNo">511</span>    */<a name="line.511"></a>
+<span class="sourceLineNo">512</span>   public MaxForwards getMaxForwards() {<a name="line.512"></a>
+<span class="sourceLineNo">513</span>      return MaxForwards.forString(getFirst("Max-Forwards"));<a name="line.513"></a>
+<span class="sourceLineNo">514</span>   }<a name="line.514"></a>
+<span class="sourceLineNo">515</span><a name="line.515"></a>
+<span class="sourceLineNo">516</span>   /**<a name="line.516"></a>
+<span class="sourceLineNo">517</span>    * Returns the &lt;code&gt;Pragma&lt;/code&gt; header on the request.<a name="line.517"></a>
+<span class="sourceLineNo">518</span>    * &lt;p&gt;<a name="line.518"></a>
+<span class="sourceLineNo">519</span>    * Implementation-specific fields that may have various effects anywhere along the request-response chain.<a name="line.519"></a>
+<span class="sourceLineNo">520</span>    *<a name="line.520"></a>
+<span class="sourceLineNo">521</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.521"></a>
+<span class="sourceLineNo">522</span>    * &lt;p class='bcode'&gt;<a name="line.522"></a>
+<span class="sourceLineNo">523</span>    *    Pragma: no-cache<a name="line.523"></a>
+<span class="sourceLineNo">524</span>    * &lt;/p&gt;<a name="line.524"></a>
+<span class="sourceLineNo">525</span>    *<a name="line.525"></a>
+<span class="sourceLineNo">526</span>    * @return The parsed &lt;code&gt;Pragma&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.526"></a>
+<span class="sourceLineNo">527</span>    */<a name="line.527"></a>
+<span class="sourceLineNo">528</span>   public Pragma getPragma() {<a name="line.528"></a>
+<span class="sourceLineNo">529</span>      return Pragma.forString(getFirst("Pragma"));<a name="line.529"></a>
+<span class="sourceLineNo">530</span>   }<a name="line.530"></a>
+<span class="sourceLineNo">531</span><a name="line.531"></a>
+<span class="sourceLineNo">532</span>   /**<a name="line.532"></a>
+<span class="sourceLineNo">533</span>    * Returns the &lt;code&gt;Proxy-Authorization&lt;/code&gt; header on the request.<a name="line.533"></a>
+<span class="sourceLineNo">534</span>    * &lt;p&gt;<a name="line.534"></a>
+<span class="sourceLineNo">535</span>    * Authorization credentials for connecting to a proxy.<a name="line.535"></a>
+<span class="sourceLineNo">536</span>    *<a name="line.536"></a>
+<span class="sourceLineNo">537</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.537"></a>
+<span class="sourceLineNo">538</span>    * &lt;p class='bcode'&gt;<a name="line.538"></a>
+<span class="sourceLineNo">539</span>    *    Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==<a name="line.539"></a>
+<span class="sourceLineNo">540</span>    * &lt;/p&gt;<a name="line.540"></a>
+<span class="sourceLineNo">541</span>    *<a name="line.541"></a>
+<span class="sourceLineNo">542</span>    * @return The parsed &lt;code&gt;Proxy-Authorization&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.542"></a>
+<span class="sourceLineNo">543</span>    */<a name="line.543"></a>
+<span class="sourceLineNo">544</span>   public ProxyAuthorization getProxyAuthorization() {<a name="line.544"></a>
+<span class="sourceLineNo">545</span>      return ProxyAuthorization.forString(getFirst("Proxy-Authorization"));<a name="line.545"></a>
+<span class="sourceLineNo">546</span>   }<a name="line.546"></a>
+<span class="sourceLineNo">547</span><a name="line.547"></a>
+<span class="sourceLineNo">548</span>   /**<a name="line.548"></a>
+<span class="sourceLineNo">549</span>    * Returns the &lt;code&gt;Range&lt;/code&gt; header on the request.<a name="line.549"></a>
+<span class="sourceLineNo">550</span>    * &lt;p&gt;<a name="line.550"></a>
+<span class="sourceLineNo">551</span>    * Request only part of an entity. Bytes are numbered from 0.<a name="line.551"></a>
+<span class="sourceLineNo">552</span>    *<a name="line.552"></a>
+<span class="sourceLineNo">553</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.553"></a>
+<span class="sourceLineNo">554</span>    * &lt;p class='bcode'&gt;<a name="line.554"></a>
+<span class="sourceLineNo">555</span>    *    Range: bytes=500-999<a name="line.555"></a>
+<span class="sourceLineNo">556</span>    * &lt;/p&gt;<a name="line.556"></a>
+<span class="sourceLineNo">557</span>    *<a name="line.557"></a>
+<span class="sourceLineNo">558</span>    * @return The parsed &lt;code&gt;Range&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.558"></a>
+<span class="sourceLineNo">559</span>    */<a name="line.559"></a>
+<span class="sourceLineNo">560</span>   public Range getRange() {<a name="line.560"></a>
+<span class="sourceLineNo">561</span>      return Range.forString(getFirst("Range"));<a name="line.561"></a>
+<span class="sourceLineNo">562</span>   }<a name="line.562"></a>
+<span class="sourceLineNo">563</span><a name="line.563"></a>
+<span class="sourceLineNo">564</span>   /**<a name="line.564"></a>
+<span class="sourceLineNo">565</span>    * Returns the &lt;code&gt;Referer&lt;/code&gt; header on the request.<a name="line.565"></a>
+<span class="sourceLineNo">566</span>    * &lt;p&gt;<a name="line.566"></a>
+<span class="sourceLineNo">567</span>    * This is the address of the previous web page from which a link to the currently requested page was followed.<a name="line.567"></a>
+<span class="sourceLineNo">568</span>    *<a name="line.568"></a>
+<span class="sourceLineNo">569</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.569"></a>
+<span class="sourceLineNo">570</span>    * &lt;p class='bcode'&gt;<a name="line.570"></a>
+<span class="sourceLineNo">571</span>    *    Referer: http://en.wikipedia.org/wiki/Main_Page<a name="line.571"></a>
+<span class="sourceLineNo">572</span>    * &lt;/p&gt;<a name="line.572"></a>
+<span class="sourceLineNo">573</span>    *<a name="line.573"></a>
+<span class="sourceLineNo">574</span>    * @return The parsed &lt;code&gt;Referer&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.574"></a>
+<span class="sourceLineNo">575</span>    */<a name="line.575"></a>
+<span class="sourceLineNo">576</span>   public Referer getReferer() {<a name="line.576"></a>
+<span class="sourceLineNo">577</span>      return Referer.forString(getFirst("Referer"));<a name="line.577"></a>
+<span class="sourceLineNo">578</span>   }<a name="line.578"></a>
+<span class="sourceLineNo">579</span><a name="line.579"></a>
+<span class="sourceLineNo">580</span>   /**<a name="line.580"></a>
+<span class="sourceLineNo">581</span>    * Returns the &lt;code&gt;TE&lt;/code&gt; header on the request.<a name="line.581"></a>
+<span class="sourceLineNo">582</span>    * &lt;p&gt;<a name="line.582"></a>
+<span class="sourceLineNo">583</span>    * The transfer encodings the user agent is willing to accept: the same values as for the response header field<a name="line.583"></a>
+<span class="sourceLineNo">584</span>    * Transfer-Encoding can be used, plus the "trailers" value (related to the "chunked" transfer method) to notify the<a name="line.584"></a>
+<span class="sourceLineNo">585</span>    * server it expects to receive additional fields in the trailer after the last, zero-sized, chunk.<a name="line.585"></a>
+<span class="sourceLineNo">586</span>    *<a name="line.586"></a>
+<span class="sourceLineNo">587</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.587"></a>
+<span class="sourceLineNo">588</span>    * &lt;p class='bcode'&gt;<a name="line.588"></a>
+<span class="sourceLineNo">589</span>    *    TE: trailers, deflate<a name="line.589"></a>
+<span class="sourceLineNo">590</span>    * &lt;/p&gt;<a name="line.590"></a>
+<span class="sourceLineNo">591</span>    *<a name="line.591"></a>
+<span class="sourceLineNo">592</span>    * @return The parsed &lt;code&gt;TE&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.592"></a>
+<span class="sourceLineNo">593</span>    */<a name="line.593"></a>
+<span class="sourceLineNo">594</span>   public TE getTE() {<a name="line.594"></a>
+<span class="sourceLineNo">595</span>      return TE.forString(getFirst("TE"));<a name="line.595"></a>
+<span class="sourceLineNo">596</span>   }<a name="line.596"></a>
+<span class="sourceLineNo">597</span><a name="line.597"></a>
+<span class="sourceLineNo">598</span>   /**<a name="line.598"></a>
+<span class="sourceLineNo">599</span>    * Returns the &lt;code&gt;Time-Zone&lt;/code&gt; header value on the request if there is one.<a name="line.599"></a>
+<span class="sourceLineNo">600</span>    * &lt;p&gt;<a name="line.600"></a>
+<span class="sourceLineNo">601</span>    * Example: &lt;js&gt;"GMT"&lt;/js&gt;.<a name="line.601"></a>
+<span class="sourceLineNo">602</span>    *<a name="line.602"></a>
+<span class="sourceLineNo">603</span>    * @return The &lt;code&gt;Time-Zone&lt;/code&gt; header value on the request, or &lt;jk&gt;null&lt;/jk&gt; if not present.<a name="line.603"></a>
+<span class="sourceLineNo">604</span>    */<a name="line.604"></a>
+<span class="sourceLineNo">605</span>   public TimeZone getTimeZone() {<a name="line.605"></a>
+<span class="sourceLineNo">606</span>      String tz = getFirst("Time-Zone");<a name="line.606"></a>
+<span class="sourceLineNo">607</span>      if (tz != null)<a name="line.607"></a>
+<span class="sourceLineNo">608</span>         return TimeZone.getTimeZone(tz);<a name="line.608"></a>
+<span class="sourceLineNo">609</span>      return null;<a name="line.609"></a>
+<span class="sourceLineNo">610</span>   }<a name="line.610"></a>
+<span class="sourceLineNo">611</span><a name="line.611"></a>
+<span class="sourceLineNo">612</span>   /**<a name="line.612"></a>
+<span class="sourceLineNo">613</span>    * Returns the &lt;code&gt;User-Agent&lt;/code&gt; header on the request.<a name="line.613"></a>
+<span class="sourceLineNo">614</span>    * &lt;p&gt;<a name="line.614"></a>
+<span class="sourceLineNo">615</span>    * The user agent string of the user agent.<a name="line.615"></a>
+<span class="sourceLineNo">616</span>    *<a name="line.616"></a>
+<span class="sourceLineNo">617</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.617"></a>
+<span class="sourceLineNo">618</span>    * &lt;p class='bcode'&gt;<a name="line.618"></a>
+<span class="sourceLineNo">619</span>    *    User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20100101 Firefox/21.0<a name="line.619"></a>
+<span class="sourceLineNo">620</span>    * &lt;/p&gt;<a name="line.620"></a>
+<span class="sourceLineNo">621</span>    *<a name="line.621"></a>
+<span class="sourceLineNo">622</span>    * @return The parsed &lt;code&gt;User-Agent&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.622"></a>
+<span class="sourceLineNo">623</span>    */<a name="line.623"></a>
+<span class="sourceLineNo">624</span>   public UserAgent getUserAgent() {<a name="line.624"></a>
+<span class="sourceLineNo">625</span>      return UserAgent.forString(getFirst("User-Agent"));<a name="line.625"></a>
+<span class="sourceLineNo">626</span>   }<a name="line.626"></a>
+<span class="sourceLineNo">627</span><a name="line.627"></a>
+<span class="sourceLineNo">628</span>   /**<a name="line.628"></a>
+<span class="sourceLineNo">629</span>    * Returns the &lt;code&gt;Upgrade&lt;/code&gt; header on the request.<a name="line.629"></a>
+<span class="sourceLineNo">630</span>    * &lt;p&gt;<a name="line.630"></a>
+<span class="sourceLineNo">631</span>    * Ask the server to upgrade to another protocol.<a name="line.631"></a>
+<span class="sourceLineNo">632</span>    *<a name="line.632"></a>
+<span class="sourceLineNo">633</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.633"></a>
+<span class="sourceLineNo">634</span>    * &lt;p class='bcode'&gt;<a name="line.634"></a>
+<span class="sourceLineNo">635</span>    *    Upgrade: HTTP/2.0, HTTPS/1.3, IRC/6.9, RTA/x11, websocket<a name="line.635"></a>
+<span class="sourceLineNo">636</span>    * &lt;/p&gt;<a name="line.636"></a>
+<span class="sourceLineNo">637</span>    *<a name="line.637"></a>
+<span class="sourceLineNo">638</span>    * @return The parsed &lt;code&gt;Upgrade&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.638"></a>
+<span class="sourceLineNo">639</span>    */<a name="line.639"></a>
+<span class="sourceLineNo">640</span>   public Upgrade getUpgrade() {<a name="line.640"></a>
+<span class="sourceLineNo">641</span>      return Upgrade.forString(getFirst("Upgrade"));<a name="line.641"></a>
+<span class="sourceLineNo">642</span>   }<a name="line.642"></a>
+<span class="sourceLineNo">643</span><a name="line.643"></a>
+<span class="sourceLineNo">644</span>   /**<a name="line.644"></a>
+<span class="sourceLineNo">645</span>    * Returns the &lt;code&gt;Via&lt;/code&gt; header on the request.<a name="line.645"></a>
+<span class="sourceLineNo">646</span>    * &lt;p&gt;<a name="line.646"></a>
+<span class="sourceLineNo">647</span>    * Informs the server of proxies through which the request was sent.<a name="line.647"></a>
+<span class="sourceLineNo">648</span>    *<a name="line.648"></a>
+<span class="sourceLineNo">649</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.649"></a>
+<span class="sourceLineNo">650</span>    * &lt;p class='bcode'&gt;<a name="line.650"></a>
+<span class="sourceLineNo">651</span>    *    Via: 1.0 fred, 1.1 example.com (Apache/1.1)<a name="line.651"></a>
+<span class="sourceLineNo">652</span>    * &lt;/p&gt;<a name="line.652"></a>
+<span class="sourceLineNo">653</span>    *<a name="line.653"></a>
+<span class="sourceLineNo">654</span>    * @return The parsed &lt;code&gt;Via&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.654"></a>
+<span class="sourceLineNo">655</span>    */<a name="line.655"></a>
+<span class="sourceLineNo">656</span>   public Via getVia() {<a name="line.656"></a>
+<span class="sourceLineNo">657</span>      return Via.forString(getFirst("Via"));<a name="line.657"></a>
+<span class="sourceLineNo">658</span>   }<a name="line.658"></a>
+<span class="sourceLineNo">659</span><a name="line.659"></a>
+<span class="sourceLineNo">660</span>   /**<a name="line.660"></a>
+<span class="sourceLineNo">661</span>    * Returns the &lt;code&gt;Warning&lt;/code&gt; header on the request.<a name="line.661"></a>
+<span class="sourceLineNo">662</span>    * &lt;p&gt;<a name="line.662"></a>
+<span class="sourceLineNo">663</span>    * A general warning about possible problems with the entity body.<a name="line.663"></a>
+<span class="sourceLineNo">664</span>    *<a name="line.664"></a>
+<span class="sourceLineNo">665</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.665"></a>
+<span class="sourceLineNo">666</span>    * &lt;p class='bcode'&gt;<a name="line.666"></a>
+<span class="sourceLineNo">667</span>    *    Warning: 199 Miscellaneous warning<a name="line.667"></a>
+<span class="sourceLineNo">668</span>    * &lt;/p&gt;<a name="line.668"></a>
+<span class="sourceLineNo">669</span>    *<a name="line.669"></a>
+<span class="sourceLineNo">670</span>    * @return The parsed &lt;code&gt;Warning&lt;/code&gt; header on the request, or &lt;jk&gt;null&lt;/jk&gt; if not found.<a name="line.670"></a>
+<span class="sourceLineNo">671</span>    */<a name="line.671"></a>
+<span class="sourceLineNo">672</span>   public Warning getWarning() {<a name="line.672"></a>
+<span class="sourceLineNo">673</span>      return Warning.forString(getFirst("Warning"));<a name="line.673"></a>
+<span class="sourceLineNo">674</span>   }<a name="line.674"></a>
+<span class="sourceLineNo">675</span>}<a name="line.675"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/f1f17bc3/content/site/apidocs/src-html/org/apache/juneau/rest/RequestPathParams.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/src-html/org/apache/juneau/rest/RequestPathParams.html b/content/site/apidocs/src-html/org/apache/juneau/rest/RequestPathParams.html
new file mode 100644
index 0000000..66dd1b8
--- /dev/null
+++ b/content/site/apidocs/src-html/org/apache/juneau/rest/RequestPathParams.html
@@ -0,0 +1,209 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+<title>Source code</title>
+<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style">
+</head>
+<body>
+<div class="sourceContainer">
+<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a>
+<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *<a name="line.2"></a>
+<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *<a name="line.3"></a>
+<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *<a name="line.4"></a>
+<span class="sourceLineNo">005</span>// * with the License.  You may obtain a copy of the License at                                                              *<a name="line.5"></a>
+<span class="sourceLineNo">006</span>// *                                                                                                                         *<a name="line.6"></a>
+<span class="sourceLineNo">007</span>// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *<a name="line.7"></a>
+<span class="sourceLineNo">008</span>// *                                                                                                                         *<a name="line.8"></a>
+<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *<a name="line.9"></a>
+<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *<a name="line.10"></a>
+<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License.                                              *<a name="line.11"></a>
+<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a>
+<span class="sourceLineNo">013</span>package org.apache.juneau.rest;<a name="line.13"></a>
+<span class="sourceLineNo">014</span><a name="line.14"></a>
+<span class="sourceLineNo">015</span>import java.lang.reflect.*;<a name="line.15"></a>
+<span class="sourceLineNo">016</span>import java.util.*;<a name="line.16"></a>
+<span class="sourceLineNo">017</span><a name="line.17"></a>
+<span class="sourceLineNo">018</span>import org.apache.juneau.*;<a name="line.18"></a>
+<span class="sourceLineNo">019</span>import org.apache.juneau.parser.*;<a name="line.19"></a>
+<span class="sourceLineNo">020</span>import org.apache.juneau.urlencoding.*;<a name="line.20"></a>
+<span class="sourceLineNo">021</span><a name="line.21"></a>
+<span class="sourceLineNo">022</span>/**<a name="line.22"></a>
+<span class="sourceLineNo">023</span> * Represents the path parameters on an HTTP request.<a name="line.23"></a>
+<span class="sourceLineNo">024</span> */<a name="line.24"></a>
+<span class="sourceLineNo">025</span>@SuppressWarnings("unchecked")<a name="line.25"></a>
+<span class="sourceLineNo">026</span>public class RequestPathParams extends TreeMap&lt;String,String&gt; {<a name="line.26"></a>
+<span class="sourceLineNo">027</span>   private static final long serialVersionUID = 1L;<a name="line.27"></a>
+<span class="sourceLineNo">028</span><a name="line.28"></a>
+<span class="sourceLineNo">029</span>   private UrlEncodingParser parser;<a name="line.29"></a>
+<span class="sourceLineNo">030</span>   private BeanSession beanSession;<a name="line.30"></a>
+<span class="sourceLineNo">031</span><a name="line.31"></a>
+<span class="sourceLineNo">032</span>   RequestPathParams() {<a name="line.32"></a>
+<span class="sourceLineNo">033</span>      super(String.CASE_INSENSITIVE_ORDER);<a name="line.33"></a>
+<span class="sourceLineNo">034</span>   }<a name="line.34"></a>
+<span class="sourceLineNo">035</span><a name="line.35"></a>
+<span class="sourceLineNo">036</span>   RequestPathParams setParser(UrlEncodingParser parser) {<a name="line.36"></a>
+<span class="sourceLineNo">037</span>      this.parser = parser;<a name="line.37"></a>
+<span class="sourceLineNo">038</span>      return this;<a name="line.38"></a>
+<span class="sourceLineNo">039</span>   }<a name="line.39"></a>
+<span class="sourceLineNo">040</span><a name="line.40"></a>
+<span class="sourceLineNo">041</span>   RequestPathParams setBeanSession(BeanSession beanSession) {<a name="line.41"></a>
+<span class="sourceLineNo">042</span>      this.beanSession = beanSession;<a name="line.42"></a>
+<span class="sourceLineNo">043</span>      return this;<a name="line.43"></a>
+<span class="sourceLineNo">044</span>   }<a name="line.44"></a>
+<span class="sourceLineNo">045</span><a name="line.45"></a>
+<span class="sourceLineNo">046</span>   /**<a name="line.46"></a>
+<span class="sourceLineNo">047</span>    * Sets a request query parameter value.<a name="line.47"></a>
+<span class="sourceLineNo">048</span>    *<a name="line.48"></a>
+<span class="sourceLineNo">049</span>    * @param name The parameter name.<a name="line.49"></a>
+<span class="sourceLineNo">050</span>    * @param value The parameter value.<a name="line.50"></a>
+<span class="sourceLineNo">051</span>    */<a name="line.51"></a>
+<span class="sourceLineNo">052</span>   public void put(String name, Object value) {<a name="line.52"></a>
+<span class="sourceLineNo">053</span>      put(name, value);<a name="line.53"></a>
+<span class="sourceLineNo">054</span>   }<a name="line.54"></a>
+<span class="sourceLineNo">055</span><a name="line.55"></a>
+<span class="sourceLineNo">056</span>   /**<a name="line.56"></a>
+<span class="sourceLineNo">057</span>    * Returns the specified path parameter converted to a POJO.<a name="line.57"></a>
+<span class="sourceLineNo">058</span>    * &lt;p&gt;<a name="line.58"></a>
+<span class="sourceLineNo">059</span>    * The type can be any POJO type convertable from a &lt;code&gt;String&lt;/code&gt; (See &lt;a class="doclink" <a name="line.59"></a>
+<span class="sourceLineNo">060</span>    * href="package-summary.html#PojosConvertableFromString"&gt;POJOs Convertable From Strings&lt;/a&gt;).<a name="line.60"></a>
+<span class="sourceLineNo">061</span>    * &lt;p&gt;<a name="line.61"></a>
+<span class="sourceLineNo">062</span>    * &lt;h5 class='section'&gt;Examples:&lt;/h5&gt;<a name="line.62"></a>
+<span class="sourceLineNo">063</span>    * &lt;p class='bcode'&gt;<a name="line.63"></a>
+<span class="sourceLineNo">064</span>    *    &lt;jc&gt;// Parse into an integer.&lt;/jc&gt;<a name="line.64"></a>
+<span class="sourceLineNo">065</span>    *    &lt;jk&gt;int&lt;/jk&gt; myparam = req.getPathParameter(&lt;js&gt;"myparam"&lt;/js&gt;, &lt;jk&gt;int&lt;/jk&gt;.&lt;jk&gt;class&lt;/jk&gt;);<a name="line.65"></a>
+<span class="sourceLineNo">066</span>    *<a name="line.66"></a>
+<span class="sourceLineNo">067</span>    *    &lt;jc&gt;// Parse into an int array.&lt;/jc&gt;<a name="line.67"></a>
+<span class="sourceLineNo">068</span>    *    &lt;jk&gt;int&lt;/jk&gt;[] myparam = req.getPathParameter(&lt;js&gt;"myparam"&lt;/js&gt;, &lt;jk&gt;int&lt;/jk&gt;[].&lt;jk&gt;class&lt;/jk&gt;);<a name="line.68"></a>
+<span class="sourceLineNo">069</span><a name="line.69"></a>
+<span class="sourceLineNo">070</span>    *    &lt;jc&gt;// Parse into a bean.&lt;/jc&gt;<a name="line.70"></a>
+<span class="sourceLineNo">071</span>    *    MyBean myparam = req.getPathParameter(&lt;js&gt;"myparam"&lt;/js&gt;, MyBean.&lt;jk&gt;class&lt;/jk&gt;);<a name="line.71"></a>
+<span class="sourceLineNo">072</span>    *<a name="line.72"></a>
+<span class="sourceLineNo">073</span>    *    &lt;jc&gt;// Parse into a linked-list of objects.&lt;/jc&gt;<a name="line.73"></a>
+<span class="sourceLineNo">074</span>    *    List myparam = req.getPathParameter(&lt;js&gt;"myparam"&lt;/js&gt;, LinkedList.&lt;jk&gt;class&lt;/jk&gt;);<a name="line.74"></a>
+<span class="sourceLineNo">075</span>    *<a name="line.75"></a>
+<span class="sourceLineNo">076</span>    *    &lt;jc&gt;// Parse into a map of object keys/values.&lt;/jc&gt;<a name="line.76"></a>
+<span class="sourceLineNo">077</span>    *    Map myparam = req.getPathParameter(&lt;js&gt;"myparam"&lt;/js&gt;, TreeMap.&lt;jk&gt;class&lt;/jk&gt;);<a name="line.77"></a>
+<span class="sourceLineNo">078</span>    * &lt;/p&gt;<a name="line.78"></a>
+<span class="sourceLineNo">079</span>    *<a name="line.79"></a>
+<span class="sourceLineNo">080</span>    * @param name The attribute name.<a name="line.80"></a>
+<span class="sourceLineNo">081</span>    * @param type The class type to convert the attribute value to.<a name="line.81"></a>
+<span class="sourceLineNo">082</span>    * @param &lt;T&gt; The class type to convert the attribute value to.<a name="line.82"></a>
+<span class="sourceLineNo">083</span>    * @return The attribute value converted to the specified class type.<a name="line.83"></a>
+<span class="sourceLineNo">084</span>    * @throws ParseException<a name="line.84"></a>
+<span class="sourceLineNo">085</span>    */<a name="line.85"></a>
+<span class="sourceLineNo">086</span>   public &lt;T&gt; T get(String name, Class&lt;T&gt; type) throws ParseException {<a name="line.86"></a>
+<span class="sourceLineNo">087</span>      return parse(name, beanSession.getClassMeta(type));<a name="line.87"></a>
+<span class="sourceLineNo">088</span>   }<a name="line.88"></a>
+<span class="sourceLineNo">089</span><a name="line.89"></a>
+<span class="sourceLineNo">090</span>   /**<a name="line.90"></a>
+<span class="sourceLineNo">091</span>    * Returns the specified path parameter converted to a POJO.<a name="line.91"></a>
+<span class="sourceLineNo">092</span>    * &lt;p&gt;<a name="line.92"></a>
+<span class="sourceLineNo">093</span>    * The type can be any POJO type convertable from a &lt;code&gt;String&lt;/code&gt; (See &lt;a class="doclink" href="package-summary.html#PojosConvertableFromString"&gt;POJOs Convertable From Strings&lt;/a&gt;).<a name="line.93"></a>
+<span class="sourceLineNo">094</span>    * &lt;p&gt;<a name="line.94"></a>
+<span class="sourceLineNo">095</span>    * Use this method if you want to parse into a parameterized &lt;code&gt;Map&lt;/code&gt;/&lt;code&gt;Collection&lt;/code&gt; object.<a name="line.95"></a>
+<span class="sourceLineNo">096</span>    * &lt;p&gt;<a name="line.96"></a>
+<span class="sourceLineNo">097</span>    * &lt;h5 class='section'&gt;Examples:&lt;/h5&gt;<a name="line.97"></a>
+<span class="sourceLineNo">098</span>    * &lt;p class='bcode'&gt;<a name="line.98"></a>
+<span class="sourceLineNo">099</span>    *    &lt;jc&gt;// Parse into a linked-list of strings.&lt;/jc&gt;<a name="line.99"></a>
+<span class="sourceLineNo">100</span>    *    List&amp;lt;String&amp;gt; myparam = req.getPathParameter(&lt;js&gt;"myparam"&lt;/js&gt;, LinkedList.&lt;jk&gt;class&lt;/jk&gt;, String.&lt;jk&gt;class&lt;/jk&gt;);<a name="line.100"></a>
+<span class="sourceLineNo">101</span>    *<a name="line.101"></a>
+<span class="sourceLineNo">102</span>    *    &lt;jc&gt;// Parse into a linked-list of linked-lists of strings.&lt;/jc&gt;<a name="line.102"></a>
+<span class="sourceLineNo">103</span>    *    List&amp;lt;List&amp;lt;String&amp;gt;&amp;gt; myparam = req.getPathParameter(&lt;js&gt;"myparam"&lt;/js&gt;, LinkedList.&lt;jk&gt;class&lt;/jk&gt;, LinkedList.&lt;jk&gt;class&lt;/jk&gt;, String.&lt;jk&gt;class&lt;/jk&gt;);<a name="line.103"></a>
+<span class="sourceLineNo">104</span>    *<a name="line.104"></a>
+<span class="sourceLineNo">105</span>    *    &lt;jc&gt;// Parse into a map of string keys/values.&lt;/jc&gt;<a name="line.105"></a>
+<span class="sourceLineNo">106</span>    *    Map&amp;lt;String,String&amp;gt; myparam = req.getPathParameter(&lt;js&gt;"myparam"&lt;/js&gt;, TreeMap.&lt;jk&gt;class&lt;/jk&gt;, String.&lt;jk&gt;class&lt;/jk&gt;, String.&lt;jk&gt;class&lt;/jk&gt;);<a name="line.106"></a>
+<span class="sourceLineNo">107</span>    *<a name="line.107"></a>
+<span class="sourceLineNo">108</span>    *    &lt;jc&gt;// Parse into a map containing string keys and values of lists containing beans.&lt;/jc&gt;<a name="line.108"></a>
+<span class="sourceLineNo">109</span>    *    Map&amp;lt;String,List&amp;lt;MyBean&amp;gt;&amp;gt; myparam = req.getPathParameter(&lt;js&gt;"myparam"&lt;/js&gt;, TreeMap.&lt;jk&gt;class&lt;/jk&gt;, String.&lt;jk&gt;class&lt;/jk&gt;, List.&lt;jk&gt;class&lt;/jk&gt;, MyBean.&lt;jk&gt;class&lt;/jk&gt;);<a name="line.109"></a>
+<span class="sourceLineNo">110</span>    * &lt;/p&gt;<a name="line.110"></a>
+<span class="sourceLineNo">111</span>    *<a name="line.111"></a>
+<span class="sourceLineNo">112</span>    * @param name The attribute name.<a name="line.112"></a>
+<span class="sourceLineNo">113</span>    * @param type The type of object to create.<a name="line.113"></a>
+<span class="sourceLineNo">114</span>    *    &lt;br&gt;Can be any of the following: {@link ClassMeta}, {@link Class}, {@link ParameterizedType}, {@link GenericArrayType}<a name="line.114"></a>
+<span class="sourceLineNo">115</span>    * @param args The type arguments of the class if it's a collection or map.<a name="line.115"></a>
+<span class="sourceLineNo">116</span>    *    &lt;br&gt;Can be any of the following: {@link ClassMeta}, {@link Class}, {@link ParameterizedType}, {@link GenericArrayType}<a name="line.116"></a>
+<span class="sourceLineNo">117</span>    *    &lt;br&gt;Ignored if the main type is not a map or collection.<a name="line.117"></a>
+<span class="sourceLineNo">118</span>    * @param &lt;T&gt; The class type to convert the attribute value to.<a name="line.118"></a>
+<span class="sourceLineNo">119</span>    * @return The attribute value converted to the specified class type.<a name="line.119"></a>
+<span class="sourceLineNo">120</span>    * @throws ParseException<a name="line.120"></a>
+<span class="sourceLineNo">121</span>    */<a name="line.121"></a>
+<span class="sourceLineNo">122</span>   public &lt;T&gt; T get(String name, Type type, Type...args) throws ParseException {<a name="line.122"></a>
+<span class="sourceLineNo">123</span>      return (T)parse(name, beanSession.getClassMeta(type, args));<a name="line.123"></a>
+<span class="sourceLineNo">124</span>   }<a name="line.124"></a>
+<span class="sourceLineNo">125</span><a name="line.125"></a>
+<span class="sourceLineNo">126</span>   /* Workhorse method */<a name="line.126"></a>
+<span class="sourceLineNo">127</span>   &lt;T&gt; T parse(String name, ClassMeta&lt;T&gt; cm) throws ParseException {<a name="line.127"></a>
+<span class="sourceLineNo">128</span>      Object attr = get(name);<a name="line.128"></a>
+<span class="sourceLineNo">129</span>      T t = null;<a name="line.129"></a>
+<span class="sourceLineNo">130</span>      if (attr != null)<a name="line.130"></a>
+<span class="sourceLineNo">131</span>         t = parser.parsePart(attr.toString(), cm);<a name="line.131"></a>
+<span class="sourceLineNo">132</span>      if (t == null &amp;&amp; cm.isPrimitive())<a name="line.132"></a>
+<span class="sourceLineNo">133</span>         return cm.getPrimitiveDefault();<a name="line.133"></a>
+<span class="sourceLineNo">134</span>      return t;<a name="line.134"></a>
+<span class="sourceLineNo">135</span>   }<a name="line.135"></a>
+<span class="sourceLineNo">136</span><a name="line.136"></a>
+<span class="sourceLineNo">137</span>}<a name="line.137"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>


Mime
View raw message