use of org.ovirt.engine.api.model.Mac in project ovirt-engine by oVirt.
the class BackendVmNicResourceTest method getNic.
protected Nic getNic(boolean withNetwork) {
Nic nic = new Nic();
nic.setMac(new Mac());
nic.getMac().setAddress("00:1a:4a:16:85:18");
if (withNetwork) {
Network network = new Network();
network.setId(GUIDS[0].toString());
}
Network network = new Network();
network.setId(GUIDS[0].toString());
return nic;
}
use of org.ovirt.engine.api.model.Mac in project ovirt-engine by oVirt.
the class NicMapper method map.
@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;
}
Aggregations