Class HeaderList.Unmodifiable
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Header>,Collection<Header>,List<Header>,RandomAccess,UnmodifiableBean
- Enclosing class:
- HeaderList
HeaderList.
This is the "collection-mutator-override" variant of the immutability paradigm. Because HeaderList
extends ArrayList, a single modify() funnel cannot intercept the inherited ArrayList
mutators, so this subclass snapshot-copies the elements in its constructor and overrides the entire
collection-mutator surface — its own fluent mutators plus the inherited ArrayList mutators (including the
iterator() / listIterator() mutators) — to throw UnsupportedOperationException. Read
operations and non-mutating iteration continue to work.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.juneau.http.classic.header.HeaderList
HeaderList.Unmodifiable, HeaderList.Void -
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection<? extends Header> c) booleanaddAll(Collection<? extends Header> c) Appends the specified header to the end of this list.Appends the specified header to the end of this list using a value supplier.Adds the specified headers to the end of the headers in this list.Adds the specified header to the end of the headers in this list.Adds the specified headers to the end of the headers in this list.caseSensitive(boolean value) Specifies that the headers in this list should be treated as case-sensitive.voidclear()iterator()listIterator(int index) Appends the specified header to the beginning of this list.Appends the specified header to the beginning of this list using a value supplier.Adds the specified headers to the beginning of the headers in this list.Adds the specified header to the beginning of the headers in this list.Adds the specified headers to the beginning of the headers in this list.remove(int index) booleanRemoves the header with the specified name from this list.Removes the header with the specified name from this list.Removes the specified headers from this list.Removes the specified header from this list.Removes the specified headers from this list.Removes all headers from this list.booleanremoveAll(Collection<?> c) booleanvoidreplaceAll(UnaryOperator<Header> operator) Allows header values to contain SVL variables.resolving(VarResolver varResolver) Allows header values to contain SVL variables.booleanretainAll(Collection<?> c) Replaces the first occurrence of the headers with the same name.Replaces the first occurrence of the headers with the same name.Replaces the first occurrence of the headers with the same name.Adds or replaces the header(s) with the same name.Adds or replaces the header(s) with the same name.setDefault(String name, Object value) Replaces the first occurrence of the headers with the same name.setDefault(String name, Supplier<?> value) Replaces the first occurrence of the headers with the same name.setDefault(List<Header> headers) Adds a collection of default headers.setDefault(Header... headers) Makes a copy of this list of headers and adds a collection of default headers.voidsort(Comparator<? super Header> c) Methods inherited from class org.apache.juneau.http.classic.header.HeaderList
contains, copy, create, forEach, forEach, forEachValue, forEachValue, get, get, get, getAll, getAll, getFirst, getLast, getValues, headerIterator, headerIterator, isUnmodifiable, of, of, ofPairs, stream, toString, unmodifiableMethods inherited from class java.util.ArrayList
clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, lastIndexOf, removeRange, size, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAllMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll
-
Method Details
-
append
Description copied from class:HeaderListAdds the specified header to the end of the headers in this list.- Overrides:
appendin classHeaderList- Parameters:
value- The header to add.null values are ignored.- Returns:
- This object.
-
append
Description copied from class:HeaderListAdds the specified headers to the end of the headers in this list.- Overrides:
appendin classHeaderList- Parameters:
values- The headers to add.null values are ignored.- Returns:
- This object.
-
append
Description copied from class:HeaderListAdds the specified headers to the end of the headers in this list.- Overrides:
appendin classHeaderList- Parameters:
values- The headers to add.null values are ignored.- Returns:
- This object.
-
append
Description copied from class:HeaderListAppends the specified header to the end of this list.The header is added as a
BasicHeader.- Overrides:
appendin classHeaderList- Parameters:
name- The header name.value- The header value.- Returns:
- This object.
-
append
Description copied from class:HeaderListAppends the specified header to the end of this list using a value supplier.The header is added as a
BasicHeader.Value is re-evaluated on each call to
BasicHeader.getValue().- Overrides:
appendin classHeaderList- Parameters:
name- The header name.value- The header value supplier.- Returns:
- This object.
-
caseSensitive
Description copied from class:HeaderListSpecifies that the headers in this list should be treated as case-sensitive.The default behavior is case-insensitive.
- Overrides:
caseSensitivein classHeaderList- Parameters:
value- The new value for this setting.- Returns:
- This object.
-
prepend
Description copied from class:HeaderListAdds the specified header to the beginning of the headers in this list.- Overrides:
prependin classHeaderList- Parameters:
value- The header to add.null values are ignored.- Returns:
- This object.
-
prepend
Description copied from class:HeaderListAdds the specified headers to the beginning of the headers in this list.- Overrides:
prependin classHeaderList- Parameters:
values- The headers to add.null values are ignored.- Returns:
- This object.
-
prepend
Description copied from class:HeaderListAdds the specified headers to the beginning of the headers in this list.- Overrides:
prependin classHeaderList- Parameters:
values- The headers to add.null values are ignored.- Returns:
- This object.
-
prepend
Description copied from class:HeaderListAppends the specified header to the beginning of this list.The header is added as a
BasicHeader.- Overrides:
prependin classHeaderList- Parameters:
name- The header name.value- The header value.- Returns:
- This object.
-
prepend
Description copied from class:HeaderListAppends the specified header to the beginning of this list using a value supplier.The header is added as a
BasicHeader.Value is re-evaluated on each call to
BasicHeader.getValue().- Overrides:
prependin classHeaderList- Parameters:
name- The header name.value- The header value supplier.- Returns:
- This object.
-
remove
Description copied from class:HeaderListRemoves the specified header from this list.- Overrides:
removein classHeaderList- Parameters:
value- The header to remove.null values are ignored.- Returns:
- This object.
-
remove
Description copied from class:HeaderListRemoves the specified headers from this list.- Overrides:
removein classHeaderList- Parameters:
values- The headers to remove.null values are ignored.- Returns:
- This object.
-
remove
Description copied from class:HeaderListRemoves the specified headers from this list.- Overrides:
removein classHeaderList- Parameters:
values- The headers to remove.null values are ignored.- Returns:
- This object.
-
remove
Description copied from class:HeaderListRemoves the header with the specified name from this list.- Overrides:
removein classHeaderList- Parameters:
name- The header name.- Returns:
- This object.
-
remove
Description copied from class:HeaderListRemoves the header with the specified name from this list.- Overrides:
removein classHeaderList- Parameters:
names- The header name.- Returns:
- This object.
-
removeAll
Description copied from class:HeaderListRemoves all headers from this list.- Overrides:
removeAllin classHeaderList- Returns:
- This object.
-
resolving
Description copied from class:HeaderListAllows header values to contain SVL variables.Resolves variables in header values when using the following methods:
append(String,Object)append(String,Supplier<?>)prepend(String,Object)prepend(String,Supplier<?>)set(String,Object)set(String,Supplier<?>)
Uses
VarResolver.DEFAULTto resolve variables.- Overrides:
resolvingin classHeaderList- Returns:
- This object.
-
resolving
Description copied from class:HeaderListAllows header values to contain SVL variables.Resolves variables in header values when using the following methods:
- Overrides:
resolvingin classHeaderList- Parameters:
varResolver- The variable resolver to use for resolving variables. Can benull to disable variable resolution.- Returns:
- This object.
-
set
Description copied from class:HeaderListAdds or replaces the header(s) with the same name.If no header with the same name is found the given header is added to the end of the list.
- Overrides:
setin classHeaderList- Parameters:
value- The headers to replace.null values are ignored.- Returns:
- This object.
-
set
Description copied from class:HeaderListAdds or replaces the header(s) with the same name.If no header with the same name is found the given header is added to the end of the list.
- Overrides:
setin classHeaderList- Parameters:
values- The headers to replace.null values are ignored.- Returns:
- This object.
-
set
Description copied from class:HeaderListReplaces the first occurrence of the headers with the same name.If no header with the same name is found the given header is added to the end of the list.
- Overrides:
setin classHeaderList- Parameters:
values- The headers to replace.null values are ignored.- Returns:
- This object.
-
set
Description copied from class:HeaderListReplaces the first occurrence of the headers with the same name.- Overrides:
setin classHeaderList- Parameters:
name- The header name.value- The header value.- Returns:
- This object.
-
set
Description copied from class:HeaderListReplaces the first occurrence of the headers with the same name.- Overrides:
setin classHeaderList- Parameters:
name- The header name.value- The header value.- Returns:
- This object.
-
setDefault
Description copied from class:HeaderListMakes a copy of this list of headers and adds a collection of default headers.Default headers are set if they're not already in the list.
- Overrides:
setDefaultin classHeaderList- Parameters:
headers- The list of default headers.- Returns:
- A new list, or the same list if the headers were empty.
-
setDefault
Description copied from class:HeaderListAdds a collection of default headers.Default headers are set if they're not already in the list.
- Overrides:
setDefaultin classHeaderList- Parameters:
headers- The list of default headers.- Returns:
- This object.
-
setDefault
Description copied from class:HeaderListReplaces the first occurrence of the headers with the same name.- Overrides:
setDefaultin classHeaderList- Parameters:
name- The header name.value- The header value.- Returns:
- This object.
-
setDefault
Description copied from class:HeaderListReplaces the first occurrence of the headers with the same name.- Overrides:
setDefaultin classHeaderList- Parameters:
name- The header name.value- The header value.- Returns:
- This object.
-
add
-
add
-
addAll
-
addAll
-
clear
-
remove
-
remove
-
removeAll
-
removeIf
-
replaceAll
- Specified by:
replaceAllin interfaceList<Header>- Overrides:
replaceAllin classArrayList<Header>
-
retainAll
-
set
-
sort
-
iterator
-
listIterator
- Specified by:
listIteratorin interfaceList<Header>- Overrides:
listIteratorin classArrayList<Header>
-
listIterator
- Specified by:
listIteratorin interfaceList<Header>- Overrides:
listIteratorin classArrayList<Header>
-