Created
October 31, 2017 19:48
-
-
Save asunwoo/a1e33366140daccebbf19d1497c18f49 to your computer and use it in GitHub Desktop.
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
| public T getExperimentImpl(String experimentName, String userId){ | |
| Variation variation = this.optimizelyClient.activate(experimentName, userId); | |
| T retobj = null; | |
| try { | |
| String className = this.packageName + "." + variation.getKey(); | |
| Class cls = Class.forName(className); | |
| Class partypes[] = new Class[0]; | |
| Constructor ct = cls.getConstructor(partypes); | |
| retobj = (T)ct.newInstance(); | |
| } | |
| catch (Throwable e) { | |
| System.err.println(e); | |
| e.printStackTrace(); | |
| return null; | |
| } | |
| return retobj; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment