class DDMStructureResolversImpl implements DDMStructureResolvers {

    @Override
    public DataFetcher<DDMStructure> createDDMStructureDataFetcher() {
        return environment -> {
            long userId = util.getLongArg(environment, "userId", util.getDefaultUserId());
            long groupId = util.getLongArg(environment, "groupId");
            String parentStructureKey = util.getStringArg(environment, "parentStructureKey");
            long classNameId = util.getLongArg(environment, "classNameId");
            String structureKey = util.getStringArg(environment, "structureKey");
            Map<Locale, String> nameMap = util.getTranslatedArg(environment, "nameMap");
            Map<Locale, String> descriptionMap = util.getTranslatedArg(environment, "descriptionMap");
            DDMForm ddmForm = util.getDDDMFormArg(environment, "ddmForm");
            DDMFormLayout ddmFormLayout = util.getDDDMFormLayoutArg(environment, "ddmFormLayout");
            String storageType = util.getStringArg(environment, "storageType", "json");
            int type = util.getIntArg(environment, "type", DDMStructureConstants.TYPE_DEFAULT);
            ServiceContext serviceContext = new ServiceContext();

            return ddmStructureLocalService.addStructure(
                    userId,
                    groupId,
                    parentStructureKey,
                    classNameId,
                    structureKey,
                    nameMap,
                    descriptionMap,
                    ddmForm,
                    ddmFormLayout,
                    storageType,
                    type,
                    serviceContext);
        };
    }

}