KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > common > command > result > SimpleResult


1 /***************************************
2  * *
3  * Nukes: The OpenSource CMS *
4  * *
5  * Distributable under GPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  ***************************************/

9 package org.jboss.portal.common.command.result;
10
11 import java.util.HashMap JavaDoc;
12 import java.util.Map JavaDoc;
13
14 /**
15  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
16  * @version $Revision: 1.2 $
17  */

18 public class SimpleResult
19    implements Result
20 {
21
22    private ResultType type;
23    private Map JavaDoc values;
24
25    public SimpleResult(ResultType type)
26    {
27       this.type = type;
28       this.values = null;
29    }
30
31    public void put(String JavaDoc key, Object JavaDoc value)
32    {
33       if (values == null)
34       {
35          values = new HashMap JavaDoc();
36       }
37       values.put(key, value);
38    }
39
40    public Object JavaDoc get(String JavaDoc key)
41    {
42       return values != null ? values.get(key) : null;
43    }
44
45    public ResultType getType()
46    {
47       return type;
48    }
49 }
50
Popular Tags