Class FieldMapList

java.lang.Object
gov.nasa.pds.registry.common.util.FieldMapList
All Implemented Interfaces:
FieldMap

public class FieldMapList extends Object implements FieldMap
Implementation of FieldMap interface which stores values in a list. It preserves order and number of values in PDS label XML.
Author:
karpenko
  • Constructor Details

    • FieldMapList

      public FieldMapList()
      Constructor
  • Method Details

    • size

      public int size()
      Map size / number of fields.
      Specified by:
      size in interface FieldMap
    • isEmpty

      public boolean isEmpty()
      Check if map is empty.
      Specified by:
      isEmpty in interface FieldMap
    • clear

      public void clear()
      Remove all the fields from the map
      Specified by:
      clear in interface FieldMap
    • setValue

      public void setValue(String fieldName, String value)
      Set field's value
      Parameters:
      fieldName - field name
      value - field value
    • setValues

      public void setValues(String fieldName, List<String> values)
      Set field's value
      Parameters:
      fieldName - field name
      values - field values
    • addValue

      public void addValue(String fieldName, String value)
      Add field's value
      Specified by:
      addValue in interface FieldMap
    • addValues

      public void addValues(String fieldName, String[] values)
      Add multiple values
      Specified by:
      addValues in interface FieldMap
    • getFirstValue

      public String getFirstValue(String fieldName)
      Get first value of a field.
      Specified by:
      getFirstValue in interface FieldMap
    • getValues

      public Collection<String> getValues(String fieldName)
      Get all values of a field.
      Specified by:
      getValues in interface FieldMap
    • getNames

      public Set<String> getNames()
      Get names of all fields in this map.
      Specified by:
      getNames in interface FieldMap