class AssetCategoryResolversImpl implements AssetCategoryResolvers {

    @Override
    public DataFetcher<AssetCategory> createAssetCategoryDataFetcher() {
        return environment -> {
            long userId = util.getLongArg(environment, "userId", util.getDefaultUserId());
            long groupId = util.getLongArg(environment, "groupId");
            long parentCategoryId = util.getLongArg(environment, "parentCategoryId", AssetCategoryConstants.DEFAULT_PARENT_CATEGORY_ID);
            Map<Locale, String> titleMap = util.getTranslatedArg(environment, "titleMap");
            Map<Locale, String> descriptionMap = util.getTranslatedArg(environment, "descriptionMap");
            long vocabularyId = util.getLongArg(environment, "vocabularyId");
            String[] categoryProperties = util.getStringArrayArg(environment, "categoryProperties");
            ServiceContext serviceContext = new ServiceContext();

            return assetCategoryLocalService.addCategory(
                    userId,
                    groupId,
                    parentCategoryId,
                    titleMap,
                    descriptionMap,
                    vocabularyId,
                    categoryProperties,
                    serviceContext);
        };
    }

}