Class Filter
- java.lang.Object
-
- dev.morphia.query.experimental.filters.Filter
-
- Direct Known Subclasses:
GeoIntersectsFilter
,GeoWithinFilter
,NearFilter
,RegexFilter
,TextSearchFilter
public class Filter extends Object
Base class for query filters- Since:
- 2.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
encode(Mapper mapper, org.bson.BsonWriter writer, org.bson.codecs.EncoderContext context)
Filter
entityType(Class<?> type)
Sets the query entity type on the filterprotected String
field(Mapper mapper)
protected String
getFilterName()
protected Object
getValue()
protected Object
getValue(Mapper mapper)
protected boolean
isNot()
Filter
isValidating(boolean validate)
Sets whether to validate field names or notFilter
not()
Negates this filter by wrapping in "$not: {}"String
toString()
protected void
writeNamedValue(String name, Object named, Mapper mapper, org.bson.BsonWriter writer, org.bson.codecs.EncoderContext encoderContext)
protected void
writeUnnamedValue(Object value, Mapper mapper, org.bson.BsonWriter writer, org.bson.codecs.EncoderContext encoderContext)
-
-
-
Method Detail
-
isNot
protected boolean isNot()
-
encode
public void encode(Mapper mapper, org.bson.BsonWriter writer, org.bson.codecs.EncoderContext context)
- Parameters:
mapper
- the mapperwriter
- the writercontext
- the context
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
entityType
public Filter entityType(Class<?> type)
Sets the query entity type on the filter- Parameters:
type
- the type- Returns:
- this
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
isValidating
public Filter isValidating(boolean validate)
Sets whether to validate field names or not- Parameters:
validate
- true to validate- Returns:
- this
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
not
public Filter not()
Negates this filter by wrapping in "$not: {}"- Returns:
- this
- MongoDB documentation
- Query Filter: $not
-
getFilterName
protected String getFilterName()
-
getValue
protected Object getValue()
-
writeNamedValue
protected void writeNamedValue(String name, Object named, Mapper mapper, org.bson.BsonWriter writer, org.bson.codecs.EncoderContext encoderContext)
-
-