Skip to content

Commit

Permalink
making include/exclude handle varargs (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
monitorjbl committed May 31, 2015
1 parent 0b49c06 commit 90cfd05
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main/java/com/monitorjbl/json/Match.java
@@ -1,6 +1,7 @@
package com.monitorjbl.json;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Match {
Expand All @@ -11,13 +12,17 @@ public class Match {

}

public Match include(String field) {
includes.add(field);
public Match include(String... fields) {
if (fields != null) {
includes.addAll(Arrays.asList(fields));
}
return this;
}

public Match exclude(String field) {
excludes.add(field);
public Match exclude(String... fields) {
if (fields != null) {
excludes.addAll(Arrays.asList(fields));
}
return this;
}

Expand Down

0 comments on commit 90cfd05

Please sign in to comment.