Skip to content

Instantly share code, notes, and snippets.

@shazin
Created January 19, 2016 11:49
Show Gist options
  • Save shazin/baa132ab47e346338c89 to your computer and use it in GitHub Desktop.
Save shazin/baa132ab47e346338c89 to your computer and use it in GitHub Desktop.
@Component
public class UserService {
public Observable<User> findAll() {
return Observable.<User>from(new User[] {new User("Shazin", 29), new User("Shahim", 29)});
}
public Observable<User> findByName(String name) {
return findAll().filter(u -> u.getName().toLowerCase().contains(name.toLowerCase()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment