Winter 16 Release Notes: New or updated Classes and Methods (recalculateFormulas and Cache are most interesting ones)

Find some interesting information here: http://releasenotes.docs.salesforce.com/en-us/winter16/release-notes/rn_apex_new_classes_methods.htm

System.SObject Class

recalculateFormulas()

It was always very nasty thing to make additional query to update formula values in tests. God send!

Classes in the Cache Namespace

Cache.Org Class
Use the Cache.Org class to add, retrieve, and manage values in the org cache. Unlike the session cache, the org cache is not tied to any session and is available to the organization across requests and to all users. This class has the following methods.
contains(keys)
Returns true if the org cache contains the specified key entries.
contains(key)
Returns true if the org cache contains a cached value corresponding to the specified key.
get(key)
Returns the cached value corresponding to the specified key from the org cache.
getCapacity()
Returns the percentage of org cache capacity that has been used.
getKeys()
Returns a set of all keys that are stored in the org cache and visible to the invoking namespace.
getPartition(partitionName)
Returns a partition from the org cache that corresponds to the specified partition name.
put(key, value, ttlSecs, visibility, immutable)
Stores the specified key/value pair as a cached entry in the org cache. This method also sets the cached value’s lifetime, visibility, and whether it can be overwritten by another namespace.
put(key, value, ttlSecs)
Stores the specified key/value pair as a cached entry in the org cache and sets the cached value’s lifetime.
put(key, value, visibility)
Stores the specified key/value pair as a cached entry in the org cache and sets the cached value’s visibility.
put(key, value)
Stores the specified key/value pair as a cached entry in the org cache. The put method can write only to the cache in your org’s namespace.
remove(key)
Deletes the cached value corresponding to the specified key from the org cache.
Cache.OrgPartition Class
Contains methods to manage cache values in the org cache of a specific partition. Unlike the session cache, the org cache is not tied to any session. It’s available to the organization across requests and to all users. This class inherits all of its methods from the Cache.Partition class. The only exceptions are the utility methods for creating and validating keys, which are supported only in Cache.Partition.
Cache.Partition Class
Base class of Cache.OrgPartition and Cache.SessionPartition. Use the subclasses to manage the cache partition for org caches and session caches. This class has the following methods.
contains(key)
Returns true if the cache partition contains a cached value corresponding to the specified key.
createFullyQualifiedKey(namespace, partition, key)
Generates a fully qualified key from the passed-in key components. The format of the generated key string isnamespace.partition.key.
createFullyQualifiedPartition(namespace, partition)
Generates a fully qualified partition name from the passed-in namespace and partition. The format of the generated partition string is namespace.partition.
get(key)
Returns the cached value corresponding to the specified key from the cache partition.
getCapacity()
Returns the percentage of cache used of the total capacity for this partition.
getKeys()
Returns the cached value corresponding to the specified key from the cache partition.
getName()
Returns the name of this cache partition.
isAvailable()
Returns true if the Salesforce session is available. Only applies to Cache.SessionPartition.
put(key, value, ttlSecs, visibility, immutable)
Stores the specified key/value pair as a cached entry in the cache partition. This method also sets the cached value’s lifetime, visibility, and whether it can be overwritten by another namespace.
put(key, value, ttlSecs)
Stores the specified key/value pair as a cached entry in the cache partition and sets the cached value’s lifetime.
put(key, value, visibility)
Stores the specified key/value pair as a cached entry in the cache partition and sets the cached value’s visibility.
put(key, value)
Stores the specified key/value pair as a cached entry in the session cache. The put method can write only to the cache in your org’s namespace.
remove(key)
Deletes the cached value corresponding to the specified key from this cache partition.
validateKey(isDefault, key)
Validates the specified cache keys. This method throws a Cache.InvalidParamException if the key is not valid. A valid key is not null and contains alphanumeric characters.
validateKeyValue(isDefault, key, value)
Validates a cache key and ensures that the cache value is non-null. This method throws a Cache.InvalidParamExceptionif the key or value is not valid. A valid key is not null and contains alphanumeric characters.
validateKeys(isDefault, keys)
Validates the specified cache keys. This method throws a Cache.InvalidParamException if the key is not valid. A valid key is not null and contains alphanumeric characters.
validatePartitionName(name)
Validates the partition name — for example, that it is not null.
Cache.Session Class
Use the Cache.Session class to add, retrieve, and manage values in the session cache. The session cache is active as long as the user’s Salesforce session is valid (the user is logged in and the session is not expired). This class has the following methods.
contains(key)
Returns true if the session cache contains a cached value corresponding to the specified key.
get(key)
Returns the cached value corresponding to the specified key from the session cache.
getCapacity()
Returns the percentage of session cache capacity that has been used.
getKeys()
Returns all keys that are stored in the session cache and visible to the invoking namespace.
getPartition(partitionName)
Returns a partition from the session cache that corresponds to the specified partition name.
isAvailable()
Returns true if the session cache is available for use.
put(key, value, ttlSecs, visibility, immutable)
Stores the specified key/value pair as a cached entry in the session cache. This method also sets the cached value’s lifetime, visibility, and whether it can be overwritten by another namespace.
put(key, value, ttlSecs)
Stores the specified key/value pair as a cached entry in the session cache and sets the cached value’s lifetime.
put(key, value, visibility)
Stores the specified key/value pair as a cached entry in the session cache and sets the cached value’s visibility.
put(key, value)
Stores the specified key/value pair as a cached entry in the session cache. The put method can write only to the cache in your org’s namespace.
remove(key)
Deletes the cached value corresponding to the specified key from the session cache.
Cache.SessionPartition Class
Contains methods to manage cache values in the session cache of a specific partition. This class inherits all of its methods from the Cache.Partition class. The only exceptions are the utility methods for creating and validating keys, which are supported only in Cache.Partition.
Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s