Created
September 28, 2021 14:01
-
-
Save jsmithdev/815340a1ab5b0dd1402ef4f88c9ed8de to your computer and use it in GitHub Desktop.
Apex method to get a pseudo random address
This file contains hidden or 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
/** | |
* get a pseudo random address | |
* @param {Integer} val - number to decide what address to return | |
* @return {String} - address | |
*/ | |
public static String getRandomAddress(Integer val) { | |
Integer i = Integer.valueOf(String.valueOf(val).right(1));// get last num; 3, 223, 113 would be 3; | |
if(i == 0){ return '61 North Avenue NW, Atlanta, GA, 30308'; } | |
if(i == 1){ return '210 Peachtree St NW, Atlanta, GA, 30303'; } | |
if(i == 2){ return '12 Cobb Pkwy SE, Marietta, GA, 30062'; } | |
if(i == 3){ return '6000 N Terminal Pkwy, Atlanta, GA, 30320'; } | |
if(i == 4){ return '1280 Peachtree St NE, Atlanta, GA, 30309'; } | |
if(i == 5){ return '225 Baker St NW, Atlanta, GA, 30313'; } | |
if(i == 6){ return '800 Cherokee Ave SE, Atlanta, GA, 30315'; } | |
if(i == 7){ return '1 AMB Dr NW, Atlanta, GA, 30313'; } | |
if(i == 8){ return '3652 Roswell Rd, Atlanta, GA, 30342'; } | |
return '878 Peachtree St NE, Atlanta, GA, 30309'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage: