Class MetacardServices
java.lang.Object
org.codice.ddf.catalog.plugin.metacard.util.MetacardServices
Support and bulk operations for
Metacards. Contains state relevant to the provided
services.-
Constructor Summary
ConstructorsConstructorDescriptionInitializes the services with an empty list of systemMetacardTypes.MetacardServices(List<ddf.catalog.data.MetacardType> systemMetacardTypes) Initializes the services with the provided list ofMetacardTypes. -
Method Summary
Modifier and TypeMethodDescriptionList<ddf.catalog.data.Metacard>setAttributesIfAbsent(List<ddf.catalog.data.Metacard> metacards, Map<String, String> attributeMap, AttributeFactory attributeFactory) Returns a new list of newMetacards created from the collection and applies each attribute in the only if the attribute is not already set on theMetacard.
-
Constructor Details
-
MetacardServices
public MetacardServices()Initializes the services with an empty list of systemMetacardTypes. -
MetacardServices
Initializes the services with the provided list ofMetacardTypes.- Parameters:
systemMetacardTypes- The list of metacard types to use.
-
-
Method Details
-
setAttributesIfAbsent
public List<ddf.catalog.data.Metacard> setAttributesIfAbsent(List<ddf.catalog.data.Metacard> metacards, Map<String, String> attributeMap, AttributeFactory attributeFactory) Returns a new list of newMetacards created from the collection and applies each attribute in the only if the attribute is not already set on theMetacard. That is, the attribute must benullor not in theMetacard's map. AppropriateAttributeDescriptors are injected into a newMetacardTypefor each newMetacardcreated.- Parameters:
metacards- The list of metacards to attempt to add the attributes to. Can be empty.attributeMap- The map of attributes to attempt to add. Attributes already set on any givenMetacardwill not be changed. For multi-valued attributes, the value string should separate different entities with commas.attributeFactory- The factory to use to create attributes.
-