class LayoutResolversImpl implements LayoutResolvers {

    @Override
    public DataFetcher<Layout> updateLayoutDataFetcher() {
        return environment -> {
            long groupId = util.getLongArg(environment, "groupId");
            boolean privateLayout = util.getBooleanArg(environment, "privateLayout");
            long layoutId = util.getLongArg(environment, "layoutId");
            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();

            // Remark: there is no update method to update everything at once
            layoutLocalService.updateLayout(
                    groupId,
                    privateLayout,
                    layoutId,
                    parentLayoutId,
                    nameMap,
                    titleMap,
                    descriptionMap,
                    keywordsMap,
                    robotsMap,
                    type,
                    hidden,
                    friendlyURLMap,
                    false,
                    null,
                    serviceContext);
            return layoutLocalService.updateLayout(
                    groupId,
                    privateLayout,
                    layoutId,
                    typeSettings);
        };
    }

}