Created
February 20, 2015 08:34
-
-
Save enesakar/3a7594c83f1b27fbc202 to your computer and use it in GitHub Desktop.
hazelcast regex predicate example
This file contains hidden or 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
| public class Main { | |
| public static void main(String[] args) { | |
| final HazelcastInstance hz = Hazelcast.newHazelcastInstance(null); | |
| IMap employees = hz.getMap("employees"); | |
| employees.put(1, new Employee("xxx zz yyy")); | |
| employees.put(2, new Employee("aaa bb ccc")); | |
| Collection<Employee> result = employees.values(Predicates.regex("employeeName", "x+.*")); | |
| for (Employee employee : result) { | |
| System.out.println(employee.employeeName); | |
| } | |
| } | |
| static class Employee implements Serializable{ | |
| String employeeName; | |
| Employee(String employeeName) { | |
| this.employeeName = employeeName; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for your comment! I'll look into the Hazelcast's Portable interface.