class UserRolesMappingServiceImpl implements UserRolesMappingService {

	@Override
	public Page<UserRolesMappingResponse> getAllUserRolesMapping(String searchTerm, int page, int size) {
		Page<UserRolesMapping> userRoleMappings = userRolesMappingRepository.findAllUserRolesMappingDetails(searchTerm, new PageRequest(page, size));
		List<UserRolesMappingResponse> allUserRoleMappingsList = userRoleMappings.getContent().parallelStream().map(fetchUserRolesMappingDetials).collect(Collectors.toList());
		Page<UserRolesMappingResponse> allUserRoleMappings = new PageImpl<UserRolesMappingResponse>(allUserRoleMappingsList, new PageRequest(page, size), userRoleMappings.getTotalElements());
		return allUserRoleMappings;
	}

}