@Test public void testConvert() { Searchable searchable = Searchable.newSearchable(); searchable.addSearchParam("username_like", "zhang"); searchable.addSearchParam("baseInfo.sex_eq", "male"); searchable.addSearchParam("id_in", new String[]{"1", "2", "3"}); searchable.convert(User.class); Assert.assertTrue(searchable.isConverted()); Assert.assertEquals(Sex.male, searchable.getValue("baseInfo.sex_eq")); Assert.assertEquals(3, ((ArrayList) searchable.getValue("id_in")).size()); Assert.assertTrue(((ArrayList) searchable.getValue("id_in")).contains(1L)); }
public abstract <T> Searchable convert(final Class<T> entityClass) throws InvalidSearchValueException, InvalidSearchPropertyException;
Searchable { public abstract <T> Searchable convert(final Class<T> entityClass) throws InvalidSearchValueException, InvalidSearchPropertyException; }
Searchable { public abstract <T> Searchable convert(final Class<T> entityClass) throws InvalidSearchValueException, InvalidSearchPropertyException;  }
Searchable { public abstract <T> Searchable convert(final Class<T> entityClass) throws InvalidSearchValueException, InvalidSearchPropertyException;  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 <T> Searchable convert(final Class<T> entityClass) throws InvalidSearchValueException, InvalidSearchPropertyException;  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);  }