Returns a lazy
Collection view of the values contained in this map.
A LazyCollection is optimized for querying speed (preventing eager deserialization
and hashing on HashSet insertion) and does
NOT provide all operations.
Any kind of mutating function will throw an
java.lang.UnsupportedOperationException. Same is true for operations
like
java.util.Collection#contains(Object) and
java.util.Collection#containsAll(java.util.Collection), which would result in
very poor performance if called repeatedly (for example, in a loop). If the use
case is different from querying the data, please copy the resulting set into a
new
java.util.List or similar data structure.
ReplicatedMap<K, V> repMap = ...;
// Returns a LazyCollection
Collection<V> values = repMap.values();
List<V> copy = new ArrayList<V>(values);
if (copy.containsAll(possibleValues)) {
// ...
}
Due to the lazy nature of the returned set, changes to the map (addition,
removal, update) might be reflected on the collection.
Changes on the map are
NOT reflected on the collection on the
CLIENT or vice versa.
The order of the elements is not guaranteed due to the internal
asynchronous replication behavior. If a specific order is needed, use
#values(java.util.Comparator) to force reordering of the
elements before returning.
Changes to any returned object are
NOT replicated back to other
members.