Skip to content

Commit

Permalink
postProcess
Browse files Browse the repository at this point in the history
  • Loading branch information
childe committed Mar 6, 2017
1 parent d421f12 commit 0e98ab4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/com/example/filter/Reverse.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@ protected void prepare() {
*/
@Override
protected Map filter(final Map event) {

boolean success = false;
for (String field : this.fields) {
if (!event.containsKey(field)) {
continue;
}
success = true;
String oldValue = event.get(field).toString();
String newValue = new StringBuilder(oldValue).reverse().toString();
event.put(field, newValue);
}
postProcess(event, success);
return event;
}
}

0 comments on commit 0e98ab4

Please sign in to comment.