
com.segment.analytics.Utils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of analytics-tests Show documentation
Show all versions of analytics-tests Show documentation
The hassle-free way to add analytics to your Android app.
The newest version!
package com.segment.analytics;
import java.util.LinkedHashMap;
public final class Utils {
private Utils() {
throw new AssertionError("No instances.");
}
/** Create a {@link com.segment.analytics.Traits} with only a randomly generated anonymous ID. */
public static Traits createTraits() {
return Traits.create();
}
/** Create a {@link com.segment.analytics.Traits} object with the given {@code userId}. */
public static Traits createTraits(String userId) {
return createTraits().putUserId(userId);
}
/** Create an {@link com.segment.analytics.AnalyticsContext} with the given {@code traits}. */
public static AnalyticsContext createContext(Traits traits) {
AnalyticsContext context = new AnalyticsContext(new LinkedHashMap());
context.setTraits(traits);
return context;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy