Skip to content
Snippets Groups Projects
Commit 9631dce4 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Refactoring Result Object, adding namespace to result parameters

parent 30e82f86
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<netbeans.hint.license>default_1</netbeans.hint.license>
</properties>
</project-shared-configuration>
......@@ -28,8 +28,8 @@ public interface Result extends Comparable{
public Set<String> getKeys();
/* Setting and getting values */
public void setValue(String key, String value);
public String getValue(String key);
public void setValue(String namespace, String key, String value);
public String getValue(String namespace, String key);
public void setAllValues(Map<String,String> values);
public Map<String,String> getAllValues();
......
......@@ -37,15 +37,15 @@ public class ResultImpl implements Result{
}
@Override
public void setValue(String key, String value) {
public void setValue(String namespace, String key, String value) {
if(this.values == null)
this.values = new HashMap();
this.values.put(key, value);
this.values.put(namespace + "." + key, value);
}
@Override
public String getValue(String key) {
return this.values != null ? this.values.get(key) : null;
public String getValue(String namespace, String key) {
return this.values != null ? this.values.get(namespace + "." + key) : null;
}
@Override
......
/*
* Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
*
* This file is part of VIPSCommon.
* VIPSCommon is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VIPSCommon is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VIPSCommon. If not, see <http://www.gnu.org/licenses/>.
*
*/
package no.bioforsk.vips.util;
/**
* @copyright 2014 <a href="http://www.bioforsk.no/">Bioforsk</a>
* @author Tor-Einar Skog <tor-einar.skog@bioforsk.no>
*/
public class CommonNamespaces {
public final static String NS_WEATHER = "WEATHER";
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment