Class PartList.Unmodifiable
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<NameValuePair>,Collection<NameValuePair>,List<NameValuePair>,RandomAccess,UnmodifiableBean
- Enclosing class:
- PartList
PartList.
This is the "collection-mutator-override" variant of the immutability paradigm. Because PartList
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.part.PartList
PartList.Unmodifiable, PartList.Void -
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int index, NameValuePair element) booleanadd(NameValuePair e) booleanaddAll(int index, Collection<? extends NameValuePair> c) booleanaddAll(Collection<? extends NameValuePair> c) Appends the specified part to the end of this list.Appends the specified part to the end of this list using a value supplier.append(List<NameValuePair> values) Adds the specified parts to the end of the parts in this list.append(NameValuePair value) Adds the specified part to the end of the parts in this list.append(NameValuePair... values) Adds the specified parts to the end of the parts in this list.caseInsensitive(boolean value) Specifies that the parts in this list should be treated as case-sensitive.voidclear()iterator()listIterator(int index) Appends the specified part to the beginning of this list.Appends the specified part to the beginning of this list using a value supplier.prepend(List<NameValuePair> values) Adds the specified parts to the beginning of the parts in this list.prepend(NameValuePair value) Adds the specified part to the beginning of the parts in this list.prepend(NameValuePair... values) Adds the specified parts to the beginning of the parts in this list.remove(int index) booleanRemoves the part with the specified name from this list.Removes the part with the specified name from this list.remove(List<NameValuePair> values) Removes the specified parts from this list.remove(NameValuePair value) Removes the specified part from this list.remove(NameValuePair... values) Removes the specified parts from this list.booleanremoveAll(Collection<?> c) booleanremoveIf(Predicate<? super NameValuePair> filter) voidreplaceAll(UnaryOperator<NameValuePair> operator) Allows part values to contain SVL variables.resolving(VarResolver varResolver) Allows part values to contain SVL variables.booleanretainAll(Collection<?> c) set(int index, NameValuePair element) Replaces the first occurrence of the parts with the same name.Replaces the first occurrence of the parts with the same name.set(List<NameValuePair> values) Replaces the first occurrence of the parts with the same name.set(NameValuePair value) Adds or replaces the part(s) with the same name.set(NameValuePair... values) Adds or replaces the part(s) with the same name.setDefault(String name, Object value) Replaces the first occurrence of the part with the same name.setDefault(String name, Supplier<?> value) Replaces the first occurrence of the headers with the same name.setDefault(List<NameValuePair> parts) Adds a collection of default parts.setDefault(NameValuePair... parts) Makes a copy of this list of parts and adds a collection of default parts.voidsort(Comparator<? super NameValuePair> c) Methods inherited from class org.apache.juneau.http.classic.part.PartList
contains, copy, create, forEach, forEach, forEachValue, forEachValue, get, get, get, getAll, getAll, getFirst, getLast, getValues, isUnmodifiable, of, of, ofPairs, partIterator, partIterator, 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:PartListAdds the specified parts to the end of the parts in this list. -
append
Description copied from class:PartListAdds the specified part to the end of the parts in this list. -
append
Description copied from class:PartListAdds the specified parts to the end of the parts in this list. -
append
Description copied from class:PartListAppends the specified part to the end of this list.The part is added as a
BasicPart. -
append
Description copied from class:PartListAppends the specified part to the end of this list using a value supplier.The part is added as a
BasicPart.Value is re-evaluated on each call to
BasicPart.getValue(). -
caseInsensitive
Description copied from class:PartListSpecifies that the parts in this list should be treated as case-sensitive.The default behavior is case-sensitive.
- Overrides:
caseInsensitivein classPartList- Parameters:
value- The new value for this setting.- Returns:
- This object.
-
prepend
Description copied from class:PartListAdds the specified parts to the beginning of the parts in this list. -
prepend
Description copied from class:PartListAdds the specified part to the beginning of the parts in this list. -
prepend
Description copied from class:PartListAdds the specified parts to the beginning of the parts in this list. -
prepend
Description copied from class:PartListAppends the specified part to the beginning of this list.The part is added as a
BasicPart. -
prepend
Description copied from class:PartListAppends the specified part to the beginning of this list using a value supplier.The part is added as a
BasicPart.Value is re-evaluated on each call to
BasicPart.getValue(). -
remove
Description copied from class:PartListRemoves the specified parts from this list. -
remove
Description copied from class:PartListRemoves the specified part from this list. -
remove
Description copied from class:PartListRemoves the specified parts from this list. -
remove
Description copied from class:PartListRemoves the part with the specified name from this list. -
remove
Description copied from class:PartListRemoves the part with the specified name from this list. -
resolving
Description copied from class:PartListAllows part values to contain SVL variables.Resolves variables in part 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. -
resolving
Description copied from class:PartListAllows part values to contain SVL variables.Resolves variables in part values when using the following methods:
-
set
Description copied from class:PartListReplaces the first occurrence of the parts with the same name.If no part with the same name is found the given part is added to the end of the list.
-
set
Description copied from class:PartListAdds or replaces the part(s) with the same name.If no part with the same name is found the given part is added to the end of the list.
-
set
Description copied from class:PartListAdds or replaces the part(s) with the same name.If no part with the same name is found the given part is added to the end of the list.
-
set
Description copied from class:PartListReplaces the first occurrence of the parts with the same name. -
set
Description copied from class:PartListReplaces the first occurrence of the parts with the same name. -
setDefault
Description copied from class:PartListAdds a collection of default parts.Default parts are set if they're not already in the list.
- Overrides:
setDefaultin classPartList- Parameters:
parts- The list of default parts.- Returns:
- This object.
-
setDefault
Description copied from class:PartListMakes a copy of this list of parts and adds a collection of default parts.Default parts are set if they're not already in the list.
- Overrides:
setDefaultin classPartList- Parameters:
parts- The list of default parts.- Returns:
- A new list, or the same list if the parts were empty.
-
setDefault
Description copied from class:PartListReplaces the first occurrence of the part with the same name.- Overrides:
setDefaultin classPartList- Parameters:
name- The header name.value- The header value.- Returns:
- This object.
-
setDefault
Description copied from class:PartListReplaces the first occurrence of the headers with the same name.- Overrides:
setDefaultin classPartList- Parameters:
name- The header name.value- The header value.- Returns:
- This object.
-
add
- Specified by:
addin interfaceCollection<NameValuePair>- Specified by:
addin interfaceList<NameValuePair>- Overrides:
addin classArrayList<NameValuePair>
-
add
- Specified by:
addin interfaceList<NameValuePair>- Overrides:
addin classArrayList<NameValuePair>
-
addAll
- Specified by:
addAllin interfaceCollection<NameValuePair>- Specified by:
addAllin interfaceList<NameValuePair>- Overrides:
addAllin classArrayList<NameValuePair>
-
addAll
- Specified by:
addAllin interfaceList<NameValuePair>- Overrides:
addAllin classArrayList<NameValuePair>
-
clear
- Specified by:
clearin interfaceCollection<NameValuePair>- Specified by:
clearin interfaceList<NameValuePair>- Overrides:
clearin classArrayList<NameValuePair>
-
remove
- Specified by:
removein interfaceCollection<NameValuePair>- Specified by:
removein interfaceList<NameValuePair>- Overrides:
removein classArrayList<NameValuePair>
-
remove
- Specified by:
removein interfaceList<NameValuePair>- Overrides:
removein classArrayList<NameValuePair>
-
removeAll
- Specified by:
removeAllin interfaceCollection<NameValuePair>- Specified by:
removeAllin interfaceList<NameValuePair>- Overrides:
removeAllin classArrayList<NameValuePair>
-
removeIf
- Specified by:
removeIfin interfaceCollection<NameValuePair>- Overrides:
removeIfin classArrayList<NameValuePair>
-
replaceAll
- Specified by:
replaceAllin interfaceList<NameValuePair>- Overrides:
replaceAllin classArrayList<NameValuePair>
-
retainAll
- Specified by:
retainAllin interfaceCollection<NameValuePair>- Specified by:
retainAllin interfaceList<NameValuePair>- Overrides:
retainAllin classArrayList<NameValuePair>
-
set
- Specified by:
setin interfaceList<NameValuePair>- Overrides:
setin classArrayList<NameValuePair>
-
sort
- Specified by:
sortin interfaceList<NameValuePair>- Overrides:
sortin classArrayList<NameValuePair>
-
iterator
- Specified by:
iteratorin interfaceCollection<NameValuePair>- Specified by:
iteratorin interfaceIterable<NameValuePair>- Specified by:
iteratorin interfaceList<NameValuePair>- Overrides:
iteratorin classArrayList<NameValuePair>
-
listIterator
- Specified by:
listIteratorin interfaceList<NameValuePair>- Overrides:
listIteratorin classArrayList<NameValuePair>
-
listIterator
- Specified by:
listIteratorin interfaceList<NameValuePair>- Overrides:
listIteratorin classArrayList<NameValuePair>
-