Aris Papadopoulos
Aug 24, 2017 · 1 min read

It doesn’t necessarily need to be so ugly. You would typically have a HashMap<String, String> that maps the “generic” names to the “platform-specific” ones, and then do:

public FunalyticsEvent transformEvent(@NonNull Event event) {
String mappedName = mappings.get(event.name);
FunalyticsParams params = .... // convert event.params to the format that Funalytics expects
return new Funalytics(mappedName == null ? event.name : mappedName, params);
}
)
    Aris Papadopoulos

    Written by

    Android Software Engineer. RxJava, Kotlin, SOLID, Clean code, Clean Architecture and other cool stuff.

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade