예제 #1
0
  @Override
  public VirtualMachine toPojo() {
    VirtualMachine virtualMachine = new VirtualMachine();

    virtualMachine.setId(idVm);
    virtualMachine.setName(name);

    if (hypervisor == null) {
      virtualMachine.setAssignedTo(null);
    } else {
      virtualMachine.setAssignedTo(hypervisor.toPojo());
    }

    if (conversion == null) {
      virtualMachine.setConversion(null);
    } else {
      virtualMachine.setConversion(conversion.toPojo());
    }

    virtualMachine.setVirtualImage(image == null ? null : image.toPojo());
    virtualMachine.setUUID(uuid);
    virtualMachine.setDescription(description);
    virtualMachine.setRam(ram);
    virtualMachine.setCpu(cpu);
    virtualMachine.setHd(hd);
    virtualMachine.setVdrpIP(vdrpIp);
    virtualMachine.setVdrpPort(vdrpPort);
    virtualMachine.setState(new State(state));
    virtualMachine.setSubState(new State(subState == null ? StateEnum.UNKNOWN : subState));
    virtualMachine.setHighDisponibility(highDisponibility == 1 ? true : false);
    virtualMachine.setUser(userHB == null ? null : userHB.toPojo());
    virtualMachine.setEnterprise(enterpriseHB == null ? null : enterpriseHB.toPojo());
    virtualMachine.setIdType(idType);
    virtualMachine.setDatastore(datastore == null ? null : datastore.toPojo());
    virtualMachine.setPassword(password);

    return virtualMachine;
  }