Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ApplicationData appData = ApplicationDataFactory.getCurrentApplicationData();
- class ApplicationDataFactory
- {
- public static ApplicationData getCurrentApplicationData()
- {
- //notice how im not passing in criteria here, im getting it from the request so call doens't have to know
- String criteria = request.getHTTPHeaderInfo("applicationID");
- if ( criteria.equals("Android") )
- return new Android();
- else if ( criteria.equals("Android-germany") )
- return new Android_germany();
- else if ( criteria.equals("ios_germany") )
- return new ios_germany();
- else if ( criteria.equals("ios"))
- return new ios();
- else if ( criteria.equals("windows") )
- return new windows();
- return null;//or throw exception
- }
- }
- class Android extends ApplicationData{
- @override
- public String getType(){
- return "Android"
- }
- @override
- public Properties getProperties{
- return system.getProperties("android.properties");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement