Class RequestHeaderFields
java.lang.Object
java.util.AbstractMap<String,List<String>>
java.util.HashMap<String,List<String>>
org.refcodes.web.AbstractHttpFields<RequestHeaderFields>
org.refcodes.web.AbstractHeaderFields<RequestCookie,RequestHeaderFields>
org.refcodes.web.RequestHeaderFields
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,,List<String>> HeaderFields<RequestCookie,,RequestHeaderFields> HttpFields<RequestHeaderFields>
The
RequestHeaderFields reflect the structure of a HTTP-Header and
may be used to represent a HTTP-Header.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields inherited from interface org.refcodes.web.HeaderFields
BASIC_REALM -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new request Header-Fields impl.RequestHeaderFields(Map<String, List<String>> aFromHeaderFields) Instantiates a new request Header-Fields impl. -
Method Summary
Modifier and TypeMethodDescriptionAdds an individual server-side cookie to be sent to the client to thisResponseHeaderFieldsinstance.protected RequestCookiecreateCookie(String aHttpCookie) protected RequestCookiecreateCookie(String aCookieName, String aValue) Creates a plainCookiewith the given name and value.protected StringThe Header-Field name for theCookieelements.Methods inherited from class org.refcodes.web.AbstractHeaderFields
addCookie, addCookie, addTo, entrySet, get, getAllCookies, isCommaSeparatedHeaderField, keySet, put, putAll, toHeaderField, toHeaderFieldsMethods inherited from class org.refcodes.web.AbstractHttpFields
copyHttpFieldsMethods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, forEach, getOrDefault, isEmpty, merge, newHashMap, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.refcodes.web.HeaderFields
addTo, addTo, addTo, get, getAcceptCharsets, getAcceptEncodings, getAcceptLanguages, getAcceptTypes, getAllowMethods, getAuthenticate, getAuthorization, getBasicAuth, getBasicAuthCredentials, getBearerAuthCredentials, getContentEncoding, getContentLength, getContentType, getCookies, getFirst, getFirstCookie, getHost, getRequestId, getSessionId, getUnknownAcceptTypes, getUnknownContentTypes, getUserAgent, put, put, put, putAcceptCharsets, putAcceptCharsets, putAcceptEncodings, putAcceptEncodings, putAcceptLanguages, putAcceptLanguages, putAcceptTypes, putAcceptTypes, putAllowMethods, putAllowMethods, putAuthenticate, putAuthorization, putAuthorization, putAuthorization, putBasicAuthCredentials, putBasicAuthCredentials, putBasicAuthRequired, putBearerAuthCredentials, putBearerAuthCredentials, putContentEncoding, putContentLength, putContentType, putContentType, putHost, putRequestId, putSessionId, putUserAgent, remove, removeAcceptCharsets, removeAcceptEncodings, removeAcceptLanguages, removeAcceptTypes, removeAllowMethods, removeAuthenticate, removeAuthorization, removeBasicAuthCredentials, removeBasicAuthenticate, removeBearerAuthCredentials, removeContentEncoding, removeContentLength, removeContentType, removeHost, removeRequestId, removeSessionId, removeUserAgent, toBasicAuthRealm, toHeaderFields, toHttpCookies, withAcceptCharsets, withAcceptCharsets, withAcceptEncodings, withAcceptEncodings, withAcceptLanguages, withAcceptLanguages, withAcceptTypes, withAcceptTypes, withAddCookie, withAddCookie, withAddTo, withAddTo, withAddTo, withAllowMethods, withAllowMethods, withAuthenticate, withAuthorization, withAuthorization, withAuthorization, withBasicAuthCredentials, withBasicAuthCredentials, withBasicAuthRequired, withBearerAuthCredentials, withBearerAuthCredentials, withContentEncoding, withContentLength, withContentType, withContentType, withHost, withPut, withPut, withPut, withRequestId, withSessionId, withUserAgentMethods inherited from interface org.refcodes.web.HttpFields
addAll, addTo, addTo, addTo, addTo, addTo, getFirst, getFirst, put, put, put, put, toField, toField, withAddTo, withAddTo, withAddTo, withAddTo, withAddTo, withAddTo, withPut, withPut, withPut, withPut, withPut, withPutMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, getOrDefault, hashCode, isEmpty, merge, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Constructor Details
-
RequestHeaderFields
public RequestHeaderFields()Instantiates a new request Header-Fields impl. -
RequestHeaderFields
-
-
Method Details
-
addCookie
Adds an individual server-side cookie to be sent to the client to thisResponseHeaderFieldsinstance. The server-side cookies are retrieved from theHeaderField.SET_COOKIEHeader-Field. WITH THE METHODHeaderFields.getAllCookies()andHeaderFields.getCookies(String)as well asHeaderFields.getFirstCookie(String)ONLY THE COOKIES SENT BY THE CLIENT CAN BE RETRIEVED (E.G. COOKIES RESIDING IN THE HEADER FIELDHeaderField.COOKIE). COOKIES SET VIAHeaderFields.addCookie(String, String)ORHeaderFields.withAddCookie(String, String)CANNOT BE RETRIEVED, AS THE COOKIES BEING SET SERVER-SIDE ARE PUT IN THEHeaderField.SET_COOKIEHeader-Field.- Parameters:
aHttpCookie- The HTTP-CookieStringto be paresd as a cookie.- Returns:
- The resulting cookie builder being added which can be modified
affecting(!) this
ResponseHeaderFieldsinstance!
-
getCookieFieldName
The Header-Field name for theCookieelements. The Header-Field name differs from the context, e.g. when setting aCookieserver-side or when retrieving aCookieclient-side.- Specified by:
getCookieFieldNamein classAbstractHeaderFields<RequestCookie,RequestHeaderFields> - Returns:
- The Header-Field where the
Cookieelements are stored.
-
createCookie
Creates a plainCookiewith the given name and value.- Specified by:
createCookiein classAbstractHeaderFields<RequestCookie,RequestHeaderFields> - Parameters:
aCookieName- The name of theCookie.aValue- The value for theCookie- Returns:
- The
Cookiewith the given name and value.
-
createCookie
- Specified by:
createCookiein classAbstractHeaderFields<RequestCookie,RequestHeaderFields> - Parameters:
aHttpCookie- The text of the Header-Field for the cookie to be created.- Returns:
- The
Cookiewith the given cookie properties.
-