Created
April 29, 2019 16:41
-
-
Save shanerk/dc8330bd2a374fd3f341538e3f0e0e11 to your computer and use it in GitHub Desktop.
Apex Packages & @deprecated Annotation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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