@Test public void testAddSearchFilter() { Searchable searchable = Searchable.newSearchable(); searchable.addSearchFilter("age", SearchOperator.like, "123"); searchable.addSearchFilter("name", SearchOperator.custom, "234"); searchable.addSearchFilter(SearchFilterHelper.newCondition("sex_like", "male")); searchable.addSearchFilter(SearchFilterHelper.newCondition("birthday_custom", "2012")); searchable.addSearchFilter(SearchFilterHelper.newCondition("realname", "123")); searchable.addSearchFilter(SearchFilterHelper.newCondition("a", SearchOperator.eq, "234")); searchable.addSearchFilter(SearchFilterHelper.newCondition("b", SearchOperator.custom, "234")); Assert.assertTrue(searchable.containsSearchKey("age_like")); Assert.assertTrue(searchable.containsSearchKey("name")); Assert.assertTrue(searchable.containsSearchKey("name_custom")); Assert.assertTrue(searchable.containsSearchKey("sex_like")); Assert.assertTrue(searchable.containsSearchKey("birthday")); Assert.assertTrue(searchable.containsSearchKey("birthday_custom")); Assert.assertTrue(searchable.containsSearchKey("realname")); Assert.assertTrue(searchable.containsSearchKey("realname_custom")); Assert.assertTrue(searchable.containsSearchKey("a_eq")); Assert.assertTrue(searchable.containsSearchKey("b_custom")); Assert.assertTrue(searchable.containsSearchKey("b")); }
public abstract Searchable addSearchFilter( final String searchProperty, final SearchOperator operator, final Object value) throws SearchException;
Searchable { public abstract Searchable addSearchFilter( final String searchProperty, final SearchOperator operator, final Object value) throws SearchException; }
Searchable { public abstract Searchable addSearchFilter( final String searchProperty, final SearchOperator operator, final Object value) throws SearchException;  }
Searchable { public abstract Searchable addSearchFilter( final String searchProperty, final SearchOperator operator, final Object value) throws SearchException;  static Searchable newSearchable(); static Searchable newSearchable(final Map<String, Object> searchParams); static Searchable newSearchable(final Map<String, Object> searchParams, final Pageable page); static Searchable newSearchable(final Map<String, Object> searchParams, final Sort sort); static Searchable newSearchable(final Map<String, Object> searchParams, final Pageable page, final Sort sort); abstract Searchable addSearchParam(final String key, final Object value); abstract Searchable addSearchParams(final Map<String, Object> searchParams); abstract Searchable addSearchFilter(
            final String searchProperty, final SearchOperator operator, final Object value); abstract Searchable addSearchFilter(final SearchFilter searchFilter); abstract Searchable addSearchFilters(final Collection<? extends SearchFilter> searchFilters); abstract Searchable or(final SearchFilter first, final SearchFilter... others); abstract Searchable and(final SearchFilter first, final SearchFilter... others); abstract Searchable removeSearchFilter(final String key); abstract Searchable removeSearchFilter(String searchProperty, SearchOperator operator); abstract Searchable convert(final Class<T> entityClass); abstract Searchable markConverted(); abstract Searchable setPage(final Pageable page); abstract Searchable setPage(final int pageNumber, final int pageSize); abstract Searchable addSort(final Sort sort); abstract Searchable addSort(final Sort.Direction direction, String property); abstract Collection<SearchFilter> getSearchFilters(); abstract boolean isConverted(); abstract boolean hasSearchFilter(); abstract boolean hashSort(); abstract void removeSort(); abstract boolean hasPageable(); abstract void removePageable(); abstract Pageable getPage(); abstract Sort getSort(); abstract boolean containsSearchKey(final String key); abstract T getValue(final String key); }
Searchable { public abstract Searchable addSearchFilter( final String searchProperty, final SearchOperator operator, final Object value) throws SearchException;  static Searchable newSearchable(); static Searchable newSearchable(final Map<String, Object> searchParams); static Searchable newSearchable(final Map<String, Object> searchParams, final Pageable page); static Searchable newSearchable(final Map<String, Object> searchParams, final Sort sort); static Searchable newSearchable(final Map<String, Object> searchParams, final Pageable page, final Sort sort); abstract Searchable addSearchParam(final String key, final Object value); abstract Searchable addSearchParams(final Map<String, Object> searchParams); abstract Searchable addSearchFilter(
            final String searchProperty, final SearchOperator operator, final Object value); abstract Searchable addSearchFilter(final SearchFilter searchFilter); abstract Searchable addSearchFilters(final Collection<? extends SearchFilter> searchFilters); abstract Searchable or(final SearchFilter first, final SearchFilter... others); abstract Searchable and(final SearchFilter first, final SearchFilter... others); abstract Searchable removeSearchFilter(final String key); abstract Searchable removeSearchFilter(String searchProperty, SearchOperator operator); abstract Searchable convert(final Class<T> entityClass); abstract Searchable markConverted(); abstract Searchable setPage(final Pageable page); abstract Searchable setPage(final int pageNumber, final int pageSize); abstract Searchable addSort(final Sort sort); abstract Searchable addSort(final Sort.Direction direction, String property); abstract Collection<SearchFilter> getSearchFilters(); abstract boolean isConverted(); abstract boolean hasSearchFilter(); abstract boolean hashSort(); abstract void removeSort(); abstract boolean hasPageable(); abstract void removePageable(); abstract Pageable getPage(); abstract Sort getSort(); abstract boolean containsSearchKey(final String key); abstract T getValue(final String key);  }