View Javadoc

1   /** 2008, Digitalis Informatica. All rights reserved.
2    *
3    * Distribuicao e Gestao de Informatica, Lda.
4    * Estrada de Paco de Arcos num.9 - Piso -1
5    * 2780-666 Paco de Arcos
6    * Telefone: (351) 21 4408990
7    * Fax: (351) 21 4408999
8    * http://www.digitalis.pt
9    */
10  
11  package pt.digitalis.dif.dem.objects.parameters.rules;
12  
13  
14  /**
15   * Result of a parameter rule validation
16   *
17   * @author Pedro Viegas <a href="mailto:pviegas@digitalis.pt">pviegas@digitalis.pt</a><br/>
18   * @created Mar 31, 2009
19   */
20  public class ParameterRuleResult {
21  
22      /** The error message if the rule was not valid */
23      private String errorMessage;
24  
25      /** T if the ruke was validated successfully */
26      private boolean valid;
27  
28  
29      /**
30       * @param valid
31       */
32      public ParameterRuleResult(boolean valid)
33      {
34          this.valid = valid;
35          this.errorMessage = null;
36      }
37  
38  
39      /**
40       * @param errorMessage
41       */
42      public ParameterRuleResult(String errorMessage)
43      {
44          this.valid = false;
45          this.errorMessage = errorMessage;
46      }
47  
48  
49      /**
50       * Inspector for the 'errorMessage' attribute.
51       *
52       * @return the errorMessage value
53       */
54      public String getErrorMessage()
55      {
56          return errorMessage;
57      }
58  
59  
60      /**
61       * Inspector for the 'valid' attribute.
62       *
63       * @return the valid value
64       */
65      public boolean isValid()
66      {
67          return valid;
68      }
69  
70  
71      /**
72       * Modifier for the 'errorMessage' attribute.
73       *
74       * @param errorMessage the new errorMessage value to set
75       */
76      public void setErrorMessage(String errorMessage)
77      {
78          this.errorMessage = errorMessage;
79      }
80  
81  
82      /**
83       * Modifier for the 'valid' attribute.
84       *
85       * @param valid the new valid value to set
86       */
87      public void setValid(boolean valid)
88      {
89          this.valid = valid;
90      }
91  }