@Mapping(from = InstanceType.class, to = Display.class) public static Display map(InstanceType instanceType, Display display) { Display result = (display == null) ? new Display() : display; result.setMonitors(instanceType.getNumOfMonitors()); result.setSingleQxlPci(instanceType.getSingleQxlPci()); result.setSmartcardEnabled(instanceType.isSmartcardEnabled()); return result; }
@Mapping(from = VmTemplate.class, to = Display.class) public static Display map(VmTemplate vmTemplate, Display display) { Display result = (display == null) ? new Display() : display; result.setMonitors(vmTemplate.getNumOfMonitors()); result.setSingleQxlPci(vmTemplate.getSingleQxlPci()); result.setAllowOverride(vmTemplate.isAllowConsoleReconnect()); result.setSmartcardEnabled(vmTemplate.isSmartcardEnabled()); result.setKeyboardLayout(vmTemplate.getVncKeyboardLayout()); result.setFileTransferEnabled(vmTemplate.isSpiceFileTransferEnabled()); result.setCopyPasteEnabled(vmTemplate.isSpiceCopyPasteEnabled()); return result; }