Package io.appmetrica.analytics.profile
Class StringAttribute
java.lang.Object
io.appmetrica.analytics.profile.StringAttribute
- Direct Known Subclasses:
NameAttribute
The string attribute class.
It enables creating custom string attribute for the user profile.
EXAMPLE:
UserProfile userProfile = new UserProfile.Builder()
.apply(Attribute.customString("favorite_country").withValue("Russia"))
.build();
-
Method Summary
Modifier and TypeMethodDescriptionUserProfileUpdate<? extends io.appmetrica.analytics.impl.profile.UserProfileUpdatePatcher>
Updates the string attribute with the specified value.UserProfileUpdate<? extends io.appmetrica.analytics.impl.profile.UserProfileUpdatePatcher>
withValueIfUndefined
(String value) Updates the attribute with the specified value only if the attribute value is undefined.UserProfileUpdate<? extends io.appmetrica.analytics.impl.profile.UserProfileUpdatePatcher>
Resets the attribute value.
-
Method Details
-
withValue
@NonNull public UserProfileUpdate<? extends io.appmetrica.analytics.impl.profile.UserProfileUpdatePatcher> withValue(@NonNull String value) Updates the string attribute with the specified value.- Parameters:
value
- String value- Returns:
- The
UserProfileUpdate
object
-
withValueIfUndefined
@NonNull public UserProfileUpdate<? extends io.appmetrica.analytics.impl.profile.UserProfileUpdatePatcher> withValueIfUndefined(@NonNull String value) Updates the attribute with the specified value only if the attribute value is undefined. The method doesn't affect the value if it has been set earlier.- Parameters:
value
- String value- Returns:
- The
UserProfileUpdate
object
-
withValueReset
@NonNull public UserProfileUpdate<? extends io.appmetrica.analytics.impl.profile.UserProfileUpdatePatcher> withValueReset()Resets the attribute value.- Returns:
- The
UserProfileUpdate
object
-