[PATCH] New method to add meta data to a facet

Wald Commits scm-commit at wald.intevation.org
Wed Jul 2 12:41:22 CEST 2014


# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1404296961 -7200
# Branch facet-metadata
# Node ID ab13ab6acc5c381dc5916b406841229a0bdfbeb5
# Parent  97dc9b8ae68afdd1c23a8fe4b8654f0d18153d66
New method to add meta data to a facet.

diff -r 97dc9b8ae68a -r ab13ab6acc5c artifact-database/src/main/java/org/dive4elements/artifactdatabase/state/DefaultFacet.java
--- a/artifact-database/src/main/java/org/dive4elements/artifactdatabase/state/DefaultFacet.java	Wed May 21 11:23:45 2014 +0200
+++ b/artifact-database/src/main/java/org/dive4elements/artifactdatabase/state/DefaultFacet.java	Wed Jul 02 12:29:21 2014 +0200
@@ -134,6 +134,11 @@
         return this.metaData;
     }
 
+    @Override
+    public void addMetaData(String key, String value) {
+        this.metaData.put(key, value);
+    }
+
     /**
      * (Do not) provide data.
      * Override to allow other facets to access your data.
diff -r 97dc9b8ae68a -r ab13ab6acc5c artifact-database/src/main/java/org/dive4elements/artifactdatabase/state/Facet.java
--- a/artifact-database/src/main/java/org/dive4elements/artifactdatabase/state/Facet.java	Wed May 21 11:23:45 2014 +0200
+++ b/artifact-database/src/main/java/org/dive4elements/artifactdatabase/state/Facet.java	Wed Jul 02 12:29:21 2014 +0200
@@ -79,6 +79,13 @@
      */
     Map<String, String> getMetaData(Artifact artifact, CallContext context);
 
+    /**
+     * Add a key value pair to the facets metadata.
+     *
+     * @param key   The meta data key.
+     * @param value The meta data value.
+     */
+    void addMetaData(String key, String value);
 
     /**
      * Get keys for which this Facet can provide data (for other facets, not
@@ -116,5 +123,6 @@
     Node toXML(Document doc);
 
     Facet deepCopy();
+
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :


More information about the Dive4Elements-commits mailing list