@Override protected Nic postPopulate(Nic model) { model.setInterface(NicInterface.E1000); return model; }
static Nic getModel(int index) { Nic model = new Nic(); model.setName(NAMES[index]); model.setInterface(NicInterface.RTL8139_VIRTIO); return model; }
static Nic getModel(int index) { Nic model = new Nic(); model.setName(NAMES[index]); model.setInterface(NicInterface.RTL8139_VIRTIO); return model; }
static Nic getModel(int index) { Nic model = new Nic(); model.setName(NAMES[index]); model.setInterface(NicInterface.RTL8139_VIRTIO); return model; }
@Mapping(from = VmNetworkInterface.class, to = Nic.class) public static Nic map(VmNetworkInterface entity, Nic template) { Nic model = template != null ? template : new Nic(); if (entity.getVmId() != null) { model.setVm(new Vm()); model.getVm().setId(entity.getVmId().toString()); } if (entity.getId() != null) { model.setId(entity.getId().toString()); } if (entity.getName() != null) { model.setName(entity.getName()); } if (entity.getMacAddress() != null) { model.setMac(new Mac()); model.getMac().setAddress(entity.getMacAddress()); } model.setLinked(entity.isLinked()); model.setInterface(map(entity.getType())); model.setPlugged(entity.isPlugged()); if (entity.getVnicProfileId() != null) { model.setVnicProfile(new VnicProfile()); model.getVnicProfile().setId(entity.getVnicProfileId().toString()); } return model; }
to.setInterface(NicInterface.fromValue(from.getInterface()));