@Test public void testSetObjectMap() { Map<Object, CyNetwork> netMap = new HashMap<Object, CyNetwork>(); CyNetwork net1 = mock(CyNetwork.class); netMap.put("A", net1); CyNetwork net2 = mock(CyNetwork.class); netMap.put("B", net2); Map<Object, CyNetworkView> viewMap = new HashMap<Object, CyNetworkView>(); CyNetworkView view1 = mock(CyNetworkView.class); viewMap.put("A", view1); Map<Object, CyNode> nodeMap = new HashMap<Object, CyNode>(); CyNode n1 = mock(CyNode.class); nodeMap.put(new Long(1), n1); CyNode n2 = mock(CyNode.class); nodeMap.put(new Long(2), n2); Map<Object, CyEdge> edgeMap = new HashMap<Object, CyEdge>(); CyEdge e1 = mock(CyEdge.class); edgeMap.put(new Long(3), e1); Map<Class<? extends CyIdentifiable>, Map<Object, ? extends CyIdentifiable>> objMap = new HashMap<Class<? extends CyIdentifiable>, Map<Object, ? extends CyIdentifiable>>(); objMap.put(CyNetwork.class, netMap); objMap.put(CyNetworkView.class, viewMap); objMap.put(CyNode.class, nodeMap); objMap.put(CyEdge.class, edgeMap); session = new CySession.Builder().objectMap(objMap).build(); assertNotNull(session); assertSame(net1, session.getObject("A", CyNetwork.class)); assertSame(net2, session.getObject("B", CyNetwork.class)); assertSame(view1, session.getObject("A", CyNetworkView.class)); assertSame(n1, session.getObject(new Long(1), CyNode.class)); assertSame(n2, session.getObject(new Long(2), CyNode.class)); assertSame(e1, session.getObject(new Long(3), CyEdge.class)); assertNull(session.getObject("A", View.class)); assertNull(session.getObject("B", CyNetworkView.class)); }
public <T extends CyIdentifiable> T getObject(Long oldSUID, Class<T> type) { return getObjectInternal(oldSUID, type); }
CySession { public <T extends CyIdentifiable> T getObject(Long oldSUID, Class<T> type) { return getObjectInternal(oldSUID, type); } }
CySession { public <T extends CyIdentifiable> T getObject(Long oldSUID, Class<T> type) { return getObjectInternal(oldSUID, type); } private  CySession(Builder b); }
CySession { public <T extends CyIdentifiable> T getObject(Long oldSUID, Class<T> type) { return getObjectInternal(oldSUID, type); } private  CySession(Builder b); Set<CyNetwork> getNetworks(); Set<CyNetworkView> getNetworkViews(); Set<CyTableMetadata> getTables(); Map<CyNetworkView, String> getViewVisualStyleMap(); Set<CyProperty<?>> getProperties(); Set<VisualStyle> getVisualStyles(); Map<String, List<File>> getAppFileListMap(); T getObject(Long oldSUID, Class<T> type); T getObject(String oldId, Class<T> type); }
CySession { public <T extends CyIdentifiable> T getObject(Long oldSUID, Class<T> type) { return getObjectInternal(oldSUID, type); } private  CySession(Builder b); Set<CyNetwork> getNetworks(); Set<CyNetworkView> getNetworkViews(); Set<CyTableMetadata> getTables(); Map<CyNetworkView, String> getViewVisualStyleMap(); Set<CyProperty<?>> getProperties(); Set<VisualStyle> getVisualStyles(); Map<String, List<File>> getAppFileListMap(); T getObject(Long oldSUID, Class<T> type); T getObject(String oldId, Class<T> type);  }