Custom settings are similar to custom objects and enable application developers to create custom sets of data, as well as create and associate custom data for an organization, profile, or specific user. Custom Settings data is stored in the application cache, which enables efficient access without the cost of multiple repeated queries to the database. As long as you query the Custom Settings using GET methods rather than an SOQL query you can retrieve all of the values with literally zero impact on the governor’s count of the number of queries performed or rows retrieved.
The following are instance methods for list custom settings.
References:
http://www.brcline.com/blog/salesforce-custom-settings
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_custom_settings.htm
List Custom Settings
It provides a reusable set of static data that can be accessed across your organization. Data in list settings does not vary with profile or user, but is available organization-wide.The following are instance methods for list custom settings.
getAll()
: Returns a map of the data sets defined for the custom setting.getInstance(dataSetName) / getValues(dataSetName)
: Returns the custom setting data set record for the specified data set name.
Hierarchy Custom Settings
It uses a built-in hierarchical logic that lets you "personalize" settings for specific profiles or users. The hierarchy logic checks the organization, profile, and user settings for the current user and returns the most specific value. In the hierarchy, settings for an organization are overridden by profile settings, which, in turn, are overridden by user settings.References:
http://www.brcline.com/blog/salesforce-custom-settings
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_custom_settings.htm