io.baltoro.service.ServiceFactory Maven / Gradle / Ivy
package io.baltoro.service;
public class ServiceFactory
{
public static Service getInstance()
{
return new ServiceImpl();
}
public static T get(Class _class)
{
Object service = null;
try
{
Class clazz = Class.forName(_class.getName()+"Impl");
service = clazz.newInstance();
}
catch (Exception e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
return _class.cast(service);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy