Package org.onlab.util
Class StringFilter
- java.lang.Object
-
- org.onlab.util.StringFilter
-
public class StringFilter extends Object
Filters content on a given object with String representation. This is carried out through restrictive (AND) or loose (OR) searches. If not provided, strategy defaults to ADD.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StringFilter.Strategy
Defines the filtering strategy.
-
Constructor Summary
Constructors Constructor Description StringFilter(List<String> filter)
Creates a new filter to apply on some data.StringFilter(List<String> filter, StringFilter.Strategy strategy)
Creates a new filter to apply on some data, given a specific strategy (AND, OR).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
filter(Object data)
Filters data according to a set of restrictions and a specific strategy.
-
-
-
Constructor Detail
-
StringFilter
public StringFilter(List<String> filter)
Creates a new filter to apply on some data.- Parameters:
filter
- list with filters to apply
-
StringFilter
public StringFilter(List<String> filter, StringFilter.Strategy strategy)
Creates a new filter to apply on some data, given a specific strategy (AND, OR).- Parameters:
filter
- list with filters to applystrategy
- type of strategy (AND, OR)
-
-
Method Detail
-
filter
public boolean filter(Object data)
Filters data according to a set of restrictions and a specific strategy.- Parameters:
data
- Object with data to filter- Returns:
- true if data honours the filters, false otherwise
-
-