]> source.dussan.org Git - vaadin-framework.git/commitdiff
#5692 Generics: QueryContainer (with reduced exposure of internal item id type with...
authorHenri Sara <henri.sara@itmill.com>
Mon, 4 Oct 2010 12:39:27 +0000 (12:39 +0000)
committerHenri Sara <henri.sara@itmill.com>
Mon, 4 Oct 2010 12:39:27 +0000 (12:39 +0000)
svn changeset:15360/svn branch:6.5

src/com/vaadin/data/util/QueryContainer.java

index 1834568af0e2a48f9e38f008807b89bf4171de16..2b9cf2e1e1a10f1eac60e12c2bf06614a7646c6f 100644 (file)
@@ -66,9 +66,9 @@ public class QueryContainer implements Container, Container.Ordered,
 
     private ResultSet result;
 
-    private Collection propertyIds;
+    private Collection<String> propertyIds;
 
-    private final HashMap propertyTypes = new HashMap();
+    private final HashMap<String, Class<?>> propertyTypes = new HashMap<String, Class<?>>();
 
     private int size = -1;
 
@@ -129,7 +129,7 @@ public class QueryContainer implements Container, Container.Ordered,
         ResultSetMetaData metadata;
         metadata = result.getMetaData();
         final int count = metadata.getColumnCount();
-        final ArrayList list = new ArrayList(count);
+        final ArrayList<String> list = new ArrayList<String>(count);
         for (int i = 1; i <= count; i++) {
             final String columnName = metadata.getColumnName(i);
             list.add(columnName);
@@ -194,7 +194,7 @@ public class QueryContainer implements Container, Container.Ordered,
      * @return Collection of Property ID.
      */
 
-    public Collection getContainerPropertyIds() {
+    public Collection<String> getContainerPropertyIds() {
         return propertyIds;
     }
 
@@ -203,8 +203,8 @@ public class QueryContainer implements Container, Container.Ordered,
      * 
      * @return collection of Item IDs
      */
-    public Collection getItemIds() {
-        final Collection c = new ArrayList(size);
+    public Collection<?> getItemIds() {
+        final Collection<Integer> c = new ArrayList<Integer>(size);
         for (int i = 1; i <= size; i++) {
             c.add(new Integer(i));
         }
@@ -252,8 +252,8 @@ public class QueryContainer implements Container, Container.Ordered,
      * @return data type of the Properties
      */
 
-    public Class getType(Object id) {
-        return (Class) propertyTypes.get(id);
+    public Class<?> getType(Object id) {
+        return propertyTypes.get(id);
     }
 
     /**
@@ -538,7 +538,7 @@ public class QueryContainer implements Container, Container.Ordered,
          * @return unmodifiable collection containing IDs of the Properties
          *         stored the Item.
          */
-        public Collection getItemPropertyIds() {
+        public Collection<String> getItemPropertyIds() {
             return propertyIds;
         }