public Whitelist(Collection<String> patterns,int statusCode){
  if (patterns == null || patterns.isEmpty()) {
    this.patterns=Collections.emptyList();
  }
 else {
    ImmutableList.Builder<Pattern> builder=ImmutableList.builder();
    for (    String pattern : patterns) {
      builder.add(Pattern.compile(pattern));
    }
    this.patterns=builder.build();
  }
  this.statusCode=statusCode;
  this.enabled=true;
}

public Whitelist ( Collection < String > patterns , int statusCode ) { if ( patterns == null || patterns . isEmpty ( ) ) { this . patterns = Collections . emptyList ( ) ; } else { ImmutableList . Builder < Pattern > builder = ImmutableList . builder ( ) ; for ( String pattern : patterns ) { builder . add ( Pattern . compile ( pattern ) ) ; } this . patterns = builder . build ( ) ; } this . statusCode = statusCode ; this . enabled = true ; }
creates a whitelist for the specified patterns , returning the given statuscode when a url does not match one of the patterns . a null or empty collection will result in an empty whitelist .
