Package io.undertow.util
Class HeaderMap
java.lang.Object
io.undertow.util.HeaderMap
- All Implemented Interfaces:
Iterable<HeaderValues>
An optimized array-backed header map.
- Author:
- David M. Lloyd
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd
(HttpString headerName, long headerValue) add
(HttpString headerName, String headerValue) addAll
(HttpString headerName, Collection<String> headerValues) addFirst
(HttpString headerName, String headerValue) addLast
(HttpString headerName, String headerValue) clear()
boolean
contains
(HttpString headerName) boolean
int
count
(HttpString headerName) int
eachValue
(HttpString headerName) boolean
long
Do a fast iteration of this header map without creating any objects.long
Do a fast iteration of this header map without creating any objects, only considering non-empty header values.fiCurrent
(long cookie) Return the value at the current index in a fast iteration.long
fiNext
(long cookie) Find the next index in a fast iteration.long
fiNextNonEmpty
(long cookie) Find the next non-empty index in a fast iteration.get
(HttpString headerName) get
(HttpString headerName, int index) getFirst
(HttpString headerName) getLast
(HttpString headerName) int
hashCode()
iterator()
put
(HttpString headerName, long headerValue) put
(HttpString headerName, String headerValue) putAll
(HttpString headerName, Collection<String> headerValues) remove
(HttpString headerName) int
size()
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
HeaderMap
public HeaderMap()
-
-
Method Details
-
get
-
get
-
getFirst
-
getFirst
-
get
- Throws:
IndexOutOfBoundsException
-
get
- Throws:
IndexOutOfBoundsException
-
getLast
-
getLast
-
count
-
count
-
size
public int size() -
fastIterate
public long fastIterate()Do a fast iteration of this header map without creating any objects.- Returns:
- an opaque iterating cookie, or -1 if no iteration is possible
- See Also:
-
fastIterateNonEmpty
public long fastIterateNonEmpty()Do a fast iteration of this header map without creating any objects, only considering non-empty header values.- Returns:
- an opaque iterating cookie, or -1 if no iteration is possible
-
fiNext
public long fiNext(long cookie) Find the next index in a fast iteration.- Parameters:
cookie
- the previous cookie value- Returns:
- the next cookie value, or -1L if iteration is done
-
fiNextNonEmpty
public long fiNextNonEmpty(long cookie) Find the next non-empty index in a fast iteration.- Parameters:
cookie
- the previous cookie value- Returns:
- the next cookie value, or -1L if iteration is done
-
fiCurrent
Return the value at the current index in a fast iteration.- Parameters:
cookie
- the iteration cookie value- Returns:
- the values object at this position
- Throws:
NoSuchElementException
- if the cookie value is invalid
-
eachValue
-
iterator
- Specified by:
iterator
in interfaceIterable<HeaderValues>
-
getHeaderNames
-
add
-
addFirst
-
addLast
-
add
-
addAll
-
put
-
put
-
putAll
-
clear
-
remove
-
remove
-
contains
-
contains
-
equals
-
hashCode
public int hashCode() -
toString
-