Package org.apache.juneau.http.part
Class HttpPartList.Unmodifiable
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<HttpPart>
org.apache.juneau.http.part.HttpPartList
org.apache.juneau.http.part.HttpPartList.Unmodifiable
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<HttpPart>,Collection<HttpPart>,List<HttpPart>,RandomAccess,UnmodifiableBean
- Enclosing class:
- HttpPartList
An unmodifiable snapshot of a
HttpPartList.
This is the "collection-mutator-override" variant of the immutability paradigm. Because HttpPartList
extends ArrayList, a single 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.part.HttpPartList
HttpPartList.Unmodifiable, HttpPartList.Void -
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection<? extends HttpPart> c) booleanaddAll(Collection<? extends HttpPart> c) Appends a part constructed from the given name and string value.Appends the given parts in order.Appends the given part.Appends the given parts in order.caseInsensitive(boolean value) Sets whether part-name comparisons are case-insensitive.voidclear()iterator()listIterator(int index) remove(int index) booleanRemoves all parts with the given name.booleanremoveAll(Collection<?> c) booleanvoidreplaceAll(UnaryOperator<HttpPart> operator) booleanretainAll(Collection<?> c) Sets a part with the given name and value, replacing any prior entry with the same name.Sets the given part, replacing any prior entry with the same name.Sets the given parts, each replacing any prior entry with the same name.setDefault(String name, String value) Sets a default part with the given name and value (first-in-chain wins per name).setDefault(HttpPart value) Sets the given part as a default.setDefault(HttpPart... values) Sets the given parts as defaults, in order.voidsort(Comparator<? super HttpPart> c) Methods inherited from class org.apache.juneau.http.part.HttpPartList
contains, copy, create, forEach, getAll, getAll, getFirst, getLast, isUnmodifiable, of, of, ofPairs, toPartArray, 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
containsAll, toStringMethods 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:HttpPartListAppends the given part.- Overrides:
appendin classHttpPartList- Parameters:
value- The part to add.nullis ignored.- Returns:
- This object.
-
append
Description copied from class:HttpPartListAppends the given parts in order.- Overrides:
appendin classHttpPartList- Parameters:
values- The parts to add.nullentries are ignored.- Returns:
- This object.
-
append
Description copied from class:HttpPartListAppends the given parts in order.- Overrides:
appendin classHttpPartList- Parameters:
values- The parts to add.nullentries are ignored.- Returns:
- This object.
-
append
Description copied from class:HttpPartListAppends a part constructed from the given name and string value.- Overrides:
appendin classHttpPartList- Parameters:
name- The part name. Must not benull .value- The part value. Can benull to omit the part from the request.- Returns:
- This object.
-
caseInsensitive
Description copied from class:HttpPartListSets whether part-name comparisons are case-insensitive. Defaults tofalse(case-sensitive).- Overrides:
caseInsensitivein classHttpPartList- Parameters:
value- New value.- Returns:
- This object.
-
removeAll
Description copied from class:HttpPartListRemoves all parts with the given name.- Overrides:
removeAllin classHttpPartList- Parameters:
name- The part name. Must not benull .- Returns:
- This object.
-
set
Description copied from class:HttpPartListSets the given part, replacing any prior entry with the same name.- Overrides:
setin classHttpPartList- Parameters:
value- The part to set.nullis ignored.- Returns:
- This object.
-
set
Description copied from class:HttpPartListSets the given parts, each replacing any prior entry with the same name.- Overrides:
setin classHttpPartList- Parameters:
values- The parts to set.nullentries are ignored.- Returns:
- This object.
-
set
Description copied from class:HttpPartListSets a part with the given name and value, replacing any prior entry with the same name.- Overrides:
setin classHttpPartList- Parameters:
name- The part name. Must not benull .value- The part value. Can benull to omit the part from the request.- Returns:
- This object.
-
setDefault
Description copied from class:HttpPartListSets the given part as a default. If a part with the same name already exists, this is a no-op (first-in-chain wins per name).- Overrides:
setDefaultin classHttpPartList- Parameters:
value- The part to set.nullis ignored.- Returns:
- This object.
-
setDefault
Description copied from class:HttpPartListSets the given parts as defaults, in order. For each, if a part with the same name already exists, the entry is skipped (first-in-chain wins per name).- Overrides:
setDefaultin classHttpPartList- Parameters:
values- The parts to set.nullentries are ignored.- Returns:
- This object.
-
setDefault
Description copied from class:HttpPartListSets a default part with the given name and value (first-in-chain wins per name).- Overrides:
setDefaultin classHttpPartList- Parameters:
name- The part name. Must not benull .value- The part value. Can benull to omit the part from the request.- Returns:
- This object.
-
add
-
add
-
addAll
-
addAll
-
clear
-
remove
-
remove
-
removeAll
-
removeIf
-
replaceAll
- Specified by:
replaceAllin interfaceList<HttpPart>- Overrides:
replaceAllin classArrayList<HttpPart>
-
retainAll
-
set
-
sort
-
iterator
-
listIterator
- Specified by:
listIteratorin interfaceList<HttpPart>- Overrides:
listIteratorin classArrayList<HttpPart>
-
listIterator
- Specified by:
listIteratorin interfaceList<HttpPart>- Overrides:
listIteratorin classArrayList<HttpPart>
-