Skip to content

Commit

Permalink
Merge branch 'master' into js_html_css_refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
crashrap1995 authored Aug 16, 2024
2 parents f3647a2 + 4e77d87 commit 0e47758
Show file tree
Hide file tree
Showing 26 changed files with 3,928 additions and 3,635 deletions.
92 changes: 46 additions & 46 deletions force-app/main/default/classes/CacheListViewConfig.cls
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
/**
* @description :
* @author : [email protected]
* @last modified on : 10-16-2022
* @last modified by :
**/
public with sharing class CacheListViewConfig {

public static List_View_Config__c get(String objectName, String listViewName)
{
List_View_Config__c result = null;

String key = CacheHelper.getValidKey(objectName + CacheHelper.SPLITTER + listViewName);
System.debug(LoggingLevel.DEBUG, 'CacheListViews.get(' + key + ')');
if (key.length() < 50) //stupid restriction on key size!!
{
result = (List_View_Config__c) CacheHelper.PARTITION.get(key);
if (result == null)
{
System.debug(LoggingLevel.DEBUG, 'RESULT IS NULL');
result = getData(objectName, listViewName);
System.debug(LoggingLevel.DEBUG, 'RESULT IS NOW ' + result);
if (result != null)
CacheHelper.PARTITION.put(key, result);
} else {
System.debug(LoggingLevel.DEBUG, 'RESULT NOT NULL - ' + result);
}
} else {
result = getData(objectName, listViewName);
}
return result;
}

public static void remove(String objectName, String listViewName)
{
String key = CacheHelper.getValidKey(objectName + CacheHelper.SPLITTER + listViewName);
System.debug(LoggingLevel.DEBUG, 'CacheListViews.remove(' + key + ')');
if (key.length() < 50)
CacheHelper.PARTITION.remove(key);
}

private static List_View_Config__c getData(String objectName, String listViewName)
{
return ListViewConfigHelper.getListViewConfigCache(objectName, listViewName);
}

/**
* @description :
* @author : [email protected]
* @last modified on : 10-16-2022
* @last modified by :
**/
public with sharing class CacheListViewConfig {

public static List_View_Config__c get(String objectName, String listViewName)
{
List_View_Config__c result = null;

String key = CacheHelper.getValidKey(objectName + CacheHelper.SPLITTER + listViewName);
System.debug(LoggingLevel.DEBUG, 'CacheListViews.get(' + key + ')');
if (key.length() < 50) //stupid restriction on key size!!
{
result = (List_View_Config__c) CacheHelper.PARTITION.get(key);
if (result == null)
{
System.debug(LoggingLevel.DEBUG, 'RESULT IS NULL');
result = getData(objectName, listViewName);
System.debug(LoggingLevel.DEBUG, 'RESULT IS NOW ' + result);
if (result != null)
CacheHelper.PARTITION.put(key, result);
} else {
System.debug(LoggingLevel.DEBUG, 'RESULT NOT NULL - ' + result);
}
} else {
result = getData(objectName, listViewName);
}
return result;
}

public static void remove(String objectName, String listViewName)
{
String key = CacheHelper.getValidKey(objectName + CacheHelper.SPLITTER + listViewName);
System.debug(LoggingLevel.DEBUG, 'CacheListViews.remove(' + key + ')');
if (key.length() < 50)
CacheHelper.PARTITION.remove(key);
}

private static List_View_Config__c getData(String objectName, String listViewName)
{
return ListViewConfigHelper.getListViewConfigCache(objectName, listViewName);
}

}
Loading

0 comments on commit 0e47758

Please sign in to comment.