Skip to content

Instantly share code, notes, and snippets.

@christiangoudreau
Created November 15, 2011 00:50
Show Gist options
  • Save christiangoudreau/1365739 to your computer and use it in GitHub Desktop.
Save christiangoudreau/1365739 to your computer and use it in GitHub Desktop.
Tokenizers / ActivityMapper
@WithTokenizers({WelcomePlace.Tokenizer.class})
public interface AdminPlaceHistoryMapper extends PlaceHistoryMapper {
}
public class ContentActivityMapper implements ActivityMapper {
private final Provider<WelcomeActivity> appActivityProvider;
@Inject
public ContentActivityMapper(final Provider<WelcomeActivity> appActivityProvider) {
this.appActivityProvider = appActivityProvider;
}
@Override
public Activity getActivity(Place place) {
if (place instanceof WelcomePlace) {
return appActivityProvider.get().withPlace(place);
}
return appActivityProvider.get().withPlace(place);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment