1
1
@SuppressWarnings (' PMD.ExcessiveParameterList,PMD.PropertyNamingConventions' )
2
2
public without sharing virtual class RollupCurrencyInfo implements RollupLogger .ToStringObject {
3
3
public static final String CURRENCY_ISO_CODE_FIELD_NAME = ' CurrencyIsoCode' ;
4
- @TestVisible
5
- private static final RollupRepository REPOSITORY = new RollupRepository (RollupRepository .RunAsMode .SYSTEM_LEVEL );
6
- private static final Map <String , SObject > TRANSFORMED_MULTICURRENCY_CALC_ITEMS = new Map <String , SObject >();
7
- private static final Set <String > HASHED_ITEM_VALUES = new Set <String >();
8
4
5
+ @TestVisible
6
+ private static Boolean hasLoadedDatedCurrencyInfo = false ;
9
7
@TestVisible
10
8
private static List <RollupCurrencyInfo > mockBasicCurrencies ;
11
9
@TestVisible
12
10
private static List <RollupCurrencyInfo > mockDatedCurrencies ;
13
11
14
12
@TestVisible
15
- private static Boolean hasLoadedDatedCurrencyInfo = false ;
13
+ private static RollupRepository REPOSITORY {
14
+ get {
15
+ REPOSITORY = REPOSITORY ?? new RollupRepository (RollupRepository .RunAsMode .SYSTEM_LEVEL );
16
+ return REPOSITORY ;
17
+ }
18
+ set ;
19
+ }
20
+ private static Map <String , SObject > TRANSFORMED_MULTICURRENCY_CALC_ITEMS {
21
+ get {
22
+ TRANSFORMED_MULTICURRENCY_CALC_ITEMS = TRANSFORMED_MULTICURRENCY_CALC_ITEMS ?? new Map <String , SObject >();
23
+ return TRANSFORMED_MULTICURRENCY_CALC_ITEMS ;
24
+ }
25
+ set ;
26
+ }
27
+ private static Set <String > HASHED_ITEM_VALUES {
28
+ get {
29
+ HASHED_ITEM_VALUES = HASHED_ITEM_VALUES ?? new Set <String >();
30
+ return HASHED_ITEM_VALUES ;
31
+ }
32
+ set ;
33
+ }
16
34
17
35
private static Date minDatedCurrencyLookup {
18
36
get {
@@ -52,7 +70,7 @@ public without sharing virtual class RollupCurrencyInfo implements RollupLogger.
52
70
// Can't be Schema.SObjectType => Schema.SObjectField because not all orgs have OppLineItems/Splits
53
71
// technically there's a hierarchy for OpportunityLineItem that goes Opportunity.CloseDate > ServiceDate > (ProductDate || ScheduleDate)
54
72
// but because this can be configured on a per-rollup basis, it's fine to leave Opportunity.CloseDate as the default since it can be overridden
55
- private static final Map <String , List <String >> DATED_MULTICURRENCY_SUPPORTED_OBJECTS {
73
+ private static Map <String , List <String >> DATED_MULTICURRENCY_SUPPORTED_OBJECTS {
56
74
get {
57
75
DATED_MULTICURRENCY_SUPPORTED_OBJECTS = DATED_MULTICURRENCY_SUPPORTED_OBJECTS ??
58
76
new Map <String , List <String >>{
@@ -66,7 +84,7 @@ public without sharing virtual class RollupCurrencyInfo implements RollupLogger.
66
84
set ;
67
85
}
68
86
69
- private static final Set <String > DATED_CURRENCY_QUERIES {
87
+ private static Set <String > DATED_CURRENCY_QUERIES {
70
88
get {
71
89
DATED_CURRENCY_QUERIES = DATED_CURRENCY_QUERIES ?? new Set <String >();
72
90
return DATED_CURRENCY_QUERIES ;
@@ -83,23 +101,23 @@ public without sharing virtual class RollupCurrencyInfo implements RollupLogger.
83
101
set ;
84
102
}
85
103
86
- private static final RollupCurrencyInfo FALLBACK_INFO {
104
+ private static RollupCurrencyInfo FALLBACK_INFO {
87
105
get {
88
106
FALLBACK_INFO = FALLBACK_INFO ?? new RollupCurrencyInfo ().setDefaults (1 );
89
107
return FALLBACK_INFO ;
90
108
}
91
109
set ;
92
110
}
93
111
94
- private static final Map <String , RollupCurrencyInfo > CURRENCY_ISO_CODE_TO_CURRENCY {
112
+ private static Map <String , RollupCurrencyInfo > CURRENCY_ISO_CODE_TO_CURRENCY {
95
113
get {
96
114
CURRENCY_ISO_CODE_TO_CURRENCY = CURRENCY_ISO_CODE_TO_CURRENCY ?? getCurrencyMap ();
97
115
return CURRENCY_ISO_CODE_TO_CURRENCY ;
98
116
}
99
117
set ;
100
118
}
101
119
102
- private static final Map <Schema .SObjectType , Map <String , Schema .SObjectField >> TYPE_TO_FIELDS {
120
+ private static Map <Schema .SObjectType , Map <String , Schema .SObjectField >> TYPE_TO_FIELDS {
103
121
get {
104
122
TYPE_TO_FIELDS = TYPE_TO_FIELDS ?? new Map <Schema .SObjectType , Map <String , Schema .SObjectField >>();
105
123
return TYPE_TO_FIELDS ;
0 commit comments