Could you not simply populate the name identifier of the custom setting with a unique concatenation of SF_Source_Type__c and SF_Source_Sub_Type__c ? Ifso you could simply do:
Tal_Source_Map__c.getInstance(someCustomObject.Type__c + someCustomObject.Sub_Type__c); //whereever you're getting the values from
More elaborate:
Depending on the type of execution context and bulkified processing you are planning to use this custom setting in there are things to consider. While Daniel Hoechst's answer is entirely correct that you can use soql to query, if you need multiple records in a single execution context you'll need to do multiple queries or compose dynamic soql queries (or this, or this, or this etc) which also has its limits.
If the amount of records is not too high, and you'll need multiple you can also opt to load them all into the apex memory like this example:
public class testCS_Provider {
/*for custom setting testCS with fields:
name:text,
subIdentifier1:text,
subIdentifier2:text,
decimal1:number,
decimal2:number
dummy code which relies on your data integrity requiring unique combinations of subidentifier1 & 2
in reality you will want to extend with some more if's, errorhandeling / fallback values to your own preference
*/
private static map<string, map<string, test_CS__c>> internal_storage;
public static test_CS__c getRecord(string subId_1, string subId_2){
if(internal_storage == null)populateInternalStorage();
return internal_storage.get(subId_1).get(subId_2); //error prone if the custom setting does not contain these parameters!
}
private static void populateInternalStorage(){
internal_storage = new map<string,map<string,test_CS__c>>();
Map<string, test_CS__c> allRecords = test_CS__c.getAll(); //get everything from the SFCD cache
for(test_CS__c tcs:allRecords.values()){
if(! internal_storage.containsKey(tcs.subIdentifier1__c)){
internal_storage.put(tcs.subIdentifier1__c,new map<string,test_CS__c>());
}
internal_storage.get(tcs.subIdentifier1__c).put(tcs.subIdentifier2__c,tcs);
}
}
}
Anywhere else in apex:
test_cs__c x = testCS_Provider.getRecord('test','test');