Skip to content

Instantly share code, notes, and snippets.

@enesakar
Created February 20, 2015 08:34
Show Gist options
  • Select an option

  • Save enesakar/3a7594c83f1b27fbc202 to your computer and use it in GitHub Desktop.

Select an option

Save enesakar/3a7594c83f1b27fbc202 to your computer and use it in GitHub Desktop.
hazelcast regex predicate example
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;
}
}
}
@sseRA
Copy link

sseRA commented Feb 23, 2015

Thanks for your comment! I'll look into the Hazelcast's Portable interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment