001/* 002 * Copyright (c) 2016-2017 Chris K Wensel <chris@wensel.net>. All Rights Reserved. 003 * 004 * Project and contact information: http://www.cascading.org/ 005 * 006 * This file is part of the Cascading project. 007 * 008 * Licensed under the Apache License, Version 2.0 (the "License"); 009 * you may not use this file except in compliance with the License. 010 * You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, software 015 * distributed under the License is distributed on an "AS IS" BASIS, 016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 017 * See the License for the specific language governing permissions and 018 * limitations under the License. 019 */ 020 021package cascading.nested.json; 022 023import java.beans.ConstructorProperties; 024import java.util.Collections; 025import java.util.List; 026import java.util.regex.Pattern; 027 028import cascading.nested.core.NestedRegexFilter; 029 030/** 031 * Class JSONRegexFilter provides for the ability to to filter a tuple stream based on the values in a JSON object. 032 * 033 * @see NestedRegexFilter for more details. 034 */ 035public class JSONRegexFilter extends NestedRegexFilter 036 { 037 /** 038 * Creates a new JSONRegexFilter instance. 039 * 040 * @param pointer of String 041 * @param pattern of Pattern 042 */ 043 @ConstructorProperties({"pointer", "pattern"}) 044 public JSONRegexFilter( String pointer, Pattern pattern ) 045 { 046 this( pointer, Collections.singletonList( pattern ) ); 047 } 048 049 /** 050 * Creates a new JSONRegexFilter instance. 051 * 052 * @param pointer of String 053 * @param patterns of List 054 */ 055 @ConstructorProperties({"pointer", "patterns"}) 056 public JSONRegexFilter( String pointer, List<Pattern> patterns ) 057 { 058 super( JSONCoercibleType.TYPE, pointer, patterns ); 059 } 060 }