Package com.yandex.metrica.profile
Class Attribute
java.lang.Object
com.yandex.metrica.profile.Attribute
public class Attribute
extends java.lang.Object
The attribute class.
Attribute is a property of the user profile. You can use predefined profiles (e.g. name, gender, etc.) or create your own.
AppMetrica allows you to create up to 100 custom attributes.
Attributes are applied by using theUserProfile.Builder.apply(UserProfileUpdate) method.-
Constructor Summary
Constructors Constructor Description Attribute() -
Method Summary
Modifier and Type Method Description static BirthDateAttributebirthDate()Creates a birth date attribute.static BooleanAttributecustomBoolean(java.lang.String key)Creates a custom boolean attribute.static CounterAttributecustomCounter(java.lang.String key)Creates a custom counter attribute.static NumberAttributecustomNumber(java.lang.String key)Creates a custom number attribute.static StringAttributecustomString(java.lang.String key)Creates a custom string attribute.static GenderAttributegender()Creates a gender attribute.static NameAttributename()Creates a name attribute.static NotificationsEnabledAttributenotificationsEnabled()Creates a NotificationsEnabled attribute.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Attribute
public Attribute()
-
-
Method Details
-
customString
Creates a custom string attribute.- Parameters:
key- Attribute key. It can contain up to 200 characters- Returns:
- The
StringAttributeobject
-
customNumber
Creates a custom number attribute.- Parameters:
key- Attribute key. It can contain up to 200 characters- Returns:
- The
NumberAttributeobject
-
customBoolean
Creates a custom boolean attribute.- Parameters:
key- Attribute key. It can contain up to 200 characters- Returns:
- The
BooleanAttributeobject
-
customCounter
Creates a custom counter attribute.- Parameters:
key- Attribute key. It can contain up to 200 characters- Returns:
- The
CounterAttributeobject
-
gender
Creates a gender attribute.- Returns:
- The
GenderAttributeobject
-
birthDate
Creates a birth date attribute.- Returns:
- The
BirthDateAttributeobject
-
notificationsEnabled
Creates a NotificationsEnabled attribute. It indicates whether the user has enabled notifications for the application.- Returns:
- The
NotificationsEnabledAttributeobject
-
name
Creates a name attribute.- Returns:
- The
NameAttributeobject
-