public class ApiFilter extends Object
Constructor and Description |
---|
ApiFilter(Dimension dimension,
DimensionField dimensionField,
FilterOperation operation,
Set<String> values)
Constructor.
|
ApiFilter(String filterQuery,
DimensionDictionary dimensionDictionary)
Parses the URL filter Query and generates the ApiFilter object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Dimension |
getDimension() |
DimensionField |
getDimensionField() |
FilterOperation |
getOperation() |
Set<String> |
getValues() |
int |
hashCode() |
String |
toString() |
static ApiFilter |
union(ApiFilter one,
ApiFilter two)
Take two Api filters which differ only by value sets and union their value sets.
|
ApiFilter |
withDimension(Dimension dimension) |
ApiFilter |
withDimensionField(DimensionField dimensionField) |
ApiFilter |
withOperation(FilterOperation operation) |
ApiFilter |
withValues(Set<String> values) |
public ApiFilter(Dimension dimension, DimensionField dimensionField, FilterOperation operation, Set<String> values)
dimension
- Dimension the filter operates ondimensionField
- Dimension Field the filter operates onoperation
- Operation the filter operates withvalues
- The values the filter uses when operatingpublic ApiFilter(@NotNull String filterQuery, DimensionDictionary dimensionDictionary) throws BadFilterException
filterQuery
- Expects a URL filter query String in the format:
(dimension name)|(field name)-(operation)[?(value or comma separated values)]?
dimensionDictionary
- cache containing all the valid dimension objects.BadFilterException
- Exception when filter pattern is not matched or when any of its properties are not
valid.public ApiFilter withDimensionField(@NotNull DimensionField dimensionField)
public ApiFilter withOperation(@NotNull FilterOperation operation)
public Dimension getDimension()
public DimensionField getDimensionField()
public FilterOperation getOperation()
public static ApiFilter union(ApiFilter one, ApiFilter two)
one
- The first ApiFiltertwo
- The second ApiFilterCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.