/** * Checks that when unlinking/null network is not supported in the destination cluster and a NIC * has unlinked/null network, it's not valid. * * @param interfaces The NICs to check. * @param clusterCompatibilityVersion The destination cluster's compatibility version. * @return Whether the NICs are linked correctly and network name is valid (with regards to the * destination cluster). */ private boolean validateNics(List<VmNic> interfaces, Version clusterCompatibilityVersion) { for (VmNic iface : interfaces) { VmNicValidator nicValidator = new VmNicValidator(iface, clusterCompatibilityVersion); if (!parentCommand.validate(nicValidator.emptyNetworkValid()) || !parentCommand.validate(nicValidator.linkedOnlyIfSupported())) { return false; } } return true; }