Skip to content

Instantly share code, notes, and snippets.

@gauravat16
Created July 9, 2020 12:21
Show Gist options
  • Save gauravat16/539f88961f1f26d71a5e243c0d20affe to your computer and use it in GitHub Desktop.
Save gauravat16/539f88961f1f26d71a5e243c0d20affe to your computer and use it in GitHub Desktop.
UsernameValidator
package gaurav.examples.redis.bloomfilter.service.impl;
import gaurav.examples.redis.bloomfilter.service.BloomFilterService;
import gaurav.examples.redis.bloomfilter.service.UserNameValidatorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class UserNameValidatorServiceImpl implements UserNameValidatorService {
@Autowired
private BloomFilterService bloomFilterService;
@Override
public boolean checkIfUserNameAvailability(String userName) {
return bloomFilterService.getUserNameBloomFilter().contains(userName);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment