Code example for GsonBuilder

Methods: registerTypeAdapter

0
	final public static String indexName_ = "association_index";
	final public static String indexCollectionName_ = "assocs_index";
	 
	@Override 
	public GsonBuilder extendBuilder(GsonBuilder gp) {
		return gp.registerTypeAdapter(AssociationFeaturePojo.class, new EventFeaturePojoSerializer());
	} 
	 
	///////////////////////////////////////////////////////////////////////////////////// 
 
	// Index synchronization 
	 
	protected static class EventFeaturePojoSerializer implements JsonSerializer<AssociationFeaturePojo> 
	{ 
		@Override 
		public JsonElement serialize(AssociationFeaturePojo evt, Type typeOfT, JsonSerializationContext context)
		{ 
			String sIndex = evt.getIndex();
			String sCommunity = evt.getCommunityId().toString();
			synchronizeWithIndex(evt);