Package org.incenp.obofoundry.sssom
Class SetMerger
- All Implemented Interfaces:
ISlotVisitor<MappingSet>
Helper object to merge one mapping set into another.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the options that define the behaviour of this object.void
merge
(MappingSet dst, MappingSet src) Merges one set into another, according to the current configuration.void
setMergeOptions
(EnumSet<MergeOption> options) Sets the options to configure the behaviour of this object.void
visit
(CurieMapSlot<MappingSet> slot, MappingSet src, Map<String, String> values) Visits a slot that holds a curie map.void
visit
(ExtensionDefinitionSlot<MappingSet> slot, MappingSet object, List<ExtensionDefinition> values) Visits a slot that holds a list of extension definitions for non-standard metadata.void
visit
(ExtensionSlot<MappingSet> slot, MappingSet src, Map<String, ExtensionValue> values) Visits a slot that holds extension values (non-standard metadata).void
visit
(Slot<MappingSet> slot, MappingSet src, Object value) Visits a generic slot.void
visit
(StringSlot<MappingSet> slot, MappingSet src, List<String> values) Visits a multi-valued string-typed slot.
-
Constructor Details
-
SetMerger
public SetMerger()
-
-
Method Details
-
setMergeOptions
Sets the options to configure the behaviour of this object. This replaces all pre-existing options.- Parameters:
options
- The new set of options.
-
getMergeOptions
Gets the options that define the behaviour of this object. The returned set may be modified to change the behaviour.- Returns:
- The set of options currently used by this object.
-
merge
Merges one set into another, according to the current configuration.- Parameters:
dst
- The destination set, in which the source set will be merged.src
- The source set to merge into the destination set.
-
visit
Description copied from interface:ISlotVisitor
Visits a generic slot.This method is normally not used as all slots in a SSSOM object have more precise types. But it can be used to implement behaviours that should be common to several slot types.
- Specified by:
visit
in interfaceISlotVisitor<MappingSet>
- Overrides:
visit
in classSlotVisitorBase<MappingSet>
- Parameters:
slot
- The slot that is being visited.src
- The object to which the slot is attached.value
- The value of the slot.
-
visit
Description copied from interface:ISlotVisitor
Visits a multi-valued string-typed slot.- Specified by:
visit
in interfaceISlotVisitor<MappingSet>
- Overrides:
visit
in classSlotVisitorBase<MappingSet>
- Parameters:
slot
- The slot that is being visited.src
- The object to which the slot is attached.values
- The values of the slot.
-
visit
Description copied from interface:ISlotVisitor
Visits a slot that holds a curie map.- Specified by:
visit
in interfaceISlotVisitor<MappingSet>
- Overrides:
visit
in classSlotVisitorBase<MappingSet>
- Parameters:
slot
- The slot that is being visited.src
- The object to which the slot is attached.values
- The value of the slot.
-
visit
public void visit(ExtensionSlot<MappingSet> slot, MappingSet src, Map<String, ExtensionValue> values) Description copied from interface:ISlotVisitor
Visits a slot that holds extension values (non-standard metadata).- Specified by:
visit
in interfaceISlotVisitor<MappingSet>
- Overrides:
visit
in classSlotVisitorBase<MappingSet>
- Parameters:
slot
- The slot that is being visited.src
- The object to which the slot is attached.values
- The values of the slot.
-
visit
public void visit(ExtensionDefinitionSlot<MappingSet> slot, MappingSet object, List<ExtensionDefinition> values) Description copied from interface:ISlotVisitor
Visits a slot that holds a list of extension definitions for non-standard metadata.- Specified by:
visit
in interfaceISlotVisitor<MappingSet>
- Overrides:
visit
in classSlotVisitorBase<MappingSet>
- Parameters:
slot
- The slot that is being visited.object
- The object to which the slot is attached.values
- The values of the slot.
-