
com.podio.APIFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api Show documentation
Show all versions of api Show documentation
The official Java wrapper for the Podio API
The newest version!
package com.podio;
import java.lang.reflect.InvocationTargetException;
/**
* Factory to make it simple to get a specific API to work with
*/
public class APIFactory {
private final ResourceFactory resourceFactory;
public APIFactory(ResourceFactory resourceFactory) {
super();
this.resourceFactory = resourceFactory;
}
public T getAPI(Class apiClass) {
try {
return apiClass.getConstructor(ResourceFactory.class).newInstance(
this.resourceFactory);
} catch (InstantiationException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
} catch (NoSuchMethodException e) {
throw new RuntimeException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy