Package com.ocs.dynamo.filter
Class DynamoFilterUtil
- java.lang.Object
-
- com.ocs.dynamo.filter.DynamoFilterUtil
-
public final class DynamoFilterUtil extends Object
- Author:
- Bas Rutten
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FilterextractFilter(Filter filter, String propertyId)Extracts a specific filter from a (possibly) composite filterstatic List<Filter>flattenAnd(And and)Take a (nested) And filter and flatten it to a single levelstatic voidremoveFilters(Filter filter, String... propertyIds)Removes filters with certain property IDs from a certain filterstatic voidreplaceFilter(Filter original, Filter newFilter, String propertyId, boolean firstOnly)Replaces a filter by another filterstatic voidreplaceMasterAndDetailFilters(Filter filter, EntityModel<?> entityModel)Replaces all filters that query a detail relation by the appropriate filters
-
-
-
Method Detail
-
extractFilter
public static Filter extractFilter(Filter filter, String propertyId)
Extracts a specific filter from a (possibly) composite filter- Parameters:
filter- the filter from which to extract a certain partpropertyId- the propertyId of the filter to extract- Returns:
-
flattenAnd
public static List<Filter> flattenAnd(And and)
Take a (nested) And filter and flatten it to a single level- Parameters:
and- the filter to flatten- Returns:
-
removeFilters
public static void removeFilters(Filter filter, String... propertyIds)
Removes filters with certain property IDs from a certain filter- Parameters:
filter- the filter to remove the filters frompropertyIds- the property IDs of the filters to remove
-
replaceMasterAndDetailFilters
public static void replaceMasterAndDetailFilters(Filter filter, EntityModel<?> entityModel)
Replaces all filters that query a detail relation by the appropriate filters- Parameters:
filter- the original filterentityModel- the entity model used to determine which filters must be replacedoverrideProperty- optional property - if supplied, then we the application will check this property instead of the property supplied in the original filters
-
replaceFilter
public static void replaceFilter(Filter original, Filter newFilter, String propertyId, boolean firstOnly)
Replaces a filter by another filter- Parameters:
original- the main filter that contains the filter to be replacednewFilter- the replacement filterpropertyId- the property ID of the filter to replacefirstOnly- indicates whether to replace only the first instance
-
-