private static DistributionSetCreate fromRequest(final MgmtDistributionSetRequestBodyPost dsRest,
            final EntityFactory entityFactory) {

        final List<Long> modules = new ArrayList<>();

        if (dsRest.getOs() != null) {
            modules.add(dsRest.getOs().getId());
        }

        if (dsRest.getApplication() != null) {
            modules.add(dsRest.getApplication().getId());
        }

        if (dsRest.getRuntime() != null) {
            modules.add(dsRest.getRuntime().getId());
        }

        if (dsRest.getModules() != null) {
            dsRest.getModules().forEach(module -> modules.add(module.getId()));
        }

        return entityFactory.distributionSet().create().name(dsRest.getName()).version(dsRest.getVersion())
                .description(dsRest.getDescription()).type(dsRest.getType()).modules(modules)
                .requiredMigrationStep(dsRest.isRequiredMigrationStep());
    }
private static DistributionSetCreate fromRequest ( final MgmtDistributionSetRequestBodyPost dsRest , final EntityFactory entityFactory ) { final List < Long > modules = new ArrayList < > ( ) ; if ( dsRest . getOs ( ) != null ) { modules . add ( dsRest . getOs ( ) . getId ( ) ) ; } if ( dsRest . getApplication ( ) != null ) { modules . add ( dsRest . getApplication ( ) . getId ( ) ) ; } if ( dsRest . getRuntime ( ) != null ) { modules . add ( dsRest . getRuntime ( ) . getId ( ) ) ; } if ( dsRest . getModules ( ) != null ) { dsRest . getModules ( ) . forEach ( module -> modules . add ( module . getId ( ) ) ) ; } return entityFactory . distributionSet ( ) . create ( ) . name ( dsRest . getName ( ) ) . version ( dsRest . getVersion ( ) ) . description ( dsRest . getDescription ( ) ) . type ( dsRest . getType ( ) ) . modules ( modules ) . requiredMigrationStep ( dsRest . isRequiredMigrationStep ( ) ) ; }
{@link MgmtDistributionSetRequestBodyPost} to {@link DistributionSet}.

@param dsRest
to convert
@return converted {@link DistributionSet}