com.yandex.metrica.profile
Class GenderAttribute
java.lang.Object
com.yandex.metrica.profile.GenderAttribute
public class GenderAttribute
extends java.lang.Object
Методы класса задают пол пользовательского профиля.
Допустимые значения:
Можно установить значение OTHER и передать дополнительную информацию в собственном атрибуте.
ПРИМЕР:
UserProfile userProfile = new UserProfile.Builder()
.apply(Attribute.gender().withValue(GenderAttribute.Gender.FEMALE))
.build();
Nested Class Summary
Modifier and Type | Class and Description |
---|---|
static class | GenderAttribute.Gender
Содержит возможные значения пола для класса GenderAttribute.
|
Method Summary
Modifier and Type | Method and Description |
---|---|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> | withValue(GenderAttribute.Gender value)
Обновляет значение атрибута.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> | withValueIfUndefined(GenderAttribute.Gender value)
Обновляет значение атрибута, если оно не было установлено ранее.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> | withValueReset()
Сбрасывает значение атрибута.
|
Method Detail
withValue
@NonNull public UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withValue(@NonNull GenderAttribute.Gender value)
Обновляет значение атрибута.
ПРИМЕЧАНИЕ: Перезаписывает ранее установленное значение атрибута.
- Parameters:
value
-GenderAttribute.Gender
enumeration value- Returns:
- Объект
UserProfileUpdate
, который содержит все обновления атрибутов.
withValueIfUndefined
@NonNull public UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withValueIfUndefined(@NonNull GenderAttribute.Gender value)
Обновляет значение атрибута, если оно не было установлено ранее. Не перезаписывает значение атрибута, если оно было установлено.
- Parameters:
value
-GenderAttribute.Gender
enumeration value- Returns:
- Объект
UserProfileUpdate
, который содержит все обновления атрибутов.
withValueReset
@NonNull public UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withValueReset()
Сбрасывает значение атрибута.
- Returns:
- Объект
UserProfileUpdate
, который содержит все обновления атрибутов.