Created
October 31, 2017 19:50
-
-
Save asunwoo/991039be6e1abd4a6dd79f52f766d412 to your computer and use it in GitHub Desktop.
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
public T getVariableImpl(String featureFlag, String featureVariable, String userId){ | |
String className = this.optimizelyClient.getFeatureVariableString(featureFlag, featureVariable, userId); | |
T retobj = null; | |
try { | |
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