View Javadoc

1   package org.paneris.jal.model;
2   
3   /**
4    * <p> A LookupItem simply holds a name value pair.</p>
5    * <p> It is constructed by passing a DDRecord and a fieldname that will be used to set the value
6    **/
7   
8   public class LookupItem {
9   
10      private String id;
11      private String value;
12  
13  
14      /**
15       * Constructor to build Lookup Item given a DDRecord and a string describing the field
16       *
17       * @param rec       a DDRecord
18       * @param field     the field to use for lookup
19       */
20      public LookupItem(DDRecord rec, String field) {
21          id = rec.getFieldValue("id");
22          value = rec.getFieldValue(field);
23      }
24  
25      /**
26       * Constructor to build Lookup Item given an id and a value
27       *
28       * @param id        an id
29       * @param value     the value
30       */
31      public LookupItem(String id, String value) {
32          this.id = id;
33          this.value = value;
34      }
35  
36      public String getId() {
37          return id;
38      }
39  
40      public String getValue() {
41          return value;
42      }
43  }
44