Class UnmodifiableEntrySet<K,V>
java.lang.Object
org.apache.commons.collections4.collection.AbstractCollectionDecorator<Map.Entry<K,V>>
org.apache.commons.collections4.set.AbstractSetDecorator<Map.Entry<K,V>>
org.apache.commons.collections4.map.UnmodifiableEntrySet<K,V>
- Type Parameters:
K
- the type of the keys in the mapV
- the type of the values in the map
- All Implemented Interfaces:
Serializable
,Iterable<Map.Entry<K,
,V>> Collection<Map.Entry<K,
,V>> Set<Map.Entry<K,
,V>> Unmodifiable
public final class UnmodifiableEntrySet<K,V>
extends AbstractSetDecorator<Map.Entry<K,V>>
implements Unmodifiable
Decorates a map entry
Set
to ensure it can't be altered.
Attempts to modify it will result in an UnsupportedOperationException.
- Since:
- 3.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
Implementation of a map entry that is unmodifiable.private class
Implementation of an entry set iterator. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
Serialization version -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
UnmodifiableEntrySet
(Set<Map.Entry<K, V>> set) Constructor that wraps (not copies). -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends Map.Entry<K, V>> coll) void
clear()
iterator()
boolean
boolean
removeAll
(Collection<?> coll) boolean
boolean
retainAll
(Collection<?> coll) Object[]
toArray()
<T> T[]
toArray
(T[] array) unmodifiableEntrySet
(Set<Map.Entry<K, V>> set) Factory method to create an unmodifiable set of Map Entry objects.Methods inherited from class org.apache.commons.collections4.set.AbstractSetDecorator
decorated, equals, hashCode
Methods inherited from class org.apache.commons.collections4.collection.AbstractCollectionDecorator
contains, containsAll, isEmpty, setCollection, size, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream
Methods inherited from interface java.util.Set
contains, containsAll, isEmpty, size, spliterator
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version- See Also:
-
-
Constructor Details
-
UnmodifiableEntrySet
Constructor that wraps (not copies).- Parameters:
set
- the set to decorate, must not be null- Throws:
NullPointerException
- if set is null
-
-
Method Details
-
unmodifiableEntrySet
Factory method to create an unmodifiable set of Map Entry objects.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
set
- the set to decorate, must not be null- Returns:
- a new unmodifiable entry set
- Throws:
NullPointerException
- if set is null- Since:
- 4.0
-
add
-
addAll
-
clear
public void clear() -
remove
-
removeIf
- Specified by:
removeIf
in interfaceCollection<K>
- Overrides:
removeIf
in classAbstractCollectionDecorator<Map.Entry<K,
V>> - Since:
- 4.4
-
removeAll
-
retainAll
-
iterator
-
toArray
-
toArray
public <T> T[] toArray(T[] array)
-