@Test public void testModifiedWithin() { final Date fromDate = new Date(); final Date toDate = new DateWrapper(fromDate).addDays(2).asDate(); final String expectedValue = setModifiedWithin(fromDate, toDate); String result = new DataSearchQueryBuilder(dsf, userInfoMock).modifiedWithin().toString(); assertEquals(wrappedQuery(expectedValue), result); }
public DataSearchQueryBuilder modifiedWithin() { if ((dsf.getModifiedWithin() != null)) { Date dateFrom = dsf.getModifiedWithin().getFrom(); Date dateTo = dsf.getModifiedWithin().getTo(); if ((dateFrom != null) && (dateTo != null)) { Splittable range = createRangeQuery(DATE_MODIFIED, dateFrom.getTime(), dateTo.getTime()); appendArrayItem(mustList, range); } else if (dateFrom != null) { Splittable range = createMinRangeQuery(DATE_MODIFIED, dateFrom.getTime()); appendArrayItem(mustList, range); } else if (dateTo != null) { Splittable range = createMaxRangeQuery(DATE_MODIFIED, dateTo.getTime()); appendArrayItem(mustList, range); } } return this; }
DataSearchQueryBuilder { public DataSearchQueryBuilder modifiedWithin() { if ((dsf.getModifiedWithin() != null)) { Date dateFrom = dsf.getModifiedWithin().getFrom(); Date dateTo = dsf.getModifiedWithin().getTo(); if ((dateFrom != null) && (dateTo != null)) { Splittable range = createRangeQuery(DATE_MODIFIED, dateFrom.getTime(), dateTo.getTime()); appendArrayItem(mustList, range); } else if (dateFrom != null) { Splittable range = createMinRangeQuery(DATE_MODIFIED, dateFrom.getTime()); appendArrayItem(mustList, range); } else if (dateTo != null) { Splittable range = createMaxRangeQuery(DATE_MODIFIED, dateTo.getTime()); appendArrayItem(mustList, range); } } return this; } }
DataSearchQueryBuilder { public DataSearchQueryBuilder modifiedWithin() { if ((dsf.getModifiedWithin() != null)) { Date dateFrom = dsf.getModifiedWithin().getFrom(); Date dateTo = dsf.getModifiedWithin().getTo(); if ((dateFrom != null) && (dateTo != null)) { Splittable range = createRangeQuery(DATE_MODIFIED, dateFrom.getTime(), dateTo.getTime()); appendArrayItem(mustList, range); } else if (dateFrom != null) { Splittable range = createMinRangeQuery(DATE_MODIFIED, dateFrom.getTime()); appendArrayItem(mustList, range); } else if (dateTo != null) { Splittable range = createMaxRangeQuery(DATE_MODIFIED, dateTo.getTime()); appendArrayItem(mustList, range); } } return this; } DataSearchQueryBuilder(DiskResourceQueryTemplate dsf, UserInfo userinfo); }
DataSearchQueryBuilder { public DataSearchQueryBuilder modifiedWithin() { if ((dsf.getModifiedWithin() != null)) { Date dateFrom = dsf.getModifiedWithin().getFrom(); Date dateTo = dsf.getModifiedWithin().getTo(); if ((dateFrom != null) && (dateTo != null)) { Splittable range = createRangeQuery(DATE_MODIFIED, dateFrom.getTime(), dateTo.getTime()); appendArrayItem(mustList, range); } else if (dateFrom != null) { Splittable range = createMinRangeQuery(DATE_MODIFIED, dateFrom.getTime()); appendArrayItem(mustList, range); } else if (dateTo != null) { Splittable range = createMaxRangeQuery(DATE_MODIFIED, dateTo.getTime()); appendArrayItem(mustList, range); } } return this; } DataSearchQueryBuilder(DiskResourceQueryTemplate dsf, UserInfo userinfo); String buildFullQuery(); String taggedWith(); DataSearchQueryBuilder ownedBy(); DataSearchQueryBuilder createdWithin(); DataSearchQueryBuilder file(); DataSearchQueryBuilder fileSizeRange(); String getQuery(); DataSearchQueryBuilder metadataAttribute(); DataSearchQueryBuilder metadataValue(); DataSearchQueryBuilder modifiedWithin(); DataSearchQueryBuilder negatedFile(); DataSearchQueryBuilder sharedWith(); @Override String toString(); Splittable getSimpleQuery(String field, String userEntry); }
DataSearchQueryBuilder { public DataSearchQueryBuilder modifiedWithin() { if ((dsf.getModifiedWithin() != null)) { Date dateFrom = dsf.getModifiedWithin().getFrom(); Date dateTo = dsf.getModifiedWithin().getTo(); if ((dateFrom != null) && (dateTo != null)) { Splittable range = createRangeQuery(DATE_MODIFIED, dateFrom.getTime(), dateTo.getTime()); appendArrayItem(mustList, range); } else if (dateFrom != null) { Splittable range = createMinRangeQuery(DATE_MODIFIED, dateFrom.getTime()); appendArrayItem(mustList, range); } else if (dateTo != null) { Splittable range = createMaxRangeQuery(DATE_MODIFIED, dateTo.getTime()); appendArrayItem(mustList, range); } } return this; } DataSearchQueryBuilder(DiskResourceQueryTemplate dsf, UserInfo userinfo); String buildFullQuery(); String taggedWith(); DataSearchQueryBuilder ownedBy(); DataSearchQueryBuilder createdWithin(); DataSearchQueryBuilder file(); DataSearchQueryBuilder fileSizeRange(); String getQuery(); DataSearchQueryBuilder metadataAttribute(); DataSearchQueryBuilder metadataValue(); DataSearchQueryBuilder modifiedWithin(); DataSearchQueryBuilder negatedFile(); DataSearchQueryBuilder sharedWith(); @Override String toString(); Splittable getSimpleQuery(String field, String userEntry); static final String METADATA_VALUE; static final String METADATA_ATTRIBUTE; static final String FIELDS; static final String QUERY_STRING; static final String LESSER; static final String GREATER; static final String RANGE2; static final String WILDCARD; static final String OR_OPERATOR; static final String DATE_MODIFIED; static final String QUERY2; static final String PATH; static final String METADATA2; static final String NESTED2; static final String HAS_CHILD; static final String FILE_SIZE; static final String LABEL; static final String DATE_CREATED; static final String BOOL; }