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