Class ValueSet

  • Direct Known Subclasses:
    ReloadableValueSet

    public class ValueSet
    extends Object
    Representation of a value set.
    Author:
    Martin Lindström (martin@idsec.se), Henrik Bengtsson (extern.henrik.bengtsson@digg.se), Henric Norlander (extern.henric.norlander@digg.se)
    • Constructor Detail

      • ValueSet

        public ValueSet()
        Constructor.
      • ValueSet

        public ValueSet​(String id,
                        LocalDate date,
                        Map<String,​ValueSetValue> values)
        All-args constructor.
        Parameters:
        id - the value set ID
        date - the value set version
        values - the value set values
      • ValueSet

        public ValueSet​(InputStream stream)
                 throws IOException
        Constructor initializing the object from a stream holding the JSON representation of the value set (for example a JSON file).
        Parameters:
        stream - the input stream
        Throws:
        IOException - for JSON parsing errors
      • ValueSet

        protected ValueSet​(ValueSet valueSet)
        Copy constructor.
        Parameters:
        valueSet - the value set to copy from
    • Method Detail

      • getValue

        public ValueSetValue getValue​(String code)
        Given a code for a value the method gets the value set value.
        Parameters:
        code - the code
        Returns:
        the value or null if it is not found
      • getId

        public String getId()
        Gets the value set ID
        Returns:
        the ID
      • setId

        public void setId​(String id)
        Sets the value set ID
        Parameters:
        id - the ID
      • getDate

        public LocalDate getDate()
        Gets the value set date/version.
        Returns:
        the date/version
      • setDate

        public void setDate​(LocalDate date)
        Sets the value set date/version.
        Parameters:
        date - the date/version
      • setValues

        public void setValues​(Map<String,​ValueSetValue> values)
        Sets the value set values
        Parameters:
        values - the values to set
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object