Package com.yandex.metrica.profile
Class BooleanAttribute
java.lang.Object
com.yandex.metrica.profile.BooleanAttribute
- Direct Known Subclasses:
NotificationsEnabledAttribute
public class BooleanAttribute
extends java.lang.Object
The boolean attribute class.
It enables creating custom boolean attribute for the user profile.
EXAMPLE:
UserProfile userProfile = new UserProfile.Builder()
.apply(Attribute.customBoolean("is_enabled").withValue(true))
.build();
-
Method Summary
Modifier and Type Method Description UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher>withValue(boolean value)Updates the attribute with the specified value.UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher>withValueIfUndefined(boolean value)Updates the attribute with the specified value only if the attribute value is undefined.UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher>withValueReset()Resets the attribute value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
withValue
@NonNull public UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withValue(boolean value)Updates the attribute with the specified value.- Parameters:
value- Boolean value- Returns:
- The
UserProfileUpdateobject
-
withValueIfUndefined
@NonNull public UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withValueIfUndefined(boolean 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- Boolean value- Returns:
- The
UserProfileUpdateobject
-
withValueReset
@NonNull public UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withValueReset()Resets the attribute value.- Returns:
- The
UserProfileUpdateobject
-