1 /*
2  * @(#) $Id: JSTKResult.java,v 1.2 2003/07/08 08:13:52 pankaj Exp $
3  *
4  * Copyright (c) 2002-03 by Pankaj Kumar (http://www.pankaj-k.net). 
5  * All rights reserved.
6  *
7  * The license governing the use of this file can be found in the 
8  * root directory of the containing software.
9  */
10package org.jstk;
11
12import java.util.HashMap;
13
14public class JSTKResult {
15    protected Object retval;
16    protected StringBuffer desc;
17    protected boolean success;
18
19    public JSTKResult(){
20        this(null, false, "");
21    }
22
23    public JSTKResult(Object retval, boolean success, String desc){
24        this.retval = retval;
25        this.success = success;
26        this.desc = new StringBuffer();
27        this.desc.append(desc);
28    }
29
30    public Object getRetval(){
31        return retval;
32    }
33    public void setRetval(Object retval){
34        this.retval = retval;
35    }
36
37    public boolean isSuccess(){
38        return success;
39    }
40
41    public void markSuccess(){
42        success = true;
43    }
44    public void markFailure(){
45        success = false;
46    }
47
48    public String getText(){
49        return desc.toString();
50    }
51
52    public void appendText(String txt){
53        desc.append(txt);
54    }
55
56    public void setText(String txt){
57        desc = new StringBuffer(txt);
58    }
59}