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, Flavia Rainone
-
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()booleancontains(HttpString headerName) booleanintcount(HttpString headerName) inteachValue(HttpString headerName) booleanlongDo a fast iteration of this header map without creating any objects.longDo 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.longfiNext(long cookie) Find the next index in a fast iteration.longfiNextNonEmpty(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) inthashCode()iterator()put(HttpString headerName, long headerValue) put(HttpString headerName, String headerValue) putAll(HttpString headerName, Collection<String> headerValues) remove(HttpString headerName) intsize()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
iteratorin interfaceIterable<HeaderValues>
-
getHeaderNames
-
add
-
addFirst
-
addLast
-
add
-
addAll
-
put
-
put
-
putAll
-
putAll
-
clear
-
remove
-
remove
-
contains
-
contains
-
equals
-
hashCode
public int hashCode() -
toString
-