package com.bocloud.cmp.model.hmc;

import java.util.List;
import java.util.stream.Collectors;

public class HmdViosVolumeGroupModel extends HmdGenericModel {
    private String name; // 名称
    private Float totalCapacity; // 总容量
    private Float availableCapacity; // 可用容量
    private Float freeCapacity; // 空闲容量
    private String groupSerialId; // 存储池序列号
    private Long maxLogicalVolumes; // 最大容纳物理磁盘数
    private String uniqueDeviceId; // 唯一设备id
    private List<HmdViosPhysicalDiskModel> physicalDisks; // 物理磁盘
    private List<HmdViosVirtualDiskModel> virtualDisks; // 虚拟磁盘
    private List<HmdViosVirtualCdModel> virtualCds; // 虚拟光学设备
    private HmdPartitionModel vios; // 所属vios

    public Float getTotalCapacity() {
        return totalCapacity;
    }

    public void setTotalCapacity(Float totalCapacity) {
        this.totalCapacity = totalCapacity;
    }

    public Float getAvailableCapacity() {
        return availableCapacity;
    }

    public void setAvailableCapacity(Float availableCapacity) {
        this.availableCapacity = availableCapacity;
    }

    public Float getFreeCapacity() {
        return freeCapacity;
    }

    public void setFreeCapacity(Float freeCapacity) {
        this.freeCapacity = freeCapacity;
    }

    public String getGroupSerialId() {
        return groupSerialId;
    }

    public void setGroupSerialId(String groupSerialId) {
        this.groupSerialId = groupSerialId;
    }

    public Long getMaxLogicalVolumes() {
        return maxLogicalVolumes;
    }

    public void setMaxLogicalVolumes(Long maxLogicalVolumes) {
        this.maxLogicalVolumes = maxLogicalVolumes;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUniqueDeviceId() {
        return uniqueDeviceId;
    }

    public void setUniqueDeviceId(String uniqueDeviceId) {
        this.uniqueDeviceId = uniqueDeviceId;
    }

    public List<HmdViosPhysicalDiskModel> getPhysicalDisks() {
        return physicalDisks;
    }

    public void setPhysicalDisks(List<HmdViosPhysicalDiskModel> physicalDisks) {
        this.physicalDisks = physicalDisks;
    }

    public void setPhysicalDiskUrls(List<String> urls) {
        this.physicalDisks = urls.stream().map(url -> {
            HmdViosPhysicalDiskModel disk = new HmdViosPhysicalDiskModel();
            disk.setUrl(url);
            return disk;
        }).collect(Collectors.toList());
    }

    public List<HmdViosVirtualDiskModel> getVirtualDisks() {
        return virtualDisks;
    }

    public void setVirtualDisks(List<HmdViosVirtualDiskModel> virtualDisks) {
        this.virtualDisks = virtualDisks;
    }

    public void setVirtualDiskUrls(List<String> urls) {
        this.virtualDisks = urls.stream().map(url -> {
            HmdViosVirtualDiskModel disk = new HmdViosVirtualDiskModel();
            disk.setUrl(url);
            return disk;
        }).collect(Collectors.toList());
    }

    public List<HmdViosVirtualCdModel> getVirtualCds() {
        return virtualCds;
    }

    public void setVirtualCds(List<HmdViosVirtualCdModel> virtualCds) {
        this.virtualCds = virtualCds;
    }

    public void setVirtualCdUrls(List<String> urls) {
        this.virtualCds = urls.stream().map(url -> {
            HmdViosVirtualCdModel cd = new HmdViosVirtualCdModel();
            cd.setUrl(url);
            return cd;
        }).collect(Collectors.toList());
    }

    public HmdPartitionModel getVios() {
        return vios;
    }

    public void setVios(HmdPartitionModel vios) {
        this.vios = vios;
    }
}
