/** * Create a 'simple object' which doesn't inherit from InterMineObject and doesn't have an id. * @param c the class of object to create * @param <C> the type of the class * @return an empty simple object of the given class */ public <C extends FastPathObject> C createSimpleObject(Class<C> c) { C o = DynamicUtil.simpleCreateObject(c); return o; }
/** * Create a 'simple object' which doesn't inherit from InterMineObject and doesn't have an id. * @param c the class of object to create * @param <C> the type of the class * @return an empty simple object of the given class */ public <C extends FastPathObject> C createSimpleObject(Class<C> c) { C o = DynamicUtil.simpleCreateObject(c); return o; }
/** * Create a new object of the given class and give it a unique ID. * @param c the class * @param <C> the type of the class * @return the new InterMineObject */ public <C extends InterMineObject> C createObject(Class<C> c) { C o = DynamicUtil.simpleCreateObject(c); o.setId(new Integer(idCounter)); idCounter++; return o; }
/** * Create a new object of the given class and give it a unique ID. * @param c the class * @param <C> the type of the class * @return the new InterMineObject */ public <C extends InterMineObject> C createObject(Class<C> c) { C o = DynamicUtil.simpleCreateObject(c); o.setId(new Integer(idCounter)); idCounter++; return o; }
@Override public void setUp() throws Exception { super.setUp(); Long start = System.currentTimeMillis(); hasAddresses = testUser.createBag("has-addresses", "HasAddress", "Has-Addresses", im.getClassKeys()); Company c = DynamicUtil.simpleCreateObject(Company.class); ObjectStoreWriter osw = os.getNewWriter(); osw.store(c); osw.close(); hasAddresses.addIdToBag(c.getId(), "Company"); hasAddresses.addIdsToBag(managers, "Manager"); }
Employable x = DynamicUtil.simpleCreateObject(Employable.class); x.setName("Employable" + Character.toString((char) i)); osw.store(x);
Company comp = DynamicUtil.simpleCreateObject(Company.class); comp.setName(String.format("temp-manager-%s", c)); d.setCompany(comp);
os = new ObjectStoreDummyImpl(); wernhamHogg = DynamicUtil.simpleCreateObject(Company.class); wernhamHogg.setId(new Integer(1)); wernhamHogg.setName("Wernham-Hogg"); trudy.setAge(25); bms = DynamicUtil.simpleCreateObject(Company.class); bms.setId(new Integer(23)); bms.setName("Business Management Seminars");