class DDMTemplateResolversImpl implements DDMTemplateResolvers {

    @Override
    public DataFetcher<DDMTemplate> createDDMTemplateDataFetcher() {
        return environment -> {
            long userId = util.getLongArg(environment, "userId", util.getDefaultUserId());
            long groupId = util.getLongArg(environment, "groupId");
            long classNameId = util.getLongArg(environment, "classNameId");
            long classPK = util.getLongArg(environment, "classPK");
            long resourceClassNameId = util.getLongArg(environment, "resourceClassNameId");
            String templateKey = util.getStringArg(environment, "templateKey");
            Map<Locale, String> nameMap = util.getTranslatedArg(environment, "nameMap");
            Map<Locale, String> descriptionMap = util.getTranslatedArg(environment, "descriptionMap");
            String type = util.getStringArg(environment, "type");
            String mode = util.getStringArg(environment, "mode");
            String language = util.getStringArg(environment, "language", TemplateConstants.LANG_TYPE_FTL);
            String script = util.getStringArg(environment, "script");
            boolean cacheable = util.getBooleanArg(environment, "cacheable");
            ServiceContext serviceContext = new ServiceContext();

            return ddmTemplateLocalService.addTemplate(
                    userId,
                    groupId,
                    classNameId,
                    classPK,
                    resourceClassNameId,
                    templateKey,
                    nameMap,
                    descriptionMap,
                    type,
                    mode,
                    language,
                    script,
                    cacheable,
                    false,
                    null,
                    null,
                    serviceContext);
        };
    }

}