Package org.genesys.blocks.model.filters
Class SuperModelFilter<T extends SuperModelFilter<T,R>,R>
- java.lang.Object
-
- org.genesys.blocks.model.filters.SuperModelFilter<T,R>
-
- Type Parameters:
T- the generic typeR- the generic type
- All Implemented Interfaces:
Serializable,Filter
- Direct Known Subclasses:
EmptyModelFilter
public abstract class SuperModelFilter<T extends SuperModelFilter<T,R>,R> extends Object implements Filter
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description TANDThe AND filters, but not serialized.TNOTThe negative filters, but don't de-/serialize it's own NOT-properties.Set<String>NOTNULLNames of properties to test with .isNotNull()Set<String>NULLNames of properties to test with .isNull()TORThe OR filters, but not serialized.
-
Constructor Summary
Constructors Constructor Description SuperModelFilter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String[]boostedFields()Return the fields boosted in ES searchcom.querydsl.core.BooleanBuilderbuildPredicate()Builds the DSL predicate.voidclearFilter(String jsonPath)voidclearFilter(String jsonPath, boolean clearNullAndNotNull)abstract List<com.querydsl.core.types.Predicate>collectPredicates()protected List<com.querydsl.core.types.Predicate>collectPredicates(com.querydsl.core.types.dsl.EntityPathBase<R> instance)Collects list of this filter predicates.<X> Xcopy(Class<X> targetType)Copy by serializing to JSON and de-serializing to specified type.protected Set<Class<? extends com.querydsl.core.types.dsl.EntityPathBase<? extends R>>>getSubClasses()booleanisEmpty()Does the property filter specify any conditions?static <Y extends SuperModelFilter<Y,?>>
Ynormalize(Y filter)Prepare filter for use.Map<String,String>remappedProperties()Return the map of remapped propsprotected voidremoveFromNullAndNotNull(String jsonPath)StringtoString()
-
-
-
Field Detail
-
NOT
public T extends SuperModelFilter<T,R> NOT
The negative filters, but don't de-/serialize it's own NOT-properties.
-
AND
public T extends SuperModelFilter<T,R> AND
The AND filters, but not serialized.
-
OR
public T extends SuperModelFilter<T,R> OR
The OR filters, but not serialized.
-
-
Method Detail
-
isEmpty
public final boolean isEmpty()
Does the property filter specify any conditions?
-
collectPredicates
public abstract List<com.querydsl.core.types.Predicate> collectPredicates()
-
boostedFields
public String[] boostedFields()
Return the fields boosted in ES search- Returns:
- null -- no fields boosted
-
remappedProperties
public Map<String,String> remappedProperties()
Return the map of remapped props- Returns:
- null -- no props remapped
-
buildPredicate
public com.querydsl.core.BooleanBuilder buildPredicate()
Builds the DSL predicate.- Returns:
- the predicate
-
collectPredicates
protected List<com.querydsl.core.types.Predicate> collectPredicates(com.querydsl.core.types.dsl.EntityPathBase<R> instance)
Collects list of this filter predicates. Does not include NOT, OR and AND. Those are used inbuildPredicate()!- Parameters:
instance- the instance of Q-type of R- Returns:
- list of predicates
-
clearFilter
public void clearFilter(String jsonPath) throws NoSuchFieldException, IllegalAccessException
-
clearFilter
public final void clearFilter(String jsonPath, boolean clearNullAndNotNull) throws NoSuchFieldException, IllegalAccessException
-
removeFromNullAndNotNull
protected final void removeFromNullAndNotNull(String jsonPath)
-
getSubClasses
protected Set<Class<? extends com.querydsl.core.types.dsl.EntityPathBase<? extends R>>> getSubClasses()
-
copy
public <X> X copy(Class<X> targetType)
Copy by serializing to JSON and de-serializing to specified type.- Type Parameters:
X- the generic type- Parameters:
targetType- the target type- Returns:
- the x
-
normalize
public static <Y extends SuperModelFilter<Y,?>> Y normalize(Y filter)
Prepare filter for use. NULL and NOTNULLs will clear any actual values provided for those properties.- Type Parameters:
Y- any SuperModelFilter subtype- Parameters:
filter- the filter- Returns:
- the normalized valid filter
-
-