Class NumberAttribute

java.lang.Object
io.appmetrica.analytics.profile.NumberAttribute

public final class NumberAttribute extends Object
The number attribute class. It enables creating custom number attribute for the user profile.

EXAMPLE:

     UserProfile userProfile = new UserProfile.Builder()
                     .apply(Attribute.customNumber("level").withValue(5d))
                     .build();
 
  • Method Details

    • withValue

      @NonNull public UserProfileUpdate<? extends io.appmetrica.analytics.impl.profile.UserProfileUpdatePatcher> withValue(double value)
      Updates the attribute with the specified value.
      Parameters:
      value - Number value
      Returns:
      The UserProfileUpdate object
    • withValueIfUndefined

      @NonNull public UserProfileUpdate<? extends io.appmetrica.analytics.impl.profile.UserProfileUpdatePatcher> withValueIfUndefined(double 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 - Number 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