Skip to content

Instantly share code, notes, and snippets.

@shanerk
Created April 29, 2019 16:41
Show Gist options
  • Save shanerk/dc8330bd2a374fd3f341538e3f0e0e11 to your computer and use it in GitHub Desktop.
Save shanerk/dc8330bd2a374fd3f341538e3f0e0e11 to your computer and use it in GitHub Desktop.
Apex Packages & @deprecated Annotation
global with sharing class ApexDeprecated {
@Deprecated
global enum FOOBAR { FOO, BAR }
// Not Allowed - Deprecated FOOBAR return type illegal in global
global static FOOBAR bar(Integer ord) {
return FOOBAR.values()[ord];
}
// Allowed - Deprecated type is not exposed globally, so can still be used internal to the method
global static String foo(Integer ord) {
return FOOBAR.values()[ord].name();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment