View Javadoc

1   /**
2    * Copyright 2005-2012 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krms.framework.engine;
17  
18  import java.util.Collections;
19  import java.util.Map;
20  
21  /**
22   * PropositionResults are returned by {@link Proposition}'s evaluate method.
23   * @see Proposition evaluate
24   * @author Kuali Rice Team (rice.collab@kuali.org)
25   */
26  public class PropositionResult {
27  
28  	final boolean result;
29  	Map<String,?> executionDetails;
30  
31      /**
32       * Create a PropositionResult with the given result
33       * @param result to set the result to
34       */
35  	public PropositionResult(boolean result) {
36  	    this(result, null);
37  	}
38  
39      /**
40       * Create a PropositionResult with the given values
41       * @param result to set the result to
42       * @param executionDetails to set executionDetails to
43       */
44  	public PropositionResult(boolean result, Map<String,?> executionDetails) {
45  		this.result = result;
46  		
47  		if (executionDetails == null) {
48  		    this.executionDetails = Collections.emptyMap();
49  		} else {
50  		    this.executionDetails = Collections.unmodifiableMap(executionDetails);
51  		}
52  	}
53  
54      /**
55       * Returns the result.
56       * @return the result
57       */
58  	public boolean getResult() {
59  		return result;
60  	}
61  
62      /**
63       * Returns the executionDetails
64       * @return the executionDetails
65       */
66  	public Map<String,?> getExecutionDetails() {
67  		return executionDetails;
68  	}
69  		
70  }