I am confused about what is happening in a small section of some code. I have a class that has a wrapper class inside it. There is an external class that calls this wrapper class Models.add(new CheckItemsClass(...))
The part that confuses me is that the Models.cls
does not have any reference or instance of CheckItemsClass
. So how are we able to add a new CheckItemsClass
to the Models.cls
?
public class ChecklistController{
public List<CheckItemClass> fillItems(Credit_review__c obj){
Models.add(new CheckItemClass('Miscellaneous (Google Search Items)',obj.GIS_Stip_Notes_Miscellaneous_Search__c,obj.GIS_Stip_Miscellaneous_Search__c));
return Models;
}
public class CheckItemClass{
public string item {get;set;}
public string notes {get;set;}
public boolean flag {get;set;}
public CheckItemClass(string i,string n,boolean f){
this.item = i;
this.notes = n;
this.flag = f;
}
}
}
public without sharing class Models {
public static void mdlEncinitas(List<WC_Credit_Decision__c> wcObs){...}
public static void mdlDataV1(List<WC_Credit_Decision__c> wcObs, List<ID> wccdIds) {...}
public static void mdlDataV2(List<WC_Credit_Decision__c> wcObs, List<ID> wccdIds) {...}
public static void mdlEncinitasRecommender(WC_Credit_Decision__c wcOb, Integer score10pt, Integer score, String productionChannel, Double grossSalesRunRate, Double judgmentTotalAmt, Integer maxTib, Double avgOfAvgDailyBal, Double bkDateYrs, Integer maxFICO, String sicCode, NF_SIC_4__c sicOb, Credit_Review__c crOb, WC_Buy_Rate__c brOb, Boolean lenderMissing, Double maxNegDaysLst3Mnths, String oppType, List<Decision_Attribute__c> decisionAttr, Double maxNegDaysEver, Double maxNSFsEver) {...}
public static void mdlEncinitasRun(ID wcId, WC_Credit_Decision__c wcOb, Credit_Review__c crOb, Opportunity oppOb, List<Monthly_Review__c> mrObs,NF_SIC_4__c sicOb, Account acctOb, WC_Buy_Rate__c brOb, Boolean brokerMissing, Map<Id,List<Credit_Review_Monthly_Ledger__c>> CR_ledgers_map, List<Decision_Attribute__c> decisionAttr){...}
}