public class BirthDateAttribute
extends java.lang.Object
Overloaded methods allow you to set an approximate date of birth for a user.
EXAMPLE:
UserProfile userProfile = new UserProfile.Builder()
.apply(Attribute.birthDate().withAge(27))
.build();
| Modifier and Type | Method and Description |
|---|---|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> |
withAge(int age)
Updates the birth date attribute with the specified value.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> |
withAgeIfUndefined(int age)
Updates the birth date attribute with the specified value only if the attribute value is undefined.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> |
withBirthDate(java.util.Calendar date)
Updates the birth date attribute with the specified value.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> |
withBirthDate(int year)
Updates the birth date attribute with the specified value.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> |
withBirthDate(int year,
int month)
Updates the birth date attribute with the specified values.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> |
withBirthDate(int year,
int month,
int dayOfMonth)
Updates the birth date attribute with the specified values.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> |
withBirthDateIfUndefined(java.util.Calendar date)
Updates the birth date attribute with the specified value only if the attribute value is undefined.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> |
withBirthDateIfUndefined(int year)
Updates the birth date attribute with the specified value only if the attribute value is undefined.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> |
withBirthDateIfUndefined(int year,
int month)
Updates the birth date attribute with the specified values only if the attribute value is undefined.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> |
withBirthDateIfUndefined(int year,
int month,
int dayOfMonth)
Updates the birth date attribute with the specified values only if the attribute value is undefined.
|
UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> |
withValueReset()
Resets the birth date attribute value.
|
public UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withBirthDate(int year)
NOTE: It overwrites the existing value.
year - Year of birthUserProfileUpdate objectpublic UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withBirthDateIfUndefined(int year)
This methods sets year of the birth date.
year - Year of birthUserProfileUpdate objectpublic UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withBirthDate(int year, int month)
NOTE: It overwrites the existing value.
year - Year of birthmonth - Month of birthUserProfileUpdate objectpublic UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withBirthDateIfUndefined(int year, int month)
This method sets the year and month of the birth date.
year - Year of birthmonth - Month of birthUserProfileUpdate objectpublic UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withBirthDate(int year, int month, int dayOfMonth)
This methods sets year, month and day of the month of the birth date.
NOTE: It overwrites the existing value.
year - Year of birthmonth - Month of birthdayOfMonth - Day of the month of birthUserProfileUpdate objectpublic UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withBirthDateIfUndefined(int year, int month, int dayOfMonth)
This methods sets year, month and day of the month of the birth date.
year - Year of birthmonth - Month of birthdayOfMonth - Day of the month of birthUserProfileUpdate objectpublic UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withAge(int age)
NOTE: It overwrites the existing value.
age - Age of the userUserProfileUpdate objectpublic UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withAgeIfUndefined(int age)
It calculates the birth year by using the following formula: Birth Year = currentYear - age.
age - Age of the userUserProfileUpdate objectpublic UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withBirthDate(@NonNull java.util.Calendar date)
NOTE: It overwrites the existing value.
date - Date of birthUserProfileUpdate objectpublic UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withBirthDateIfUndefined(@NonNull java.util.Calendar date)
date - Date of birthUserProfileUpdate objectpublic UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher> withValueReset()
UserProfileUpdate object