+ .setWaveNumber(ztoADirection.getZToAWavelengthNumber());
+ }
+ if (Uint32.valueOf(GridConstant.IRRELEVANT_WAVELENGTH_NUMBER)
+ .equals(ztoADirection.getZToAWavelengthNumber())) {
+ scale = GridConstant.FLEX_GRID_FREQUENCY_PRECISION;
+ }
+ if (ztoADirection.getZToAMinFrequency() != null) {
+ servicePathInputBuilder.setMinFreq(new FrequencyTHz(ztoADirection.getZToAMinFrequency().getValue()));
+ servicePathInputBuilder.setLowerSpectralSlotNumber(Uint32
+ .valueOf(GridUtils
+ .getLowerSpectralIndexFromFrequency(ztoADirection.getZToAMinFrequency().getValue())));
+ }
+ if (ztoADirection.getZToAMaxFrequency() != null) {
+ servicePathInputBuilder.setMaxFreq(new FrequencyTHz(ztoADirection.getZToAMaxFrequency().getValue()));
+ servicePathInputBuilder.setHigherSpectralSlotNumber(
+ Uint32.valueOf(GridUtils
+ .getHigherSpectralIndexFromFrequency(ztoADirection.getZToAMaxFrequency().getValue())));
+ }
+ if (ztoADirection.getZToAMinFrequency() != null && ztoADirection.getZToAMaxFrequency() != null) {
+ servicePathInputBuilder.setCenterFreq(
+ GridUtils.getCentralFrequencyWithPrecision(ztoADirection.getZToAMinFrequency().getValue(),
+ ztoADirection.getZToAMaxFrequency().getValue(), scale));
+ }
+ if (ztoADirection.getRate() != null && ztoADirection.getModulationFormat() != null) {
+ Optional<ModulationFormat> optionalModulationFormat = ModulationFormat
+ .forName(ztoADirection.getModulationFormat());
+ if (optionalModulationFormat.isPresent()
+ && GridConstant.FREQUENCY_WIDTH_TABLE
+ .contains(ztoADirection.getRate(), optionalModulationFormat.get())) {
+ servicePathInputBuilder.setWidth(FrequencyGHz
+ .getDefaultInstance(GridConstant.FREQUENCY_WIDTH_TABLE.get(ztoADirection.getRate(),
+ optionalModulationFormat.get())));
+ }