Tabnine Logo
com.orhanobut.tracklytics
Code IndexAdd Tabnine to your IDE (free)

How to use com.orhanobut.tracklytics

Best Java code snippets using com.orhanobut.tracklytics (Showing top 20 results out of 315)

origin: orhanobut/tracklytics

public static Tracklytics init(EventSubscriber eventSubscriber) {
 Tracklytics tracklytics = new Tracklytics(eventSubscriber);
 TracklyticsAspect.subscribe(tracklytics);
 return tracklytics;
}
origin: orhanobut/tracklytics

@TrackEvent("transform")
@TransformAttributeMap(
  keys = {1, 2},
  values = {"finished", "accepted"}
)
private void onItemSelected(@TransformAttribute("status") int position) {
}
origin: orhanobut/tracklytics

 @TrackEvent("button_click")
 @FixedAttribute(key = "button_name", value = "Login")
 @Override public void onClick(View v) {
 }
});
origin: orhanobut/tracklytics

@Test public void fixedAttributeOnMethodScope() throws Throwable {
 class Foo {
  @TrackEvent("title")
  @FixedAttribute(key = "key1", value = "value") public String foo() {
   return "returnValue";
  }
 }
 invokeMethod(Foo.class, "foo");
 assertTrack()
   .event("title")
   .noFilters()
   .noTags()
   .attribute("key1", "value");
}
origin: orhanobut/tracklytics

public Event(TrackEvent trackEvent, Map<String, Object> attributes, Map<String, Object> superAttributes) {
 this.name = trackEvent.value();
 this.filters = trackEvent.filters();
 this.tags = trackEvent.tags();
 this.attributes = attributes;
 this.superAttributes = superAttributes;
}
origin: orhanobut/tracklytics

private void addFixedAttributes(FixedAttributes fixedAttributes, Map<String, Object> attributes) {
 if (fixedAttributes == null) return;
 FixedAttribute[] attributeList = fixedAttributes.value();
 for (FixedAttribute attribute : attributeList) {
  attributes.put(attribute.key(), attribute.value());
  if (attribute.isSuper()) {
   addSuperAttribute(attribute.key(), attribute.value());
  }
 }
}
origin: orhanobut/tracklytics

public void trackEvent(String eventName) {
 trackEvent(new Event(eventName, null, null, null, superAttributes));
}
origin: orhanobut/tracklytics

private void trackEvent(Event event) {
 eventSubscriber.onEventTracked(event);
 log(event);
}
origin: orhanobut/tracklytics

@TrackEvent("login")
private void onLoggedIn(@TrackableAttribute User user, @Attribute("id") String id) {
}
origin: orhanobut/tracklytics

@TrackEvent("another_event")
@Attribute("user_id") // This attribute will use return value as attribute value.
private String userId() {
 return "2342";
}
origin: orhanobut/tracklytics

 @Override public void onAspectSuperAttributeRemoved(String key) {
  removeSuperAttribute(key);
 }
}
origin: orhanobut/tracklytics

@Override public void onAspectSuperAttributeAdded(String key, Object value) {
 addSuperAttribute(key, value);
}
origin: orhanobut/tracklytics

private void pushEvent(TrackEvent trackEvent, Map<String, Object> attributes) {
 if (aspectListener == null) return;
 aspectListener.onAspectEventTriggered(trackEvent, attributes);
}
origin: orhanobut/tracklytics

private void addSuperAttribute(String key, Object value) {
 if (aspectListener == null) return;
 aspectListener.onAspectSuperAttributeAdded(key, value);
}
origin: orhanobut/tracklytics

private void removeSuperAttribute(String key) {
 if (aspectListener == null) return;
 aspectListener.onAspectSuperAttributeRemoved(key);
}
origin: orhanobut/tracklytics

 @TrackEvent("event_java")
 public void trackFoo() {

 }
}
origin: orhanobut/tracklytics

@Test public void useDefaultValueWhenThereIsNoReturnValue() throws Throwable {
 class Foo {
  @TrackEvent("title")
  @Attribute(value = "key1", defaultValue = "defaultValue") public void foo() {
  }
 }
 invokeMethod(Foo.class, "foo");
 assertTrack()
   .event("title")
   .noFilters()
   .noTags()
   .attribute("key1", "defaultValue");
}
origin: orhanobut/tracklytics

private void addFixedAttribute(FixedAttribute attribute, Map<String, Object> attributes) {
 if (attribute == null) return;
 attributes.put(attribute.key(), attribute.value());
 if (attribute.isSuper()) {
  addSuperAttribute(attribute.key(), attribute.value());
 }
}
origin: orhanobut/tracklytics

@Override public void onAspectEventTriggered(TrackEvent trackEvent, Map<String, Object> attributes) {
 trackEvent(new Event(trackEvent, attributes, superAttributes));
}
origin: orhanobut/tracklytics

public void trackEvent(String eventName, Map<String, Object> attributes) {
 trackEvent(new Event(eventName, null, null, attributes, superAttributes));
}
com.orhanobut.tracklytics

Most used classes

  • Tracklytics
    Annotation based tracking event handler.
  • TrackEvent
  • Attribute
  • Event
    This is the container for the triggered tracking event. All related information is kept in here.
  • EventLogListener
    Subscribe to the pre-formatted log message stream. Once there is a subscriber, log message will be s
  • FixedAttribute,
  • TracklyticsAspect,
  • TransformAttribute,
  • TransformAttributeMap,
  • AspectListener,
  • AssertTracker,
  • FixedAttributes,
  • RemoveSuperAttribute,
  • Trackable,
  • TrackableAttribute,
  • TracklyticsAspectTest
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now