Created
July 9, 2020 12:21
-
-
Save gauravat16/539f88961f1f26d71a5e243c0d20affe to your computer and use it in GitHub Desktop.
UsernameValidator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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