public class BirthDateAttribute
extends java.lang.Object
Класс birth date attribute. Методы класса задают возраст или дату рождения пользовательского профиля.

ПРИМЕР:

      UserProfile userProfile = new UserProfile.Builder()
                     .apply(Attribute.birthDate().withAge(27))
                     .build();
 

Method Summary

All Methods
Instance Methods
Concrete Methods
Modifier and TypeMethod 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()
Сбрасывает значение атрибута.

Methods inherited from class java.lang.Object

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

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 birth
month - 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, который содержит все обновления атрибутов.