String customSettingName = 'Your_Custom_Setting__c';
Schema.DescribeSObjectResult describeResult = Your_Custom_Setting__c.SObjectType.getDescribe();
if (describeResult.isCustomSetting()) {
if (describeResult.getObjectType() == Schema.DisplayType.LIST) {
// Custom setting is of list type
System.debug('Custom setting is of list type');
} else if (describeResult.getObjectType() == Schema.DisplayType.HIERARCHICAL) {
// Custom setting is of hierarchy type
System.debug('Custom setting is of hierarchy type');
} else {
// Custom setting is of another type
System.debug('Custom setting is of another type');
}
} else {
// Object is not a custom setting
System.debug('Object is not a custom setting');
}
Try
Related:
https://salesforce.stackexchange.com/questions/191044/using-the-describe-api-how-can-i-tell-whether-a-given-custom-setting-is-of-list
https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_custom_settings.htm
https://www.apexhours.com/salesforce-custom-settings/
If this information helps, please mark the answer as best. Thank you