Interface AbstractQueryHelper

  • All Known Implementing Classes:
    DefaultAbstractQueryHelper

    public interface AbstractQueryHelper
    This helper interface is to create a new search query object with the given query to be set in it.

    The reason behind this helper interface is both of FlexibleSearchQuery and GenericSearchQuery have final attribute signature for query attribute. This results no setter for query attribute, so a new search query object has to be instantiated with constructor to set the query and other attributes have to be copied over.

    Use case of this helper is to update the query of FlexibleSearchQuery or GenericSearchQuery

    • Method Detail

      • getUpdatedFlexibleSearchQuery

        <T extends FlexibleSearchQuery> T getUpdatedFlexibleSearchQuery​(FlexibleSearchQuery original,
                                                                        java.lang.String query)
        Get an updated FlexibleSearchQuery of the given original one by setting the query with the given parameter
        Type Parameters:
        T - the subclass type of FlexibleSearchQuery to be returned
        Parameters:
        original - the original FlexibleSearchQuery object
        query - the query needs to be set in the FlexibleSearchQuery
        Returns:
        the updated FlexibleSearchQuery of original one by setting the query with the given parameter
        Throws:
        java.lang.IllegalArgumentException - if the given original or query is null
      • getUpdatedGenericSearchQuery

        <T extends GenericSearchQuery> T getUpdatedGenericSearchQuery​(GenericSearchQuery original,
                                                                      GenericQuery query)
        Get an updated GenericSearchQuery of the given original one by setting the query with the given parameter
        Type Parameters:
        T - the subclass of type GenericSearchQuery to be returned
        Parameters:
        original - the original GenericSearchQuery object
        query - the query needs to be set in the GenericSearchQuery
        Returns:
        the updated GenericSearchQuery of original one by setting the query with the given parameter
        Throws:
        java.lang.IllegalArgumentException - if the given original or query is null