You may use a Map for this:

public static String manageFilters(Map<String, Object> lines){
    System.debug('### lines : ' + lines);
    System.debug('### lines.values() : ' + lines.values());

    for(String key : lines.keySet()){
        System.debug('### lines.get(key) : ' + lines.get(key));
        System.debug('### >>> ' + lines.get(key));
        Map<Object, Object> test = (Map<Object, Object>)lines.get(key);
        System.debug('### test ' + test);
        System.debug('### test ' + test.get('ObjectName'));
    }

    return null;
}
Answer from S.. on Stack Exchange
🌐
Reddit
reddit.com › r/salesforce › using maps in apex (beginner)
r/salesforce on Reddit: Using Maps in Apex (beginner)
September 23, 2020 - I’ve been learning Apex for a little bit now and have a pretty novice understanding of how it all works, but the concept I’m struggling with the most is using maps instead of lists or sets.
🌐
S2 Labs
s2-labs.com › home › map initialization methods in apex
Map Initialization Methods In Apex | Salesforce Developer Tutorials
April 27, 2026 - Below are the different methods to initialize maps in Apex. ... MyCustomObject__c obj1 = new MyCustomObject__c(Name = 'Object1'); MyCustomObject__c obj2 = new MyCustomObject__c(Name = 'Object2'); Map<String, MyCustomObject__c> myMap = new Map<String, MyCustomObject__c>{ 'Key1' => obj1, 'Key2' => obj2 }; ... Map<Id, Account> accountMap = new Map<Id, Account>([SELECT Id, Name FROM Account WHERE Industry = 'Technology']); ... Learn more and get all the answers you need at zero cost.
🌐
JanBask Training
janbasktraining.com › community › salesforce › how to get values from a map apex?
How to get values from a map apex? | JanBask Training Community
September 23, 2022 - In Apex, you can get values from a map using the get() method or by directly accessing the map keys.
🌐
SFDC Kid
sfdckid.com › 2019 › 04 › salesforce-apex-collection-map.html
APEX COLLECTION: Map - SFDC Kid
Salesforce Apex Collection : Map Salesforce Apex Collection is a collection of key-value pairs where each unique key maps to a single value. salesforce Apex Collection in simple and easy steps starting from basic to advanced concepts with examples including salesforce Overview, salesforce Architecture, salesforce Environment, salesforce Sales, salesforce Service Cloud, salesforce Navigating Setup, salesforce Standard, salesforce Custom Objects, salesforce Master Detail Relationship, salesforce Lookup Relationship, salesforce Schema Builder, salesforce Control Access to the Organization, Contro
Find elsewhere
🌐
YouTube
youtube.com › force fellow
Map in Apex | Apex Fundamentals | Salesforce Developer - YouTube
This video is the part of Apex Fundamentals series, which covers map collection in apex. And in this video we have discussed about map defination and importa...
Published: October 9, 2023
Views: 752
🌐
S2 Labs
s2-labs.com › home › maps in apex
Maps In Apex | Salesforce Developer Tutorials
August 7, 2025 - The Map class in Salesforce Apex is a versatile and powerful tool that allows developers to efficiently manage collections of key-value pairs.
🌐
Panther Schools
pantherschools.com › home › salesforce › how to use map collection in salesforce?
How to use Map Collection in Salesforce? » Panther Schools
April 21, 2025 - Map is very powerful while using Apex Code in Salesforce · Map<String, String> countryCurrencies = new Map<String, String>(); List<String> ABC = new List<String>(); #1 - Map<String, Integer> accountMap = new Map<String, Integer>(); accountMap.put('Acme', 10000); accountMap.put('XYZ Corp', 5000); accountMap.put('ABC Company', 7500); // Retrieve the value for a specific key Integer acmeValue = accountMap.get('Acme'); System.debug(acmeValue); // Outputs 10000 #2 - Map<String, Integer> accountMap = new Map<String, Integer>{ 'Acme' => 10000, 'XYZ Corp'=> 500 }; Boolean exists = accountMap.containsKey('Acme'); // exists = True accountMap.keySet(); // Returns the Set<Data Type of the Map Key> accountMap.values(); // Returns the List<Data Type of Map Value> Set<String> accountNameSet = accountMap.keySet(); List<Integer> revenueList = accountMap.values(); #3 - Map<String, Integer> accountMap ·
🌐
JanbaskTraining
janbasktraining.com › home › salesforce maps: features, benefits & methods
Salesforce Maps: Features, Benefits & Methods
December 29, 2022 - (recordList) - This Map Class constructor generates a new instance of the Map Apex class. Also, this constructor populates it with the sObject records’ passed-in list. The Map keys get populated with the IDs of sObject.
🌐
Deepika Khanna
mytutorialrack.com › home › understanding map methods in apex: key concepts and best practices
Understanding Map Methods in Apex: Key Concepts and Best Practices
June 1, 2023 - In Apex, the Map class provides a collection of key-value pairs, where each key is unique. It offers several methods to manipulate and retrieve data from the map. Map methods in Apex provide a wide range of functionality, including searching ...
🌐
YouTube
youtube.com › mitch routt
Map in Apex Explained | Salesforce Developer - YouTube
Learn Maps in Apex in 2 Minutes! A Map is a flexible and fundamental data structure that Salesforce Developers use to store sObjects in a way that reduces th...
Published: January 19, 2024
Views: 412
🌐
YouTube
youtube.com › watch
Salesforce Apex Master Class (Ep. 19) - What are Maps in Apex? - YouTube
In this episode we go over what the Map Collection type is in Apex and we discuss how and why to use them! We also do an example in apex together!Map Class D...
Published: April 14, 2022
🌐
Electronic Arts
ea.com › en › games › apex-legends › apex-legends › maps-hub
Apex Legends - Maps
Kings Canyon, World’s Edge, and Olympus. You’ve fought there, you’ve died there, but do you know why they were chosen? Hammond Robotics and the Mercenary Syndicate seem to have a hand in everything that shapes the destiny of the Outlands... Learn more about the maps that host the Apex Games.
🌐
Forceshark
forceshark.com › blog › querying-a-soql-query-directly-into-a-map-in-apex
Querying a SOQL Query Directly into a Map in Apex | Blog
In Apex, you can store SOQL query results directly into a Map by querying the records and using a constructor or loop.
🌐
C# Corner
c-sharpcorner.com › article › apex-map-in-salesforce
Apex Map In SalesForce
September 19, 2019 - get(key) - using this method, we can get the value to which the key is mapped, or it generates null if the key has no value. ... Finally, the ApexMap.apxc class code is mentioned below.