I have a method login() that calls another method registerLoginHandler(). The thing that is confusing to me is that the arguments of registerLoginHandler() contain a lot of stuff inside curled brackets. It's almost as if it is passing an entire class to registerLoginHandler(). Could someone shed some light on what is going on here?
public static ITeamRepository login() throws TeamRepositoryException {
ITeamRepository repository = TeamPlatform.getTeamRepositoryService().getTeamRepository(REPOSITORY_ADDRESS);
repository.registerLoginHandler(new ITeamRepository.ILoginHandler() {
public ILoginInfo challenge(ITeamRepository repository) {
return new ILoginInfo() {
public String getUserId() {
return "UserName";
}
public String getPassword() {
return "Password";
}
};
}
});
monitor.subTask("Contacting " + repository.getRepositoryURI() + "...");
repository.login(monitor);
monitor.subTask("Connected");
return repository;
}