private void readRow(Map<String,Object> rowMap,Map<String,AwsAccountDetailDto> monthlyBill,List<String> tagHeaders,Collection<String> ignorableInvoiceCharge){
  final String linkedAccountId=getStringFieldValue(rowMap,DetailedCsvHeaders.LINKED_ACCOUNT_ID);
  String serviceName=getStringFieldValue(rowMap,DetailedCsvHeaders.PRODUCT_NAME);
  String subscriptionId=getStringFieldValue(rowMap,DetailedCsvHeaders.SUBSCRIPTION_ID);
  if (subscriptionId == null || subscriptionId.length() == 0 || serviceName == null || serviceName.length() == 0) {
    readSummaryRow(rowMap,linkedAccountId,serviceName,monthlyBill,ignorableInvoiceCharge);
    return;
  }
  AwsAccountDetailDto accountDeatils=createOrGetAccountDetailObject(monthlyBill,linkedAccountId);
  AwsServiceDetailDto serviceDetail=createOrGetServiceDetailObject(accountDeatils,serviceName);
  Double resourceCost=getResourceCost(rowMap);
  String resourceId=getStringFieldValue(rowMap,DetailedCsvHeaders.RESOURCE_ID);
  if (resourceId == null || resourceId.length() == 0) {
    if (rowMap.get(DetailedCsvHeaders.USAGE_START_DATE) != null) {
      LocalDateTime usageStartTimeFromCsv=(LocalDateTime)rowMap.get(DetailedCsvHeaders.USAGE_START_DATE);
      Long millisForBillHour=getMillisForHour(usageStartTimeFromCsv);
      serviceDetail.addToOtherCosts(millisForBillHour,resourceCost);
      serviceDetail.addToDirectCosts(millisForBillHour,0d);
    }
 else {
      serviceDetail.addToRemainingCost(resourceCost);
    }
    return;
  }
  LocalDateTime usageStartTimeFromCsv=(LocalDateTime)rowMap.get(DetailedCsvHeaders.USAGE_START_DATE);
  Long millisForBillHour=getMillisForHour(usageStartTimeFromCsv);
  serviceDetail.addToDirectCosts(millisForBillHour,resourceCost);
  AwsResourceDetailDto resourceDetail=createOrGetResourceDetailObject(rowMap,serviceDetail,resourceId);
  resourceDetail.addToDirectCosts(millisForBillHour,resourceCost);
  setLatestResourceValues(rowMap,tagHeaders,resourceDetail);
}

private void readRow ( Map < String , Object > rowMap , Map < String , AwsAccountDetailDto > monthlyBill , List < String > tagHeaders , Collection < String > ignorableInvoiceCharge ) { final String linkedAccountId = getStringFieldValue ( rowMap , DetailedCsvHeaders . LINKED_ACCOUNT_ID ) ; String serviceName = getStringFieldValue ( rowMap , DetailedCsvHeaders . PRODUCT_NAME ) ; String subscriptionId = getStringFieldValue ( rowMap , DetailedCsvHeaders . SUBSCRIPTION_ID ) ; if ( subscriptionId == null || subscriptionId . length ( ) == 0 || serviceName == null || serviceName . length ( ) == 0 ) { readSummaryRow ( rowMap , linkedAccountId , serviceName , monthlyBill , ignorableInvoiceCharge ) ; return ; } AwsAccountDetailDto accountDeatils = createOrGetAccountDetailObject ( monthlyBill , linkedAccountId ) ; AwsServiceDetailDto serviceDetail = createOrGetServiceDetailObject ( accountDeatils , serviceName ) ; Double resourceCost = getResourceCost ( rowMap ) ; String resourceId = getStringFieldValue ( rowMap , DetailedCsvHeaders . RESOURCE_ID ) ; if ( resourceId == null || resourceId . length ( ) == 0 ) { if ( rowMap . get ( DetailedCsvHeaders . USAGE_START_DATE ) != null ) { LocalDateTime usageStartTimeFromCsv = ( LocalDateTime ) rowMap . get ( DetailedCsvHeaders . USAGE_START_DATE ) ; Long millisForBillHour = getMillisForHour ( usageStartTimeFromCsv ) ; serviceDetail . addToOtherCosts ( millisForBillHour , resourceCost ) ; serviceDetail . addToDirectCosts ( millisForBillHour , 0d ) ; } else { serviceDetail . addToRemainingCost ( resourceCost ) ; } return ; } LocalDateTime usageStartTimeFromCsv = ( LocalDateTime ) rowMap . get ( DetailedCsvHeaders . USAGE_START_DATE ) ; Long millisForBillHour = getMillisForHour ( usageStartTimeFromCsv ) ; serviceDetail . addToDirectCosts ( millisForBillHour , resourceCost ) ; AwsResourceDetailDto resourceDetail = createOrGetResourceDetailObject ( rowMap , serviceDetail , resourceId ) ; resourceDetail . addToDirectCosts ( millisForBillHour , resourceCost ) ; setLatestResourceValues ( rowMap , tagHeaders , resourceDetail ) ; }
this method reads each row of the aws bill file , ignores the values that are not required , creates or updates the corresponding entry in monthlybill map .
