Class ImportRecord

java.lang.Object
org.dspace.importer.external.datamodel.ImportRecord

public class ImportRecord extends Object
This class contains all MetadatumDTO objects from an imported item
Author:
Roeland Dillen (roeland at atmire dot com)
  • Constructor Details

    • ImportRecord

      public ImportRecord(List<MetadatumDTO> valueList)
      Create an ImportRecord instance initialized with a List of MetadatumDTO objects
      Parameters:
      valueList - list of metadata values
  • Method Details

    • getValueList

      public List<MetadatumDTO> getValueList()
      Retrieve an unmodifiableList of MetadatumDTO
      Returns:
      List of MetadatumDTO
    • toString

      public String toString()
      Build a string based on the values in the valueList object The syntax will be Record{valueList={"schema"; "element" ; "qualifier"; "value"}}
      Overrides:
      toString in class Object
      Returns:
      a concatenated string containing all values of the MetadatumDTO objects in valueList
    • getValue

      public Collection<MetadatumDTO> getValue(String schema, String element, String qualifier)
      Return the MetadatumDTO's that are related to a given schema/element/qualifier pair/triplet
      Parameters:
      schema - metadata field schema
      element - metadata field element
      qualifier - metadata field qualifier
      Returns:
      the MetadatumDTO's that are related to a given schema/element/qualifier pair/triplet
    • getSingleValue

      public Optional<String> getSingleValue(String field)
      Returns an Optional<String> representing the value of the metadata field found inside the valueList.
      Parameters:
      field - String of the MetadataField to search
      Returns:
      Optional<String> non empty if found.
    • getSingleValue

      public Optional<String> getSingleValue(String schema, String element, String qualifier)
      Retrieves a single value for the given schema, element, and qualifier.
      Parameters:
      schema - the schema for the value
      element - the element for the value
      qualifier - the qualifier for the value
      Returns:
      an optional containing the single value, if present
    • addValue

      public void addValue(MetadatumDTO value)
      Add a value to the valueList
      Parameters:
      value - The MetadatumDTO to add to the valueList