/** * Generate the key representing the time period that the specified date time falls into * * @param aggregationPeriod the aggregation period for which the key will be generated * @param year the year * @param month the month, valid values: [1, 12] * @param dayOfMonth the day in the month * @param hour the hour in the day, valid values: [0, 23] * @param minute the minute in the hour, valid values: [0, 59] * @return the time period key */ default String generateKey( AggregationPeriod aggregationPeriod, int year, int month, int dayOfMonth, int hour, int minute) { return generateKey(aggregationPeriod.getCodeName(), year, month, dayOfMonth, hour, minute); }
/** * Generate the key representing the time period that the specified date time falls into * * @param aggregationPeriod the aggregation period for which the key will be generated * @param instant the date time * @return the time period key */ default String generateKey(AggregationPeriod aggregationPeriod, Instant instant) { return generateKey( aggregationPeriod.getCodeName(), LocalDateTime.ofInstant(instant, aggregationPeriod.getZone())); }
/** * Generate the key representing the time period that the specified date time falls into * * @param aggregationPeriod the aggregation period for which the key will be generated * @param dateTimeWithoutZone the date time * @return the time period key */ default String generateKey( AggregationPeriod aggregationPeriod, LocalDateTime dateTimeWithoutZone) { return generateKey(aggregationPeriod.getCodeName(), dateTimeWithoutZone); }