Package com.cbe

Class Filter

java.lang.Object
com.cbe.Filter

public class Filter extends Object
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.
  • Field Details

    • swigCMemOwn

      protected transient boolean swigCMemOwn
  • Constructor Details

    • Filter

      public Filter(long cPtr, boolean cMemoryOwn)
    • Filter

      public Filter()
    • Filter

      public Filter(Filter rh)
  • Method Details

    • getCPtr

      public static long getCPtr(Filter obj)
    • finalize

      public void finalize()
      Overrides:
      finalize in class Object
    • delete

      public void delete()
    • getDataType

      public ItemType getDataType()
      Returns the requested data type.

      Such as ItemType e.g.,

      • cbe::ItemType::Container

      • cbe::ItemType::Object

      • cbe::ItemType::Group

    • getQuery

      public String 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

      public FilterOrder getItemOrder()
      Returns the order the query was sorted.

      Check enum FilterOrder to see
      options for sorting.
    • container

      public Container container()
      Returns the parent container that was queried, if it is in the cache.
      This is after a query was done, not before.
    • setDataType

      public Filter setDataType(ItemType itemType)
      Set which datatypes to query for.

      Parameters:
      itemType - as defined in Types.h
    • setQuery

      public Filter setQuery(String query)
      Set the query string.

      E.g., firstname:*
      (would search for all objects with the metadata key labeled firstname ).

      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

      public Filter setAscending(boolean ascending)
      Sets the order, ascending , in which data should be displayed.

      Parameters:
      ascending - true = sorted in increasing order

      false = sorted in decreasing order
    • setDeleted

      public Filter setDeleted(boolean deleted)
      Whether to include deleted items.

      Parameters:
      deleted - true = include items in the bin

      default is false
    • setContainerFirst

      public Filter setContainerFirst(boolean containerFirst)
      If Container should be displayed before Object

      Parameters:
      containerFirst - true = sort containers at the top of the resultset.

      default is to not sort for this.
    • setOffset

      public Filter setOffset(long offset)
      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

      public Filter setCount(long count)
      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

      public Filter setItemOrder(FilterOrder order)
      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 enum FilterOrder in Types.h
    • setByPassCache

      public Filter setByPassCache(boolean byPassCache)
      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.