class RoleResolversImpl implements RoleResolvers {

    @Override
    public DataFetcher<Role> createRoleDataFetcher() {
        return environment -> {
            long userId = util.getLongArg(environment, "userId", util.getDefaultUserId());
            String className = util.getStringArg(environment, "className");
            long classPK = util.getLongArg(environment, "classPK");
            String name = util.getStringArg(environment, "name");
            Map<Locale, String> titleMap = util.getTranslatedArg(environment, "titleMap");
            Map<Locale, String> descriptionMap = util.getTranslatedArg(environment, "descriptionMap");
            int type = util.getIntArg(environment, "type");
            String subtype = util.getStringArg(environment, "subtype");
            ServiceContext serviceContext = new ServiceContext();

            return roleLocalService.addRole(
                    userId,
                    className,
                    classPK,
                    name,
                    titleMap,
                    descriptionMap,
                    type,
                    subtype,
                    serviceContext);
        };
    }

}