]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
IAdaptable interface / Class is parameterised 33/3033/1
authorMarko Luukkainen <marko.luukkainen@semantum.fi>
Thu, 18 Jul 2019 14:55:34 +0000 (17:55 +0300)
committerMarko Luukkainen <marko.luukkainen@semantum.fi>
Thu, 18 Jul 2019 14:55:34 +0000 (17:55 +0300)
gitlab #16

Change-Id: I4f8c25790d3d0dc39726efda82abe8734552e0d1

org.simantics.plant3d/src/org/simantics/plant3d/geometry/BuiltinGeometryProvider.java
org.simantics.plant3d/src/org/simantics/plant3d/geometry/BuiltinMeshProvider.java

index 5250cc9eef48f4a2166d4aa46ffd820c7dc8615f..25630e184ff4d7879324955886990a492fa27f48 100644 (file)
@@ -14,10 +14,11 @@ public abstract class BuiltinGeometryProvider implements ParametricSolidModelPro
                this.resource = resource;
        }
        
                this.resource = resource;
        }
        
+       @SuppressWarnings("unchecked")
        @Override
        @Override
-       public Object getAdapter(Class adapter) {
+       public <T> T getAdapter(Class<T> adapter) {
                if (Resource.class == adapter)
                if (Resource.class == adapter)
-                       return resource;
+                       return (T)resource;
                return null;
        }
        
                return null;
        }
        
index ccfb52817bb83a8278b6e530902398c629e9ba2c..64ba4aa7cccf5518f7fc07f1b7f66fd32516749d 100644 (file)
@@ -14,10 +14,11 @@ public abstract class BuiltinMeshProvider implements ParametricMeshProvider, IAd
                this.resource = resource;
        }
        
                this.resource = resource;
        }
        
+       @SuppressWarnings("unchecked")
        @Override
        @Override
-       public Object getAdapter(Class adapter) {
+       public <T> T getAdapter(Class<T> adapter) {
                if (Resource.class == adapter)
                if (Resource.class == adapter)
-                       return resource;
+                       return (T)resource;
                return null;
        }
        
                return null;
        }