DataQueryParams { public Date getEarliestStartDate() { Date earliestStartDate = new Date( Long.MAX_VALUE ); if ( startDate != null && startDate.before( earliestStartDate ) ) { earliestStartDate = startDate; } for ( DimensionalItemObject object : getAllPeriods() ) { Period period = (Period) object; earliestStartDate = period.getStartDate().before( earliestStartDate ) ? period.getStartDate() : earliestStartDate; } return earliestStartDate; } protected  DataQueryParams(); static Builder newBuilder(); static Builder newBuilder( DataQueryParams params ); T copyTo( T params ); String getKey(); String getSequentialQueryGroupKey(); ListMap<String, DimensionalObject> getDimensionFilterMap(); int getPeriodDimensionIndex(); Collection<DimensionalObject> getDimensionsAsFilters(); boolean hasPeriods(); Period getLatestPeriod(); Date getLatestEndDate(); Date getEarliestStartDate(); boolean hasOrganisationUnits(); PeriodType getFilterPeriodType(); Period getFilterPeriod(); List<Period> getTypedFilterPeriods(); List<DimensionalObject> getDuplicateDimensions(); Map<String, PeriodType> getDataSetPeriodTypeMap(); List<DimensionalObject> getOrgUnitLevelsAsDimensions(); boolean isDataType( DataType dataType ); boolean hasAggregationType(); boolean isDisaggregation(); boolean isAggregation(); boolean isAggregationType( AggregationType type ); boolean isOutputFormat( OutputFormat format ); ListMap<DimensionalItemObject, DimensionalItemObject> getDataPeriodAggregationPeriodMap(); List<List<DimensionItem>> getDimensionItemPermutations(); List<DimensionalItemObject> getDataDimensionAndFilterOptions(); List<DimensionalItemObject> getDimensionOptions( String dimension ); DimensionalObject getDimension( String dimension ); DimensionalObject getDimensionOrFilter( String dimension ); List<DimensionalItemObject> getFilterOptions( String filter ); List<DimensionalItemObject> getFilterOptions( String filter, DataDimensionItemType dataDimensionItemType ); DimensionalObject getFilter( String filter ); List<DimensionalItemObject> getFilterItems(); List<DimensionalObject> getDimensionsAndFilters(); List<DimensionalObject> getDimensionsAndFilters( DimensionType dimensionType ); List<DimensionalObject> getDimensionsAndFilters( Set<DimensionType> dimensionTypes ); boolean containsOnlyDimensionsAndFilters( Set<DimensionType> dimensionTypes ); List<DimensionalItemObject> getDimensionOrFilterItems( String key ); List<DimensionalItemObject> getDimensionalItemObjects( DimensionType dimensionType ); List<DimensionalItemObject> getDimensionItemsExplodeCoc( String dimension ); List<EventAnalyticsDimensionalItem> getEventReportDimensionalItemArrayExploded( String dimension ); boolean hasDimensionOrFilter( String key ); boolean hasDimensionOrFilterWithItems( String key ); boolean hasDimension( String key ); boolean hasFilter( String key ); Set<DimensionType> getDimensionTypes(); int getDaysForAvgSumIntAggregation(); boolean hasNonUidOutputIdScheme(); boolean isDataApproval(); boolean hasApprovalLevel(); List<DimensionalItemObject> getAllDimensionItems(); boolean hasPartitions(); boolean hasDataPeriodType(); boolean hasStartEndDate(); boolean startDateAfterEndDate(); boolean hasStartEndDateRestriction(); boolean hasOrder(); boolean hasTimeField(); String getTimeFieldAsField(); String getTimeFieldAsFieldFallback(); boolean hasOrgUnitField(); String getOrgUnitFieldFallback(); boolean hasProgram(); boolean hasProgramStage(); boolean hasMeasureCriteria(); boolean hasPreAggregateMeasureCriteria(); boolean hasProcessingHint( ProcessingHint hint ); boolean hasSingleIndicatorAsDataFilter(); boolean hasSingleReportingRateAsDataFilter(); boolean hasCurrentUser(); boolean hasProgramIndicatorDimension(); DataElementGroup getFirstDataElementGroup(); static Map<String, List<DimensionItemObjectValue>> getPermutationDimensionalItemValueMap(
        MultiValuedMap<String, DimensionItemObjectValue> aggregatedDataMap ); static Map<String, Map<String, Integer>> getPermutationOrgUnitGroupCountMap( Map<String, Double> orgUnitCountMap ); static Map<MeasureFilter, Double> getMeasureCriteriaFromParam( String param ); @Override int hashCode(); @Override boolean equals( Object object ); @Override String toString(); List<DimensionalObject> getDimensions(); List<DimensionalObject> getFilters(); AnalyticsAggregationType getAggregationType(); Map<MeasureFilter, Double> getMeasureCriteria(); Map<MeasureFilter, Double> getPreAggregateMeasureCriteria(); boolean isSkipMeta(); boolean isSkipData(); boolean isSkipHeaders(); boolean isSkipRounding(); boolean isCompletedOnly(); boolean isHierarchyMeta(); boolean isIgnoreLimit(); boolean isHideEmptyRows(); boolean isHideEmptyColumns(); boolean isShowHierarchy(); boolean isIncludeNumDen(); boolean isIncludePeriodStartEndDates(); boolean isIncludeMetadataDetails(); DisplayProperty getDisplayProperty(); IdScheme getOutputIdScheme(); OutputFormat getOutputFormat(); boolean isDuplicatesOnly(); String getApprovalLevel(); Date getStartDate(); Date getEndDate(); SortOrder getOrder(); String getTimeField(); String getOrgUnitField(); DhisApiVersion getApiVersion(); Program getProgram(); ProgramStage getProgramStage(); void setOutputIdScheme( IdScheme outputIdScheme ); User getCurrentUser(); Partitions getPartitions(); void setPartitions( Partitions partitions ); String getTableName(); DataType getDataType(); String getPeriodType(); PeriodType getDataPeriodType(); boolean isSkipPartitioning(); boolean isTimely(); boolean isSkipDataDimensionValidation(); List<OrganisationUnitLevel> getOrgUnitLevels(); boolean isRestrictByOrgUnitOpeningClosedDate(); boolean isRestrictByCategoryOptionStartEndDate(); Date getStartDateRestriction(); Date getEndDateRestriction(); Map<OrganisationUnit, Integer> getDataApprovalLevels(); void setDataApprovalLevels( Map<OrganisationUnit, Integer> dataApprovalLevels ); List<DimensionalItemObject> getAllDataDimensionItems(); List<DimensionalItemObject> getAllIndicators(); List<DimensionalItemObject> getAllDataElements(); List<DimensionalItemObject> getAllReportingRates(); Set<DimensionalItemObject> getAllDataSets(); List<DimensionalItemObject> getAllProgramAttributes(); List<DimensionalItemObject> getAllProgramDataElements(); List<DimensionalItemObject> getAllProgramDataElementsAndAttributes(); List<DimensionalItemObject> getAllValidationResults(); List<DimensionalItemObject> getAllPeriods(); List<DimensionalObject> getDataElementGroupSets(); List<DimensionalItemObject> getAllDataElementGroups(); Set<DimensionalItemObject> getCategoryOptions(); Set<IdentifiableObject> getProgramsInAttributesAndDataElements(); List<DimensionalItemObject> getIndicators(); List<DimensionalItemObject> getDataElements(); List<DimensionalItemObject> getDataElementOperands(); List<DimensionalItemObject> getReportingRates(); List<DimensionalItemObject> getProgramIndicators(); List<DimensionalItemObject> getProgramDataElements(); List<DimensionalItemObject> getProgramAttributes(); List<DimensionalItemObject> getPeriods(); Period getStartEndDatesAsPeriod(); List<DimensionalItemObject> getOrganisationUnits(); List<DimensionalItemObject> getValidationResults(); List<DimensionalItemObject> getFilterIndicators(); List<DimensionalItemObject> getFilterDataElements(); List<DimensionalItemObject> getFilterReportingRates(); List<DimensionalItemObject> getFilterProgramDataElements(); List<DimensionalItemObject> getFilterProgramAttributes(); List<DimensionalItemObject> getFilterValidationResults(); List<DimensionalItemObject> getFilterPeriods(); List<DimensionalItemObject> getFilterOrganisationUnits(); UserOrgUnitType getUserOrgUnitType(); static final String VALUE_ID; static final String NUMERATOR_ID; static final String DENOMINATOR_ID; static final String PERIOD_START_DATE_ID; static final String PERIOD_END_DATE_ID; static final String FACTOR_ID; static final String MULTIPLIER_ID; static final String DIVISOR_ID; static final String LEVEL_PREFIX; static final String KEY_DE_GROUP; static final String KEY_IN_GROUP; static final String VALUE_HEADER_NAME; static final String NUMERATOR_HEADER_NAME; static final String DENOMINATOR_HEADER_NAME; static final String PERIOD_START_DATE_NAME; static final String PERIOD_END_DATE_NAME; static final String FACTOR_HEADER_NAME; static final String MULTIPLIER_HEADER_NAME; static final String DIVISOR_HEADER_NAME; static final String DISPLAY_NAME_DATA_X; static final String DISPLAY_NAME_CATEGORYOPTIONCOMBO; static final String DISPLAY_NAME_ATTRIBUTEOPTIONCOMBO; static final String DISPLAY_NAME_PERIOD; static final String DISPLAY_NAME_ORGUNIT; static final String DISPLAY_NAME_ORGUNIT_GROUP; static final String DISPLAY_NAME_LONGITUDE; static final String DISPLAY_NAME_LATITUDE; static final String PREFIX_ORG_UNIT_LEVEL; static final String DEFAULT_ORG_UNIT_FIELD; static final int DX_INDEX; static final int NUMERATOR_DENOMINATOR_PROPERTIES_COUNT; static final ImmutableSet<Class<? extends IdentifiableObject>> DYNAMIC_DIM_CLASSES; static final ImmutableSet<DimensionType> COMPLETENESS_DIMENSION_TYPES; }
@Test public void testGetEarliestStartDate() { Period jan_2016 = PeriodType.getPeriodFromIsoString( "201601"); Period feb_2016 = PeriodType.getPeriodFromIsoString( "201602"); Period mar_2016 = PeriodType.getPeriodFromIsoString( "201603"); Date dec_2015 = getDate( 2015, 12, 1 ); DataQueryParams paramsA = DataQueryParams.newBuilder() .withStartDate( dec_2015 ) .withPeriods( Lists.newArrayList( jan_2016 ) ) .withFilterPeriods( Lists.newArrayList( feb_2016, mar_2016 ) ) .build(); DataQueryParams paramsB = DataQueryParams.newBuilder() .withStartDate( jan_2016.getStartDate() ) .build(); DataQueryParams paramsC = DataQueryParams.newBuilder() .withFilterPeriods( Lists.newArrayList( feb_2016, mar_2016 ) ) .withPeriods( Lists.newArrayList( jan_2016 ) ) .build(); assertEquals( dec_2015, paramsA.getEarliestStartDate() ); assertEquals( jan_2016.getStartDate(), paramsB.getEarliestStartDate() ); assertEquals( jan_2016.getStartDate(), paramsC.getEarliestStartDate() ); }