private IndirectCosts getIndirectCosts(BudgetPeriodDto periodInfo) {

        IndirectCosts indirectCosts = null;

        if (periodInfo != null
                && periodInfo.getIndirectCosts() != null
                && periodInfo.getIndirectCosts().getIndirectCostDetails() != null) {

            List<IndirectCosts.IndirectCost> indirectCostList = new ArrayList<>();
            int IndirectCostCount = 0;
            for (IndirectCostDetailsDto indirectCostDetails : periodInfo
                    .getIndirectCosts().getIndirectCostDetails()) {
                IndirectCosts.IndirectCost indirectCost = IndirectCosts.IndirectCost.Factory
                        .newInstance();
                if (indirectCostDetails.getBase() != null) {
                    indirectCost.setBase(indirectCostDetails.getBase()
                            .bigDecimalValue());
                }
                indirectCost.setCostType(indirectCostDetails.getCostType());
                if (indirectCostDetails.getFunds() != null) {
                    indirectCost.setFundRequested(indirectCostDetails
                            .getFunds().bigDecimalValue());
                }
                if (indirectCostDetails.getRate() != null) {
                    indirectCost.setRate(indirectCostDetails.getRate()
                            .bigDecimalValue());
                }
                indirectCostList.add(indirectCost);
                IndirectCostCount++;
                if (IndirectCostCount == ARRAY_LIMIT_IN_SCHEMA) {
                    LOG
                            .warn("Stopping iteration over indirect cost details because array limit in schema is only 4");
                    break;
                }
            }
            if (IndirectCostCount > 0) {
                indirectCosts = IndirectCosts.Factory.newInstance();
                IndirectCosts.IndirectCost indirectCostArray[] = new IndirectCosts.IndirectCost[0];
                indirectCosts.setIndirectCostArray(indirectCostList
                        .toArray(indirectCostArray));
                if (periodInfo.getIndirectCosts().getTotalIndirectCosts() != null) {
                    indirectCosts.setTotalIndirectCosts(periodInfo
                            .getIndirectCosts().getTotalIndirectCosts()
                            .bigDecimalValue());
                }
            }
        }
        return indirectCosts;
    }
private IndirectCosts getIndirectCosts ( BudgetPeriodDto periodInfo ) { IndirectCosts indirectCosts = null ; if ( periodInfo != null && periodInfo . getIndirectCosts ( ) != null && periodInfo . getIndirectCosts ( ) . getIndirectCostDetails ( ) != null ) { List < IndirectCosts . IndirectCost > indirectCostList = new ArrayList < > ( ) ; int IndirectCostCount = 0 ; for ( IndirectCostDetailsDto indirectCostDetails : periodInfo . getIndirectCosts ( ) . getIndirectCostDetails ( ) ) { IndirectCosts . IndirectCost indirectCost = IndirectCosts . IndirectCost . Factory . newInstance ( ) ; if ( indirectCostDetails . getBase ( ) != null ) { indirectCost . setBase ( indirectCostDetails . getBase ( ) . bigDecimalValue ( ) ) ; } indirectCost . setCostType ( indirectCostDetails . getCostType ( ) ) ; if ( indirectCostDetails . getFunds ( ) != null ) { indirectCost . setFundRequested ( indirectCostDetails . getFunds ( ) . bigDecimalValue ( ) ) ; } if ( indirectCostDetails . getRate ( ) != null ) { indirectCost . setRate ( indirectCostDetails . getRate ( ) . bigDecimalValue ( ) ) ; } indirectCostList . add ( indirectCost ) ; IndirectCostCount ++ ; if ( IndirectCostCount == ARRAY_LIMIT_IN_SCHEMA ) { LOG . warn ( "Stopping iteration over indirect cost details because array limit in schema is only 4" ) ; break ; } } if ( IndirectCostCount > 0 ) { indirectCosts = IndirectCosts . Factory . newInstance ( ) ; IndirectCosts . IndirectCost indirectCostArray [ ] = new IndirectCosts . IndirectCost [ 0 ] ; indirectCosts . setIndirectCostArray ( indirectCostList . toArray ( indirectCostArray ) ) ; if ( periodInfo . getIndirectCosts ( ) . getTotalIndirectCosts ( ) != null ) { indirectCosts . setTotalIndirectCosts ( periodInfo . getIndirectCosts ( ) . getTotalIndirectCosts ( ) . bigDecimalValue ( ) ) ; } } } return indirectCosts ; }
This method returns IndirectCosts details such as
Base,CostType,FundRequested,Rate and TotalIndirectCosts in
BudgetYearDataType based on BudgetPeriodInfo for the RRBudget10.

@param periodInfo
(BudgetPeriodInfo) budget period entry.
@return IndirectCosts corresponding to the BudgetPeriodInfo object.