Created
May 18, 2013 19:21
-
-
Save fumingshih/5605501 to your computer and use it in GitHub Desktop.
code for gson factory
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 TypeAdapterFactory getPipelineFactory() { | |
return getPipelineFactory(this); | |
} | |
private static PipelineFactory PIPELINE_FACTORY; | |
public static PipelineFactory getPipelineFactory(Context context) { | |
if (PIPELINE_FACTORY == null) { | |
PIPELINE_FACTORY = new PipelineFactory(context); | |
} | |
return PIPELINE_FACTORY; | |
} | |
public SingletonTypeAdapterFactory getProbeFactory() { | |
return getProbeFactory(this); | |
} | |
private static SingletonTypeAdapterFactory PROBE_FACTORY; | |
public static SingletonTypeAdapterFactory getProbeFactory(Context context) { | |
if (PROBE_FACTORY == null) { | |
PROBE_FACTORY = new SingletonTypeAdapterFactory( | |
new DefaultRuntimeTypeAdapterFactory<Probe>( | |
context, | |
Probe.class, | |
null, | |
new ContextInjectorTypeAdapaterFactory(context, new ConfigurableTypeAdapterFactory()))); | |
} | |
return PROBE_FACTORY; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment