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:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanAlways throwsUnsupportedOperationException.booleanaddAll(Collection<? extends Map.Entry<K, V>> coll) Always throwsUnsupportedOperationException.voidclear()Always throwsUnsupportedOperationException.iterator()booleanAlways throwsUnsupportedOperationException.booleanremoveAll(Collection<?> coll) Always throwsUnsupportedOperationException.booleanAlways throwsUnsupportedOperationException.booleanretainAll(Collection<?> coll) Always throwsUnsupportedOperationException.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, hashCodeMethods inherited from class org.apache.commons.collections4.collection.AbstractCollectionDecorator
contains, containsAll, isEmpty, setCollection, size, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, streamMethods inherited from interface java.util.Set
contains, containsAll, isEmpty, size, spliterator
-
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
Always throwsUnsupportedOperationException.- Specified by:
addin interfaceCollection<K>- Specified by:
addin interfaceSet<K>- Overrides:
addin classAbstractCollectionDecorator<Map.Entry<K,V>> - Parameters:
object- Ignored.- Throws:
UnsupportedOperationException- Always thrown.
-
addAll
Always throwsUnsupportedOperationException.- Specified by:
addAllin interfaceCollection<K>- Specified by:
addAllin interfaceSet<K>- Overrides:
addAllin classAbstractCollectionDecorator<Map.Entry<K,V>> - Parameters:
coll- Ignored.- Throws:
UnsupportedOperationException- Always thrown.
-
clear
Always throwsUnsupportedOperationException.- Specified by:
clearin interfaceCollection<K>- Specified by:
clearin interfaceSet<K>- Overrides:
clearin classAbstractCollectionDecorator<Map.Entry<K,V>> - Throws:
UnsupportedOperationException- Always thrown.
-
iterator
-
remove
Always throwsUnsupportedOperationException.- Specified by:
removein interfaceCollection<K>- Specified by:
removein interfaceSet<K>- Overrides:
removein classAbstractCollectionDecorator<Map.Entry<K,V>> - Parameters:
object- Ignored.- Throws:
UnsupportedOperationException- Always thrown.
-
removeAll
Always throwsUnsupportedOperationException.- Specified by:
removeAllin interfaceCollection<K>- Specified by:
removeAllin interfaceSet<K>- Overrides:
removeAllin classAbstractCollectionDecorator<Map.Entry<K,V>> - Parameters:
coll- Ignored.- Throws:
UnsupportedOperationException- Always thrown.
-
removeIf
Always throwsUnsupportedOperationException.- Specified by:
removeIfin interfaceCollection<K>- Overrides:
removeIfin classAbstractCollectionDecorator<Map.Entry<K,V>> - Parameters:
filter- Ignored.- Throws:
UnsupportedOperationException- Always thrown.- Since:
- 4.4
-
retainAll
Always throwsUnsupportedOperationException.- Specified by:
retainAllin interfaceCollection<K>- Specified by:
retainAllin interfaceSet<K>- Overrides:
retainAllin classAbstractCollectionDecorator<Map.Entry<K,V>> - Parameters:
coll- Ignored.- Throws:
UnsupportedOperationException- Always thrown.
-
toArray
-
toArray
-