Package org.opencms.ade.publish
Class CmsPublishRelationFinder.ResourceMap
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<CmsResource,Set<CmsResource>>
org.opencms.ade.publish.CmsPublishRelationFinder.ResourceMap
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<CmsResource,
Set<CmsResource>>
- Enclosing class:
- CmsPublishRelationFinder
public static class CmsPublishRelationFinder.ResourceMap
extends HashMap<CmsResource,Set<CmsResource>>
A map from resources to sets of resources, which automtically instantiates an empty set when accessing a key that
doesn't exist via get().
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfilter
(com.google.common.base.Predicate<CmsResource> pred) Creates a new resource map based on this instance while filtering some elements out.int
Returns the sum of all sizes of set values.Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
ResourceMap
public ResourceMap()Constructor.
-
-
Method Details
-
filter
public CmsPublishRelationFinder.ResourceMap filter(com.google.common.base.Predicate<CmsResource> pred) Creates a new resource map based on this instance while filtering some elements out.The given predicate is used to check whether any single resource should be kept. If it returns false for a top-level resource (map key), the parent will be removed and all its children added as keys. If it returns false for a map value, the value will be removed for its key.
- Parameters:
pred
- predicate to check whether resources should be kept- Returns:
- the new filtered resource map
-
get
- Specified by:
get
in interfaceMap<CmsResource,
Set<CmsResource>> - Overrides:
get
in classHashMap<CmsResource,
Set<CmsResource>> - See Also:
-
totalSize
Returns the sum of all sizes of set values.- Returns:
- the total size
-