Package com.cbe
Class Filter
java.lang.Object
com.cbe.Filter
Use to select Item that meets specific criterias when doing a query.
Filtering on metadata KeyValues can be done with setQuery()
and only to query for Object, not Container.
Filtering on metadata KeyValues can be done with setQuery()
and only to query for Object, not Container.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the parent container that was queried, if it is in the cache.void
delete()
void
finalize()
boolean
Returns the settings on how the data was sorted and displayed.boolean
Returns if skipping the cache was used or not.boolean
Determines if containers should be sorted before objects.long
getCount()
Returns the size of the resultset of the query.static long
Returns the requested data type.boolean
Determines if deleted objects in the bin are included.Returns the order the query was sorted.long
Determines the offset of items to be skiped.getQuery()
Returns the query string that was set on the filter.boolean
Determines if the resultset comes from a joined query.setAscending
(boolean ascending) Sets the order,ascending
, in which data should be displayed.setByPassCache
(boolean byPassCache) Set to ignore the local SDK cache.setContainerFirst
(boolean containerFirst) IfContainer
should be displayed beforeObject
setCount
(long count) Set the maximum resultset.setDataType
(ItemType itemType) Set whichdatatypes
to query for.setDeleted
(boolean deleted) Whether to include deleted items.setItemOrder
(FilterOrder order) Set the order of how data will be shown by the enum of FilterOrder.setOffset
(long offset) Set the offset for paging.Set the query string.
-
Field Details
-
swigCMemOwn
protected transient boolean swigCMemOwn
-
-
Constructor Details
-
Filter
public Filter(long cPtr, boolean cMemoryOwn) -
Filter
public Filter() -
Filter
-
-
Method Details
-
getCPtr
-
finalize
public void finalize() -
delete
public void delete() -
getDataType
Returns the requested data type.
Such as ItemType e.g.,
- cbe::ItemType::Container
- cbe::ItemType::Object
- cbe::ItemType::Group
-
getQuery
Returns the query string that was set on the filter.
Query string e.g.,
- name:Abc*
- age:100
- price<200
- size>40
-
getAscending
public boolean getAscending()Returns the settings on how the data was sorted and displayed. -
getDeleted
public boolean getDeleted()Determines if deleted objects in the bin are included. -
getContainerFirst
public boolean getContainerFirst()Determines if containers should be sorted before objects. -
isJoinedResult
public boolean isJoinedResult()Determines if the resultset comes from a joined query. -
getOffset
public long getOffset()Determines the offset of items to be skiped.
Returns the offset of items in the beginning of total resultset
to be skiped,
that was used for the filter in the query. -
getCount
public long getCount()Returns the size of the resultset of the query. -
getByPassCache
public boolean getByPassCache()Returns if skipping the cache was used or not. -
getItemOrder
Returns the order the query was sorted.
Check enumFilterOrder
to see
options for sorting. -
container
Returns the parent container that was queried, if it is in the cache.
This is after a query was done, not before. -
setDataType
Set whichdatatypes
to query for.
- Parameters:
itemType
- as defined in Types.h
-
setQuery
Set the query string.
E.g., firstname:*
(would search for all objects with the metadata key labeledfirstname
).
Search string e.g.,
- name:Abc*
- age:100
- price<200
- size>40
Note: If used with rootContainer id as the dataId to search in,
the whole account will be searched.
- Parameters:
query
- is a string of key tags or key:value pairs.
E.g. Name:*|Country:Sweden|Country:Norway
This will search for objects
with key Name but any value and
where key Country is either Sweden or Norway.
-
setAscending
Sets the order,ascending
, in which data should be displayed.
- Parameters:
ascending
- true = sorted in increasing order
false = sorted in decreasing order
-
setDeleted
Whether to include deleted items.
- Parameters:
deleted
- true = include items in the bin
default is false
-
setContainerFirst
IfContainer
should be displayed beforeObject
- Parameters:
containerFirst
- true = sort containers at the top of the resultset.
default is to not sort for this.
-
setOffset
Set the offset for paging.
Offset is the item offset where to start your resultset.
E.g.:
There is already a query resultset of the first 100 items and
to get the rest you put setOffset() to 100 to get the next resultset
from 101-.
- Parameters:
offset
- first item start number of the complete resultset to return
-
setCount
Set the maximum resultset.
Set the maximum number of items you want to get from a container.
E.g.: a container has 50 items but you only want the 10 first in ascending
order then set ascending to true and setCount to 10.
- Parameters:
count
- maximum number of items to return
-
setItemOrder
Set the order of how data will be shown by the enum of FilterOrder.
E.g.: Title first, Relevance, published e.t.c.
- Parameters:
order
- see the enumFilterOrder
in Types.h
-
setByPassCache
Set to ignore the local SDK cache.
Instead allways fetch the resultset from the cloud.
- Parameters:
byPassCache
- true = skip the SDK cache and ask the cloud.
default is to use the cache when available.
-