Tuesday 12 March 2013


Annotations

DescriptionExample
@futureIdentifies methods that are executed asynchronously
global class MyFutureClass {

  @future
  static void myMethod(
      String a, Integer i) {
  
    System.debug(
      'Method called with:'
      + a + ' and ' + i); 

    // do callout, other
    // long running code
  }
}
@deprecatedIdenties methods, classes, exceptions, enums, interfaces, or variables that can no longer be referenced in subsequent releases of the managed package in which they reside.
@deprecated
public void limitedShelfLife() { 
  // Deprecated logic
}
@isTestDefines classes that only contain code used for testing your application. These classes do not count against the total amount of Apex used by your organization.
@isTest
private class MyTest {
  // Methods for testing 
}
Categories: ,

0 comments:

Post a Comment

    Links