Class MappingSetSlotExtractor
java.lang.Object
org.incenp.obofoundry.sssom.extract.MappingSetSlotExtractor
- All Implemented Interfaces:
IValueExtractor
Extracts the value of a slot from a mapping set object.
This is the extractor used by an expression of the form
set.slot.SLOTNAME.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMappingSetSlotExtractor(Slot<MappingSet> slot, int itemNo) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionextract(MappingSet ms) Extracts the desired value from the given mapping set.Class<?> getType()Gets the type of the value that would be returned byIValueExtractor.extract(MappingSet).
-
Field Details
-
slotExtractor
-
-
Constructor Details
-
MappingSetSlotExtractor
Creates a new instance.- Parameters:
slot- The mapping set slot to extract.itemNo- The 0-based index of the value to extract. This is only meaningful ifslotrepresents a multi-valued slot. A negative value is interpreted as an 1-based index starting from the last item.
-
-
Method Details
-
extract
Description copied from interface:IValueExtractorExtracts the desired value from the given mapping set.- Specified by:
extractin interfaceIValueExtractor- Parameters:
ms- The mapping set from which to extract the value.- Returns:
- The desired value, or
nullif the set does not contain a value at the specified location.
-
getType
Description copied from interface:IValueExtractorGets the type of the value that would be returned byIValueExtractor.extract(MappingSet).- Specified by:
getTypein interfaceIValueExtractor- Returns:
- The actual Java class of the object representing the extracted value.
-