Salesforce Certified Application Architect

Monday 23 November 2015

Map Methods



There are a number of Salesforce map method that can be used. Some of the methods are very common while others are rarely used. Below are some of the most commons Salesforce Map methods that you are likely to come across.

  • – clear (): this is a map method that is used when you want to clear the entire key –values mappings from your map. This salesforce map method is used almost in all applications.
  • – clone (): The clone is another common mapping method that has several applications. It is used when you want to make duplicate copies of the map you are creating.
  • – containsKey (Object) : This key is used to return true value if the mapping contains the value that has been specified in the key. The value that determines whether it returns true or not is placed inside the brackets.
  • – deepClone () : Just like the clone, the deep clone is used to make duplicate copies. The difference is that the deep clone makes duplicate copies of the map including the sObject. This happens if the map has sObject values in it.
  • – equals (Map) : The equal salesforce map method is used to compare different maps. It compares given specified maps and returns true if the maps that are being compared are equal.
  • – get (Object) : This salesforce map method is used tp source a given value or object from the map. If the specified value does not exist in the map, the method returns null.
  • – getSObjectType (): In this method, what is returned is the token of the sObject that is part of the map value.
  • – hashCode () : The hash code is also commonly used. This salesforce map method returns the hash code corresponding to this map.
  • – isEmpty () : When used in mapping the isEmpty command returns true if the map contains pair of keys that have zero values.
  • – keySet () : This is a command which returns a set which contains all the keys that are available in the Map where it has been used.
  • – put (Object, Object) : This method is used to associate a specified value with a give specified key that exists within the map stricture.
  • – putAll(Map) : This method functions by copying all the mappings that are available from a given specified Map to the original map. It takes all the keys that are available in the specified map and then makes a copy of them in an original map.
  • – putAll (sObject[]): This function or method is used to add all the sObjects that are contained in a list. The sObjects that are added must be those that are declared as Map<ID, sObject> and Map<String.
  • – remove (Key) : Remove key is another method that is commonly used. This method removes the mapping value of a specified key from the map. This happens when the key is present in the map. It goes ahead to return the value of that particular stated key.
  • – size () : The size method is used to return the number of key value pairs that are contained in that particular map.
  • – values () : It returns a list which has all the values in a map. The values are returned in an arbitrary order.
Cheers..

No comments:

Post a Comment

Salesforce Certified Application Architect & Certified Data Architecture and Management Designer Exam

How to pass Salesforce Certified Data Architecture and Management Designer Exam This exam was 1st architect exam for me. Its not that muc...