public class Main { public static void main(String[] args) { EntityManagerFactory emf = Persistence.createEntityManagerFactory("wifi-dbPU"); DeviceJpaController deviceController = new DeviceJpaController(emf); NetworkInterfaceJpaController netController = new NetworkInterfaceJpaController(emf); Device device = new Device("laptop"); // 1 deviceController.create(device); // 2 NetworkInterface net = new NetworkInterface("eth0"); // 3 net.setDeviceId(device.getId()); // 4 netController.create(net); // 5 // The parent collection is updated by the above create } }
function Device(param1, param2) { var private_1= param1; var private_2= param2; this.func_1= function() { return private_1; } this.func_2= function() { return private_2; } } var myDevice = new Device(1, 2); alert(myob.func_1());
samsunSxYZ() { Device device = new Device() device.addFunction(new SamsungDvdStandard()) device.addFunction(new SamsungCdStandard()) return device; } samsunSabc() { Device device = new Device() device.addFunction(new SamsungDvdStandard()) device.addFunction(new SamsungCdSpecialAbc()) return device; }
Device device = new Device("laptop"); getEntityManager().persist(device);
Device device = new Device() ; Mockito.when(deviceDao.save(device)).thenReturn(deviceEntity);
Device device = new Device(); Cursor cursor = mdb.get(device); SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_2, cursor, new String[] { device.mDescription.mName, device.mDeviceID.mName }, new int[] { android.R.id.text1, android.R.id.text2 }, 0); // Create Cursor and set to List mDeviceListView.setAdapter(adapter);
public class UtilClass { public static List<Device> createDevices(){ List<Device> result = new ArrayList<Device>(); byte[] unused = new byte[128]; bb.get(unused); // this will return the 128 first bytes. ByteBuffer // position is 129 while (bb.hasRemaining()) { byte[] code = new byte[8]; // 8 byte for 1 code bb.get(code); // now code in set with the 8 next bytes 129-136 ; Device device = new Device(code); // set Directly the code with the constructor devices.add(device); } return result; }
public String show(){ Device device = new Device() ; device.setContactName("abc"); Device deviceEntity = deviceDao.save(device); System.out.println(deviceEntity); // i get this null always Why ??? return "demo"; }
@Rollback(false) @Test public void testGetDeviceListItemList() { Device device = new Device(); this.sessionFactory.getCurrentSession().merge(device); Query myQuery = this.sessionFactory.getCurrentSession().createQuery("from DeviceListItem"); List<DeviceListItem> allDeviceListItems = myQuery.list(); assertTrue(allDeviceListItems.get(0).getId().equals(device.getId()); this.sessionFactory.getCurrentSession().delete(device); }
ByteBuffer bb = ByteBuffer.allocate(65535); // 65535 is for example, In your code ByteBuffer need to be return by ReadConfigFile.importConfigFile(); List<Device> devices = new ArrayList<Device>(); byte[] unused = new byte[128]; bb.get(unused); // this will return the 128 first bytes. ByteBuffer // position is 129 while (bb.hasRemaining()) { // Make a check to Verify that bb have at least 8 bytes, if not, last code can be corrupted => if you need it byte[] code = new byte[8]; // 8 byte for 1 code bb.get(code); // now code in set with the 8 next bytes 129-136 ; Device device = new Device(code); // set Directly the code with the constructor devices.add(device); }
id = 0; subscription = ""; grupo = new Group(); dispositivo = new Device();
Device device = new Device(this); device.validateLogin();
public void addDevice(String name, int port){ Device temp = new Device(); temp.setPort(port); temp.setName(name); allDevices.put(""+lastId,temp); <-- Note that lastId is an integer this.lastId++; Global.dbMRoot.child("devicesController").child("devices").child(""+lastId).setValue(allDevices.get(lastId)); }
Device device = new Device("laptop"); NetworkInterface net = new NetworkInterface("eth0"); device.getNetworkInterfaceCollection().add(net); deviceController.create(device);
public void testPost() { RestTemplate restTemplate = new RestTemplate(); Strategy strategy = new AnnotationStrategy(); Serializer serializer = new Persister(strategy); restTemplate.getMessageConverters().add(new SimpleXmlHttpMessageConverter(serializer)); restTemplate.getMessageConverters().add(new StringHttpMessageConverter()); Device device = new Device(); device.setImageRef(new byte[]{1,2,3,4,5}); String response = restTemplate.postForObject("http://10.0.0.3:8080/rest/mydata/testpost", device, String.class); assertNotNull(response); }
public class Main { public static void main(final String[] args) { Device device = new Device(); HelloMessageHandler helloMessageHandler = new HelloMessageHandler(); device.registerHandler(MessageType.HELLO.class, helloMessageHandler); HelloMessage helloMessage = new HelloMessage("abhinav"); HelloResponse helloResponse = device.send(helloMessage); System.out.println(helloResponse.getGreeting()); } }
public MoveSCU() { this.device = new Device("movescu"); this.device.addConnection(conn); this.device.addApplicationEntity(ae); ae.addConnection(conn); }
public void createNetworkAE() throws ConfigurationException { Device device = new Device(deviceName != null ? deviceName : aeTitle.toLowerCase()); device.setDescription(deviceDesc); if (deviceType != null) { device.setPrimaryDeviceTypes(deviceType); } device.addConnection(conn); ApplicationEntity ae = new ApplicationEntity(aeTitle); device.addApplicationEntity(ae); ae.setDescription(aeDesc); ae.addConnection(conn); conf.persist(device, EnumSet.of(DicomConfiguration.Option.REGISTER)); }
public void createNetworkAE() throws ConfigurationException { Device device = new Device(deviceName != null ? deviceName : aeTitle.toLowerCase()); device.setDescription(deviceDesc); if (deviceType != null) { device.setPrimaryDeviceTypes(deviceType); } device.addConnection(conn); ApplicationEntity ae = new ApplicationEntity(aeTitle); device.addApplicationEntity(ae); ae.setDescription(aeDesc); ae.addConnection(conn); conf.persist(device, EnumSet.of(DicomConfiguration.Option.REGISTER)); }