Class TokenFilter


  • public class TokenFilter
    extends Object
    Describes a collection of filters which can be applied to the CTS query function as part of a complex query. This filter only currently supports single type And/Or filtering. This is not a technical limitation and can be extended in the future.
    • Method Detail

      • getQuery

        public QueryFilter<CoreTokenField> getQuery()
        Inspect the CoreTokenField, Object pairs that have been assigned as filters.
        Returns:
        An unmodifiable Map of filter components.
      • setQuery

        public void setQuery​(QueryFilter<CoreTokenField> query)
        Set the query component to the Filter.
        Parameters:
        query - Non null query.
      • getSizeLimit

        public int getSizeLimit()
        Get the size limit of the query.
        Returns:
        the size limit.
      • getTimeLimit

        public Duration getTimeLimit()
        Get the time limit of the query.
        Returns:
        the time limit.
      • setTimeLimit

        public void setTimeLimit​(Duration timeLimit)
        Set the time limit of the query.
        Parameters:
        timeLimit - the duration the query may last.
      • getReturnFields

        public Set<CoreTokenField> getReturnFields()
        The current set of return fields. If this collection is empty, this indicates that all fields are to be returned.
        Returns:
        A non null, possibly empty, non-modifiable Set of return attributes.
      • addReturnAttribute

        public void addReturnAttribute​(CoreTokenField field)
        Assigns an attribute to be part of the return attributes. When a return attribute is provided, the return results of the query will only populate the indicated return attributes. The default is for all attributes to be returned, unless the query constrains the results using this function.
        Parameters:
        field - The CoreTokenField to include in the return results.
      • toString

        public String toString()
        A multi-line representation of the filter.
        Overrides:
        toString in class Object
        Returns:
        Non null.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object