Last active
December 10, 2015 13:28
-
-
Save johncarl81/4440619 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 class Parcels { | |
public static final String PARCELS_NAME = "Parcels"; | |
public static final String PARCELS_REPOSITORY_NAME = "Transfuse$Parcels"; | |
public static final String PARCELS_PACKAGE = "org.androidtransfuse"; | |
private static final ParcelRepository PARCELS; | |
static{ | |
ParcelRepository parcelsCreation; | |
try{ | |
Class injectorClass = Class.forName(PARCELS_PACKAGE + "." + PARCELS_REPOSITORY_NAME); | |
parcelsCreation = (ParcelRepository) injectorClass.newInstance(); | |
} catch (ClassNotFoundException e) { | |
parcelsCreation = null; | |
} catch (InstantiationException e) { | |
throw new TransfuseRuntimeException("Unable to instantiate generated InjectorRepository", e); | |
} catch (IllegalAccessException e) { | |
throw new TransfuseRuntimeException("Unable to access generated InjectorRepository", e); | |
} | |
PARCELS = parcelsCreation; | |
} | |
public static Parcelable wrap(Object input) { | |
return PARCELS.wrap(input); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment