Package se.digg.dgc.valueset.v1
Class ValueSet
- java.lang.Object
-
- se.digg.dgc.valueset.v1.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 Summary
Constructors Modifier Constructor Description ValueSet()
Constructor.ValueSet(InputStream stream)
Constructor initializing the object from a stream holding the JSON representation of the value set (for example a JSON file).ValueSet(String id, LocalDate date, Map<String,ValueSetValue> values)
All-args constructor.protected
ValueSet(ValueSet valueSet)
Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
LocalDate
getDate()
Gets the value set date/version.String
getId()
Gets the value set IDValueSetValue
getValue(String code)
Given a code for a value the method gets the value set value.Map<String,ValueSetValue>
getValues()
Gets the value set values.int
hashCode()
void
setDate(LocalDate date)
Sets the value set date/version.void
setId(String id)
Sets the value set IDvoid
setValues(Map<String,ValueSetValue> values)
Sets the value set valuesString
toString()
-
-
-
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 IDdate
- the value set versionvalues
- 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
-
getValues
public Map<String,ValueSetValue> getValues()
Gets the value set values.- Returns:
- the values
-
setValues
public void setValues(Map<String,ValueSetValue> values)
Sets the value set values- Parameters:
values
- the values to set
-
-