com.yandex.metrica.profile
Class BirthDateAttribute
java.lang.Object
com.yandex.metrica.profile.BirthDateAttribute
public class BirthDateAttribute
extends java.lang.Object
Класс birth date attribute. Методы класса задают возраст или дату рождения пользовательского профиля.
ПРИМЕР:
UserProfile userProfile = new UserProfile.Builder()
.apply(Attribute.birthDate().withAge(27))
.build();
Method Summary
Modifier and Type | Method and Description |
---|---|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> | withAge(int age)
Обновляет значение атрибута.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> | withAgeIfUndefined(int age)
Обновляет значение атрибута, если оно не было установлено ранее.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> | withBirthDate(java.util.Calendar date)
Обновляет значение атрибута.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> | withBirthDate(int year)
Обновляет значение атрибута.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> | withBirthDate(int year, int month)
Обновляет значение атрибута.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> | withBirthDate(int year, int month, int dayOfMonth)
Обновляет значение атрибута.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> | withBirthDateIfUndefined(java.util.Calendar date)
Обновляет значение атрибута, если оно не было установлено ранее.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> | withBirthDateIfUndefined(int year)
Обновляет значение атрибута, если оно не было установлено ранее.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> | withBirthDateIfUndefined(int year, int month)
Обновляет значение атрибута, если оно не было установлено ранее.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> | withBirthDateIfUndefined(int year, int month, int dayOfMonth)
Обновляет значение атрибута, если оно не было установлено ранее.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> | withValueReset()
Сбрасывает значение атрибута.
|
Method Detail
withBirthDate
public UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withBirthDate(int year)
Обновляет значение атрибута.
ПРИМЕЧАНИЕ: Перезаписывает ранее установленное значение атрибута.
- Parameters:
year
- Год рождения- Returns:
- Объект класса
UserProfileUpdate
, который содержит все обновления атрибутов.
withBirthDateIfUndefined
public UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withBirthDateIfUndefined(int year)
Обновляет значение атрибута, если оно не было установлено ранее. Не перезаписывает значение атрибута, если оно было установлено.
- Parameters:
year
- Год рождения- Returns:
- Объект класса
UserProfileUpdate
, который содержит все обновления атрибутов.
withBirthDate
public UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withBirthDate(int year, int month)
Обновляет значение атрибута.
ПРИМЕЧАНИЕ: Перезаписывает ранее установленное значение атрибута.
- Parameters:
year
- Год рожденияmonth
- Месяц рождения- Returns:
- Объект
UserProfileUpdate
, который содержит все обновления атрибутов.
withBirthDateIfUndefined
public UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withBirthDateIfUndefined(int year, int month)
Обновляет значение атрибута, если оно не было установлено ранее. Не перезаписывает значение атрибута, если оно было установлено.
- Parameters:
year
- Year of birthmonth
- Month of birth- Returns:
- Объект
UserProfileUpdate
, который содержит все обновления атрибутов.
withBirthDate
public UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withBirthDate(int year, int month, int dayOfMonth)
Обновляет значение атрибута.
ПРИМЕЧАНИЕ: Перезаписывает ранее установленное значение атрибута.
- Parameters:
year
- Год рожденияmonth
- Месяц рожденияdayOfMonth
- День рождения- Returns:
- Объект
UserProfileUpdate
, который содержит все обновления атрибутов.
withBirthDateIfUndefined
public UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withBirthDateIfUndefined(int year, int month, int dayOfMonth)
Обновляет значение атрибута, если оно не было установлено ранее. Не перезаписывает значение атрибута, если оно было установлено.
- Parameters:
year
- Год рожденияmonth
- Месяц рожденияdayOfMonth
- День рождения- Returns:
- Объект
UserProfileUpdate
, который содержит все обновления атрибутов.
withAge
public UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withAge(int age)
Обновляет значение атрибута.
Вычисляет год рождения по формуле: Birth Year = currentYear - age.
ПРИМЕЧАНИЕ: Перезаписывает ранее установленное значение атрибута.
- Parameters:
age
- Возраст пользователя- Returns:
- Объект
UserProfileUpdate
, который содержит все обновления атрибутов.
withAgeIfUndefined
public UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withAgeIfUndefined(int age)
Обновляет значение атрибута, если оно не было установлено ранее. Не перезаписывает значение атрибута, если оно было установлено.
Вычисляет год рождения по формуле: Birth Year = currentYear - age.
- Parameters:
age
- Возраст пользователя- Returns:
- Объект
UserProfileUpdate
, который содержит все обновления атрибутов.
withBirthDate
public UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withBirthDate(@NonNull java.util.Calendar date)
Обновляет значение атрибута.
ПРИМЕЧАНИЕ: Перезаписывает ранее установленное значение атрибута.
- Parameters:
date
- Дата рождения- Returns:
- Объект
UserProfileUpdate
, который содержит все обновления атрибутов.
withBirthDateIfUndefined
public UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withBirthDateIfUndefined(@NonNull java.util.Calendar date)
Обновляет значение атрибута, если оно не было установлено ранее. Не перезаписывает значение атрибута, если оно было установлено.
- Parameters:
date
- Дата рождения- Returns:
- Объект
UserProfileUpdate
, который содержит все обновления атрибутов.
withValueReset
public UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withValueReset()
Сбрасывает значение атрибута.
- Returns:
- Объект
UserProfileUpdate
, который содержит все обновления атрибутов.