Attribute class

com.yandex.metrica.profile

public class Attribute

Methods of the class create predefined and custom profile attributes.

AppMetrica lets you create up to 100 custom attributes.

Methods

BirthDateAttributebirthDate()

Creates a birth date attribute.

BooleanAttributecustomBoolean(@NonNull String key)

Creates a custom attribute with the bool type.

CounterAttributecustomCounter(@NonNull String key)

Creates a custom attribute of the counter type.

NumberAttributecustomNumber(@NonNull String key)

Creates a custom attribute with the double type.

StringAttributecustomString(@NonNull String key)

Creates a custom attribute with the string type.

GenderAttributegender()

Creates a gender attribute.

NameAttributename()

Creates a name attribute.

NotificationsEnabledAttributenotificationsEnabled()

Creates a NotificationsEnabled attribute.

Method descriptions

birthDate

public static BirthDateAttribute birthDate()

Creates a birth date attribute.

Returns:

The instance of the BirthDateAttribute class.

customBoolean

public static BooleanAttribute customBoolean(@NonNull String key)

Creates a custom attribute with the bool type.

Parameters:
key

Attribute name. The value can contain up to 200 characters.

Returns:

The instance of the BooleanAttribute class.

customCounter

public static CounterAttribute customCounter(@NonNull String key)

Creates a custom attribute of the counter type.

Parameters:
key

Attribute name. The value can contain up to 200 characters.

Returns:

The instance of the CounterAttribute class.

customNumber

public static NumberAttribute customNumber(@NonNull String key)

Creates a custom attribute with the double type.

Parameters:
key

Attribute name. The value can contain up to 200 characters.

Returns:

The instance of the NumberAttribute class.

customString

public static StringAttribute customString(@NonNull String key)

Creates a custom attribute with the string type.

Parameters:
key

Attribute name. The value can contain up to 200 characters.

Returns:

The instance of the StringAttribute class.

gender

public static GenderAttribute gender()

Creates a gender attribute.

Returns:

The instance of the GenderAttribute class.

name

public static NameAttribute name()

Creates a name attribute.

Returns:

The instance of the NameAttribute class.

notificationsEnabled

public static NotificationsEnabledAttribute notificationsEnabled()

Creates a NotificationsEnabled attribute.

Returns:

The instance of the NotificationsEnabledAttribute class.