class LayoutResolversImpl implements LayoutResolvers {

    @Override
    public DataFetcher<Layout> createLayoutDataFetcher() {
        return environment -> {
            long userId = util.getLongArg(environment, "userId", util.getDefaultUserId());
            long groupId = util.getLongArg(environment, "groupId");
            boolean privateLayout = util.getBooleanArg(environment, "privateLayout");
            long parentLayoutId = util.getLongArg(environment, "parentLayoutId");
            Map<Locale, String> nameMap = util.getTranslatedArg(environment, "nameMap");
            Map<Locale, String> titleMap = util.getTranslatedArg(environment, "titleMap");
            Map<Locale, String> descriptionMap = util.getTranslatedArg(environment, "descriptionMap");
            Map<Locale, String> keywordsMap = util.getTranslatedArg(environment, "keywordsMap");
            Map<Locale, String> robotsMap = util.getTranslatedArg(environment, "robotsMap");
            String type = util.getStringArg(environment, "type");
            String typeSettings = util.getStringArg(environment, "typeSettings");
            boolean hidden = util.getBooleanArg(environment, "hidden");
            Map<Locale, String> friendlyURLMap = util.getTranslatedArg(environment, "friendlyURLMap");
            ServiceContext serviceContext = new ServiceContext();

            return layoutLocalService.addLayout(
                    userId,
                    groupId,
                    privateLayout,
                    parentLayoutId,
                    nameMap,
                    titleMap,
                    descriptionMap,
                    keywordsMap,
                    robotsMap,
                    type,
                    typeSettings,
                    hidden,
                    friendlyURLMap,
                    serviceContext);
        };
    }

}