private List<DataElementOperand> getOperands( DataElement dataElement, CategoryCombo categoryCombo ) { List<DataElementOperand> operands = Lists.newArrayList(); for ( CategoryOptionCombo categoryOptionCombo : categoryCombo.getSortedOptionCombos() ) { operands.add( new DataElementOperand( dataElement, categoryOptionCombo ) ); } return operands; }
/** * Returns the sorted category option combinations of the resolved category * combinations of this data element. The returned list is immutable, will * never be null and will contain at least one item. */ public List<CategoryOptionCombo> getSortedCategoryOptionCombos() { List<CategoryOptionCombo> optionCombos = Lists.newArrayList(); getCategoryCombos().forEach( cc -> optionCombos.addAll( cc.getSortedOptionCombos() ) ); return optionCombos; }
/** * Retrieves the dimension items for the given dimension. If the given dimension * is {@link DimensionalObject#CATEGORYOPTIONCOMBO_DIM_ID}, the category option * combinations associated with all data elements in this query through their * category combinations are retrieved. */ private List<DimensionalItemObject> getDimensionItemObjects( String dimension ) { if ( CATEGORYOPTIONCOMBO_DIM_ID.equals( dimension ) ) { return getDataElements().stream() .map( de -> ((DataElement) de).getCategoryCombos() ) .flatMap( cc -> cc.stream() ) .distinct() // Get unique category combinations .map( cc -> cc.getSortedOptionCombos() ) .flatMap( coc -> coc.stream() ) .collect( Collectors.toList() ); } else { return getDimensionOptions( dimension ); } }
transientCategoryOptionCombos.addAll( Objects.requireNonNull( getFirstCategoryCombo() ).getSortedOptionCombos() ); verify( nonEmptyLists( transientCategoryOptionCombos ) == 1, "Category option combos size must be larger than 0" );
List<CategoryOptionCombo> optionCombos = categoryCombo.getSortedOptionCombos();