Class HashExtractor

  • All Implemented Interfaces:
    IValueExtractor

    public class HashExtractor
    extends MappingValueExtractor
    Extracts the standard SSSOM hash for a mapping.

    This is used by expressions of the form mapping(N).special(hash).

    • Constructor Detail

      • HashExtractor

        public HashExtractor​(int mappingNo)
        Creates a new instance.
        Parameters:
        mappingNo - The 0-based index of the mapping from which to extract the hash, or (if negative) the 1-based index starting from the last mapping.
      • HashExtractor

        public HashExtractor​(int mappingNo,
                             HashType type)
        Creates a new instance to extract a specific type of hash.
        Parameters:
        mappingNo - The 0-based index of the mapping from which to extract the hash, or (if negative) the 1-based index starting from the last mapping.
        type - The type of hash to extract.
    • Method Detail

      • extract

        protected Object extract​(Mapping mapping)
        Description copied from class: MappingValueExtractor
        Extracts the desired value from the given mapping.
        Specified by:
        extract in class MappingValueExtractor
        Parameters:
        mapping - The mapping from which to extract the value.
        Returns:
        The desired value, or null if the mapping does not have a value at the specified location.