if (rpSet == null) {
throw new IllegalArgumentException("rpSet may not be null");
}
final FactoryRPs rps = new FactoryRPs();
final Duration defaultRunningTime = rpSet.getDefaultRunningTime();
if (defaultRunningTime != null) {
rps.setDefaultRunningSeconds(
CommonUtil.durationToSeconds(defaultRunningTime));
}
final Duration maxRunningTime = rpSet.getMaximumRunningTime();
if (maxRunningTime != null) {
rps.setMaximumRunningSeconds(
CommonUtil.durationToSeconds(maxRunningTime));
}
final Associations assocs = rpSet.getAssociations();
if (assocs != null) {
rps.setAssociations(assocs.getAssociation());
} else {
rps.setAssociations(null);
}
final VMM_Type vmm = rpSet.getVMM();
if (vmm != null) {
final VMM_TypeType type = vmm.getType();
if (type != null) {
rps.setVMM(type.toString());
}
rps.setVmmVersions(vmm.getVersion());
}
final ProcessorArchitectureEnumeration cpuArch =
rpSet.getCPUArchitectureName();
if (cpuArch != null) {
rps.setCpuArchitectureName(cpuArch.toString());
}
return rps;
}