/** * Returns partitions for the given period. * * @param period the period. * @return partitions for the given period. */ public static Partitions getPartitions( Period period ) { return new Partitions( getYears( period ) ); }
/** * Returns partitions for the given list of periods. * * @param period the period. * @return partitions for the given list of periods. */ public static Partitions getPartitions( List<DimensionalItemObject> periods ) { final Set<Integer> years = new HashSet<>(); periods.forEach( p -> { Period period = (Period) p; years.addAll( getYears( period ) ); } ); return new Partitions( years ); }