View Javadoc

1   package org.modeshape.web.jcr.rest.client.domain;
2   
3   import java.util.Collection;
4   import java.util.Collections;
5   import java.util.Map;
6   import net.jcip.annotations.Immutable;
7   
8   @Immutable
9   public class QueryRow {
10  
11      private Map<String, String> queryTypes;
12      private Map<String, Object> values;
13  
14      public QueryRow( Map<String, String> queryTypes,
15                       Map<String, Object> values ) {
16          super();
17          // queryTypes is expected to already be an unmodifiable map
18          this.queryTypes = queryTypes;
19          this.values = Collections.unmodifiableMap(values);
20      }
21  
22      public Collection<String> getColumnNames() {
23          return values.keySet();
24      }
25  
26      public Object getValue( String columnName ) {
27          return values.get(columnName);
28      }
29  
30      public String getColumnType( String columnName ) {
31          return queryTypes.get(columnName);
32      }
33  }