View Javadoc

1   /**
2    * 2008, Digitalis Informatica. All rights reserved.
3    *
4    * Distribuicao e Gestao de Informatica, Lda. Estrada de Paco de Arcos num.9 - Piso -1 2780-666 Paco de Arcos Telefone:
5    * (351) 21 4408990 Fax: (351) 21 4408999 http://www.digitalis.pt
6    */
7   
8   package pt.digitalis.dif.dem.objects.parameters.constraints;
9   
10  import java.util.ArrayList;
11  import java.util.List;
12  
13  /**
14   * @author Luis Pinto <a href="mailto:lpinto@digitalis.pt">lpinto@digitalis.pt</a><br/>
15   * @created Mar 31, 2010
16   */
17  public class ParameterConstraintResult {
18  
19      /** The constraint that created the result */
20      private IParameterConstraint constraint;
21  
22      /** The constraint error IDs */
23      private List<String> errorIDs = new ArrayList<String>();
24  
25      /** The language used to serve the constraint messages */
26      private String language;
27  
28      /** The constraint validation result */
29      private boolean valid;
30  
31      /**
32       * Constructor
33       *
34       * @param constraint
35       *            The constraint that created the result
36       * @param result
37       *            The constraint validation result
38       * @param errorIDs
39       *            The constraint error IDs
40       * @param language
41       *            The language used to serve the constraint messages
42       */
43      public ParameterConstraintResult(IParameterConstraint constraint, boolean result, List<String> errorIDs,
44              String language)
45      {
46          this.constraint = constraint;
47          this.valid = result;
48          this.errorIDs = errorIDs;
49          this.language = language;
50      }
51  
52      /**
53       * Constructor
54       *
55       * @param constraint
56       *            The constraint that created the result
57       * @param valid
58       *            The constraint validation result
59       * @param language
60       *            The language used to serve the constraint messages
61       */
62      public ParameterConstraintResult(IParameterConstraint constraint, boolean valid, String language)
63      {
64          this.constraint = constraint;
65          this.valid = valid;
66          this.language = language;
67      }
68  
69      /**
70       * Inspector for the 'constraint' attribute.
71       *
72       * @return the constraint value
73       */
74      public IParameterConstraint getConstraint()
75      {
76          return constraint;
77      }
78  
79      /**
80       * Inspector for the 'errorIDs' attribute.
81       *
82       * @return the errorIDs value
83       */
84      public List<String> getErrorIDs()
85      {
86          return errorIDs;
87      }
88  
89      /**
90       * Inspector for the 'language' attribute.
91       *
92       * @return the language value
93       */
94      public String getLanguage()
95      {
96          return language;
97      }
98  
99      /**
100      * Inspector for the 'result' attribute.
101      *
102      * @return the result value
103      */
104     public boolean isValid()
105     {
106         return valid;
107     }
108 
109     /**
110      * Modifier for the 'errorIDs' attribute.
111      *
112      * @param errorIDs
113      *            the new errorIDs value to set
114      */
115     public void setErrorIDs(List<String> errorIDs)
116     {
117         this.errorIDs = errorIDs;
118     }
119 
120 
121     /**
122      * Modifier for the 'result' attribute.
123      *
124      * @param result
125      *            the new result value to set
126      */
127     public void setResult(boolean result)
128     {
129         this.valid = result;
130     }
131 
132 }