public static void validateAdd(VirtualNumaNode node) { if (node == null) { throw new ValidationException("Parameter 'node' is mandatory but was not provided."); } if (node.getIndex()==null) { throw new ValidationException("Parameter 'node.index' is mandatory but was not provided."); } if (node.getMemory()==null) { throw new ValidationException("Parameter 'node.memory' is mandatory but was not provided."); } if (node.getCpu()==null || node.getCpu().getCores()==null || node.getCpu().getCores().getCores()==null || node.getCpu().getCores().getCores().size() == 0 || node.getCpu().getCores().getCores().get(0).getIndex()==null) { throw new ValidationException("Parameter 'node.cpu.cores.index' is mandatory but was not provided."); } }
if (cpu != null) { List<Integer> ids = new ArrayList<>(); Cores cores = cpu.getCores(); if (cores != null) { for (Core core : cores.getCores()) {
@Override protected void verify(VirtualNumaNode model, VirtualNumaNode transform) { assertNotNull(transform); assertEquals(model.getId(), transform.getId()); assertEquals(model.getIndex(), transform.getIndex()); assertEquals(model.getMemory(), transform.getMemory()); List<Core> cpus1 = model.getCpu().getCores().getCores(); List<Core> cpus2 = transform.getCpu().getCores().getCores(); assertEquals(cpus1.size(), cpus2.size()); for (int i = 0; i < cpus1.size(); i++) { assertEquals(cpus1.get(i).getIndex(), cpus2.get(i).getIndex()); } List<NumaNodePin> pins1 = model.getNumaNodePins().getNumaNodePins(); List<NumaNodePin> pins2 = transform.getNumaNodePins().getNumaNodePins(); assertEquals(pins1.size(), pins2.size()); for (int i = 0; i < pins1.size(); i++) { assertEquals(pins1.get(i).getIndex(), pins2.get(i).getIndex()); } } }
to.getCores().getCore().addAll(adaptOut(from.getCores().getCores()));
to.getCores().getCores().addAll(adaptIn(from.getCores().getCore()));