Update Metadata.java (#704)

Fixes #699 

Signed-off-by: David Gräff <david.graeff@web.de>
This commit is contained in:
David Gräff 2019-04-08 21:07:33 +02:00 committed by Markus Rathgeb
parent 02208f487a
commit 7838a6a46f

View File

@ -25,7 +25,7 @@ import org.eclipse.smarthome.core.common.registry.Identifiable;
* This is a data class for storing meta-data for a given item and namespace.
* It is the entity used for within the {@link MetadataRegistry}.
*
* @author Kai Kreuzer - Initial contribution and API
* @author Kai Kreuzer - Initial contribution
*
*/
@NonNullByDefault
@ -35,6 +35,17 @@ public final class Metadata implements Identifiable<MetadataKey> {
private final String value;
private final Map<String, Object> configuration;
/**
* Package protected default constructor to allow reflective instantiation.
*
* !!! DO NOT REMOVE - Gson needs it !!!
*/
Metadata() {
key = new MetadataKey("", "");
value = "";
configuration = Collections.emptyMap();
}
public Metadata(MetadataKey key, String value, @Nullable Map<String, Object> configuration) {
this.key = key;
this.value = value;