Skip to main content

Posts

Showing posts with the label Map

Collection in Salesforce

Collection in Salesforce: Always prefer to use Map :   Syntax : Map < Integer ,  String > mapData =  new   Map < Integer ,  String >(); Methods : clear() Removes all of the key-value mappings from the map. clone() Makes a duplicate copy of the map. containsKey(key) Returns  true  if the map contains a mapping for the specified key. deepClone() Makes a duplicate copy of a map, including sObject records if this is a map with sObject record values. equals(map2) Compares this map with the specified map and returns  true  if both maps are equal; otherwise, returns  false . get(key) Returns the value to which the specified key is mapped, or  null  if the map contains no value for this key. getSObjectType() Returns the token of the sObject type that makes up the map values. hashCode() Returns the hashcode corresponding to this map. isEmpty() Returns true if the map has zero key-value pairs. keySet() Returns a set that contains all of the keys in the map. put(

Translate