@Mapping(from = HostStorage.class, to = org.ovirt.engine.core.common.businessentities.StorageDomain.class) public static org.ovirt.engine.core.common.businessentities.StorageDomain map(HostStorage model, org.ovirt.engine.core.common.businessentities.StorageDomain template) { org.ovirt.engine.core.common.businessentities.StorageDomain entity = template != null ? template : new org.ovirt.engine.core.common.businessentities.StorageDomain(); entity.setStorage(model.getId()); if (model.isSetType()) { entity.setStorageType(StorageDomainMapper.map(model.getType(), null)); } return entity; } }
/** * This mapping exists for adding a lun-disk, and assumes that 'storage' entity contains exactly one lun. */ @Mapping(from = HostStorage.class, to = LUNs.class) public static LUNs map(HostStorage model, LUNs template) { LUNs entity = template != null ? template : new LUNs(); if (model.isSetLogicalUnits() && model.getLogicalUnits().isSetLogicalUnits()) { LogicalUnit logicalUnit = model.getLogicalUnits().getLogicalUnits().get(0); entity.setLUNId(logicalUnit.getId()); ArrayList<StorageServerConnections> connections = new ArrayList<>(); connections.add(map(logicalUnit, null)); entity.setLunConnections(connections); } if (model.isSetType()) { entity.setLunType(StorageDomainMapper.map(model.getType(), null)); } return entity; }
@Mapping(from = StorageDomain.class, to = StorageServerConnections.class) public static StorageServerConnections map(StorageDomain model, StorageServerConnections template) { StorageServerConnections entity = template != null ? template : new StorageServerConnections(); if (model.isSetStorage() && model.getStorage().isSetType()) { HostStorage storage = model.getStorage(); StorageType storageType = storage.getType();
entity.setStorageDomainType(map(model.getType(), null)); if (model.isSetStorage() && model.getStorage().isSetType()) { entity.setStorageType(map(model.getStorage().getType(), null));
to.setTarget(from.getTarget()); if (from.isSetType()) { to.setType(from.getType().value());