SearchQuery implements Parcelable { @Keep @Api(2.0) @NonNull public static Builder builder() { return new Builder(); } protected  SearchQuery(); @SuppressWarnings("ResourceType") protected  SearchQuery(Parcel in); protected  SearchQuery(@NonNull Builder builder); @Override void writeToParcel(Parcel dest, int flags); @Keep @Api(2.0) @NonNull Builder newBuilder(); @Api(2.0) @Nullable List<String> getModuleIds(); @Keep @Api(2.0) @Nullable List<String> getInstanceIds(); @Keep @Api(2.0) @Nullable List<String> getFieldNames(); @Keep @Api(2.0) @Nullable List<String> getPopulateNames(); @Keep @Api(2.0) @Nullable PaginationCriteria getPagination(); @Keep @Api(2.0) @Nullable String getLocale(); @Keep @Api(2.0) void setLocale(@HaloLocale.LocaleDefinition String locale); @Keep @Api(2.0) @Nullable String getModuleName(); @Keep @Api(2.0) void setDevice(@Nullable Device device); @Keep @Api(2.0) @NonNull @SuppressWarnings("unchecked") String createHash(@NonNull Parser.Factory parser); @Keep @Api(2.0) boolean isPaginated(); @Keep @Api(2.0) @Nullable List<HaloSegmentationTag> getTags(); @Keep @Api(2.0) @Nullable SearchExpression getSearch(); @Keep @Api(2.0) @Nullable SearchExpression getMetaSearch(); @Keep @Api(2.0) @Nullable @SegmentMode String getSegmentMode(); @Keep @Api(2.4) String getSort(); @Keep @Api(2.0) long getTTL(); @Keep @Api(2.0) boolean isSegmentedWithDevice(); @Keep @Api(2.0) @NonNull static Builder builder(); @Keep @Api(2.0) @SuppressWarnings("unchecked") Parser<SearchQuery, String> serializerFrom(Parser.Factory parser); @Keep @Api(2.33) @NonNull int serverCache(); @Override int describeContents(); @Keep
    @Api(2.0)
    static final String TOTAL_MATCH; @Keep
    @Api(2.0)
    static final String PARTIAL_MATCH; static final Creator<SearchQuery> CREATOR; }
@Test public void SearchQueryEmptyTest() { assertEmptyquery(SearchQuery.builder().build()); }
@Test(expected = HaloConfigurationException.class) public void thatInvalidaPaginationOffsetParamThrowsException() { SearchQuery.builder().pagination(-1, 1); }
@Test(expected = HaloConfigurationException.class) public void thatInvalidaPaginationPageParamThrowsException() { SearchQuery.builder().pagination(1, -1); }
@Test(expected = HaloConfigurationException.class) public void thatDoubleConditionInSearchThrowsException() { SearchQuery.builder() .beginSearch() .and() .and() .end(); }
@Test(expected = HaloConfigurationException.class) public void thatDoubleOperationInSearchThrowsException() { SearchQuery.builder() .beginSearch() .eq("field1", "value1") .eq("field2", "value2") .end(); }
@Test(expected = HaloConfigurationException.class) public void thatBadAmountOfParenthesisInSearchThrowsException() { SearchQuery.builder() .beginSearch() .beginGroup() .beginGroup() .endGroup() .end(); }
@Test(expected = HaloConfigurationException.class) public void thatNoOperationInSearchThrowsException() { SearchQuery.builder() .beginSearch() .endGroup() .end(); }
@Test(expected = HaloConfigurationException.class) public void thatABadOrderThrowsException() { SearchQuery.builder() .beginSearch() .and() .eq("field1", "value1") .end(); }
@Test(expected = HaloConfigurationException.class) public void thatABadExpressionThrowsException() { SearchQuery.builder() .beginSearch() .or() .lt("field1", new Date()) .end(); }
@Test public void thatCanSearchToFilterTargetRelationships() { SearchQuery query = SearchQuery.builder() .addRelatedInstances(Relationship.create("fieldname", "1")) .addRelatedInstances(Relationship.create("fieldname", "2")) .build(); assertThat(query.mRelationships.size()).isEqualTo(2); assertTrue(query.mRelationships.get(0).getFieldName().equals("fieldname")); }
@Test public void thatCanSearchToFilterTargetRelationshipsWithAArrayGiven() { SearchQuery query = SearchQuery.builder() .relatedInstances(new Relationship[]{Relationship.create("fieldname", "1"), Relationship.create("fieldname", "2")}) .build(); assertThat(query.mRelationships.size()).isEqualTo(2); assertTrue(query.mRelationships.get(0).getFieldName().equals("fieldname")); }