protected VoltageLevelExt checkAndGetVoltageLevel() { if (voltageLevelId == null) { throw new ValidationException(this, "voltage level is not set"); } VoltageLevelExt voltageLevel = getNetwork().getVoltageLevel(voltageLevelId); if (voltageLevel == null) { throw new ValidationException(this, "voltage level '" + voltageLevelId + "' not found"); } if (voltageLevel.getSubstation() != substation) { throw new ValidationException(this, "voltage level shall belong to the substation '" + substation.getId() + "'"); } return voltageLevel; } }