public final class CounterAttribute
extends java.lang.Object
The counter attribute class. It enables creating custom counter for the user profile.

EXAMPLE:

     CounterAttribute timeLeftAttribute = Attribute.customCounter("time_left");
     UserProfile userProfile = new UserProfile.Builder()
                     .apply(Attribute.timeLeftAttribute().withDelta(-10d))
                     .build();
 

Method Summary

All Methods
Instance Methods
Concrete Methods
Modifier and TypeMethod and Description
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher>withDelta(double value)
Updates the counter attribute value with the specified delta value.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

withDelta

@NonNull
public UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withDelta(double value)
Updates the counter attribute value with the specified delta value.
Parameters:
value - Delta value to change the counter attribute value
Returns:
The UserProfileUpdate object