public sealed class Filter : IMessage<Filter>, IEquatable<Filter>, IDeepCloneable<Filter>, IBufferMessage, IMessage
A holder for any type of filter.
Namespace
Google.Cloud.Datastore.V1Assembly
Google.Cloud.Datastore.V1.dll
Constructors
Filter()
public Filter()
Filter(Filter)
public Filter(Filter other)
Parameter | |
---|---|
Name | Description |
other | Filter |
Properties
CompositeFilter
public CompositeFilter CompositeFilter { get; set; }
A composite filter.
Property Value | |
---|---|
Type | Description |
CompositeFilter |
FilterTypeCase
public Filter.FilterTypeOneofCase FilterTypeCase { get; }
Property Value | |
---|---|
Type | Description |
Filter.FilterTypeOneofCase |
PropertyFilter
public PropertyFilter PropertyFilter { get; set; }
A filter on a property.
Property Value | |
---|---|
Type | Description |
PropertyFilter |
Methods
And(Filter[])
public static Filter And(params Filter[] filters)
Creates a composite filter which is the logical "AND" of all the specified filters.
Parameter | |
---|---|
Name | Description |
filters | Filter[] Set of filters to combine. Must not be null or empty, or contain null references. |
Returns | |
---|---|
Type | Description |
Filter | A filter representing the logical "AND" of all the elements in |
And(IEnumerable<Filter>)
public static Filter And(IEnumerable<Filter> filters)
Creates a composite filter which is the logical "AND" of all the specified filters.
Parameter | |
---|---|
Name | Description |
filters | IEnumerable<Filter> Set of filters to combine. Must not be null or empty, or contain null references. |
Returns | |
---|---|
Type | Description |
Filter | A filter representing the logical "AND" of all the elements in |
Equal(String, Value)
public static Filter Equal(string propertyName, Value propertyValue)
Creates a filter to check that the specified property is equal to a given value.
Parameters | |
---|---|
Name | Description |
propertyName | String The name of the property. Must not be null. |
propertyValue | Value The value to compare against. May be null, which indicates a value with NullValue set. |
Returns | |
---|---|
Type | Description |
Filter | The newly created filter. |
GreaterThan(String, Value)
public static Filter GreaterThan(string propertyName, Value propertyValue)
Creates a filter to check that the specified property is greater than a given value.
Parameters | |
---|---|
Name | Description |
propertyName | String The name of the property. Must not be null. |
propertyValue | Value The value to compare against. May be null, which indicates a value with NullValue set. |
Returns | |
---|---|
Type | Description |
Filter | The newly created filter. |
GreaterThanOrEqual(String, Value)
public static Filter GreaterThanOrEqual(string propertyName, Value propertyValue)
Creates a filter to check that the specified property is greater than or equal to a given value.
Parameters | |
---|---|
Name | Description |
propertyName | String The name of the property. Must not be null. |
propertyValue | Value The value to compare against. May be null, which indicates a value with NullValue set. |
Returns | |
---|---|
Type | Description |
Filter | The newly created filter. |
HasAncestor(Key)
public static Filter HasAncestor(Key ancestorKey)
Creates a filter to check that an entity has the specified key as an ancestor.
Parameter | |
---|---|
Name | Description |
ancestorKey | Key The key to check against. Must not be null. |
Returns | |
---|---|
Type | Description |
Filter | The newly created filter. |
LessThan(String, Value)
public static Filter LessThan(string propertyName, Value propertyValue)
Creates a filter to check that the specified property is less than a given value.
Parameters | |
---|---|
Name | Description |
propertyName | String The name of the property. Must not be null. |
propertyValue | Value The value to compare against. May be null, which indicates a value with NullValue set. |
Returns | |
---|---|
Type | Description |
Filter | The newly created filter. |
LessThanOrEqual(String, Value)
public static Filter LessThanOrEqual(string propertyName, Value propertyValue)
Creates a filter to check that the specified property is less than or equal to a given value.
Parameters | |
---|---|
Name | Description |
propertyName | String The name of the property. Must not be null. |
propertyValue | Value The value to compare against. May be null, which indicates a value with NullValue set. |
Returns | |
---|---|
Type | Description |
Filter | The newly created filter. |
Property(String, Value, PropertyFilter.Types.Operator)
public static Filter Property(string propertyName, Value propertyValue, PropertyFilter.Types.Operator op)
Creates a filter comparing the specified property with a given value, using a specified operator.
Parameters | |
---|---|
Name | Description |
propertyName | String The name of the property. Must not be null. |
propertyValue | Value The value to compare against. May be null, which indicates a value with NullValue set. |
op | PropertyFilter.Types.Operator The comparison operator to use. Must be one of the PropertyFilter.Types.Operator values,
and not |
Returns | |
---|---|
Type | Description |
Filter | The newly created filter. |
If the operator is known in advance, methods such as Equal(String, Value) and GreaterThan(String, Value) usually allow for better readability. This method is intended for situations where the operator is only known dynamically.