Package org.incenp.obofoundry.sssom
Class SetMerger
- java.lang.Object
-
- org.incenp.obofoundry.sssom.slots.SlotVisitorBase<MappingSet>
-
- org.incenp.obofoundry.sssom.SetMerger
-
- All Implemented Interfaces:
ISlotVisitor<MappingSet>
public class SetMerger extends SlotVisitorBase<MappingSet>
Helper object to merge one mapping set into another.
-
-
Constructor Summary
Constructors Constructor Description SetMerger()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EnumSet<MergeOption>getMergeOptions()Gets the options that define the behaviour of this object.voidmerge(MappingSet dst, MappingSet src)Merges one set into another, according to the current configuration.voidsetMergeOptions(EnumSet<MergeOption> options)Sets the options to configure the behaviour of this object.voidvisit(CurieMapSlot<MappingSet> slot, MappingSet src, Map<String,String> values)Visits a slot that holds a curie map.voidvisit(ExtensionDefinitionSlot<MappingSet> slot, MappingSet object, List<ExtensionDefinition> values)Visits a slot that holds a list of extension definitions for non-standard metadata.voidvisit(ExtensionSlot<MappingSet> slot, MappingSet src, Map<String,ExtensionValue> values)Visits a slot that holds extension values (non-standard metadata).voidvisit(Slot<MappingSet> slot, MappingSet src, Object value)Visits a generic slot.voidvisit(StringSlot<MappingSet> slot, MappingSet src, List<String> values)Visits a multi-valued string-typed slot.
-
-
-
Method Detail
-
setMergeOptions
public void setMergeOptions(EnumSet<MergeOption> options)
Sets the options to configure the behaviour of this object. This replaces all pre-existing options.- Parameters:
options- The new set of options.
-
getMergeOptions
public EnumSet<MergeOption> 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
public void merge(MappingSet dst, MappingSet src)
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
public void visit(Slot<MappingSet> slot, MappingSet src, Object value)
Description copied from interface:ISlotVisitorVisits 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:
visitin interfaceISlotVisitor<MappingSet>- Overrides:
visitin 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
public void visit(StringSlot<MappingSet> slot, MappingSet src, List<String> values)
Description copied from interface:ISlotVisitorVisits a multi-valued string-typed slot.- Specified by:
visitin interfaceISlotVisitor<MappingSet>- Overrides:
visitin 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(CurieMapSlot<MappingSet> slot, MappingSet src, Map<String,String> values)
Description copied from interface:ISlotVisitorVisits a slot that holds a curie map.- Specified by:
visitin interfaceISlotVisitor<MappingSet>- Overrides:
visitin 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:ISlotVisitorVisits a slot that holds extension values (non-standard metadata).- Specified by:
visitin interfaceISlotVisitor<MappingSet>- Overrides:
visitin 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:ISlotVisitorVisits a slot that holds a list of extension definitions for non-standard metadata.- Specified by:
visitin interfaceISlotVisitor<MappingSet>- Overrides:
visitin 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.
-
-