Package com.launchdarkly.sdk
Class UserAttribute
java.lang.Object
com.launchdarkly.sdk.UserAttribute
- All Implemented Interfaces:
JsonSerializable
Deprecated.
Represents a built-in or custom attribute name supported by
LDUser
.
Application code rarely needs to use this type; it is used internally by the SDK for
efficiency in flag evaluations. It can also be used as a reference for the constant
names of built-in attributes such as EMAIL
. However, in the newer
LDContext
model, there are very few reserved attribute names, so the
equivalent of EMAIL
would simply be a custom attribute called "email".
For a fuller description of user attributes and how they can be referenced in feature flag rules, see the reference guides on Setting user attributes and Targeting users.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final UserAttribute
Deprecated.Represents the anonymous attribute.static final UserAttribute
Deprecated.Represents the avatar URL attribute.static final UserAttribute
Deprecated.Represents the country attribute.static final UserAttribute
Deprecated.Represents the user key attribute.static final UserAttribute
Deprecated.Represents the first name attribute.static final UserAttribute
Deprecated.Represents the IP address attribute.static final UserAttribute
Deprecated.Represents the user key attribute.static final UserAttribute
Deprecated.Represents the last name attribute.static final UserAttribute
Deprecated.Represents the full name attribute. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated.static UserAttribute
Deprecated.Returns a UserAttribute instance for the specified attribute name.getName()
Deprecated.Returns the case-sensitive attribute name.int
hashCode()
Deprecated.boolean
Deprecated.Returns true for a built-in attribute or false for a custom attribute.toString()
Deprecated.
-
Field Details
-
KEY
Deprecated.Represents the user key attribute. -
IP
Deprecated.Represents the IP address attribute. -
EMAIL
Deprecated.Represents the user key attribute. -
NAME
Deprecated.Represents the full name attribute. -
AVATAR
Deprecated.Represents the avatar URL attribute. -
FIRST_NAME
Deprecated.Represents the first name attribute. -
LAST_NAME
Deprecated.Represents the last name attribute. -
COUNTRY
Deprecated.Represents the country attribute. -
ANONYMOUS
Deprecated.Represents the anonymous attribute.
-
-
Method Details
-
forName
Deprecated.Returns a UserAttribute instance for the specified attribute name.For built-in attributes, the same instances are always reused and
isBuiltIn()
will return true. For custom attributes, a new instance is created andisBuiltIn()
will return false.- Parameters:
name
- the attribute name- Returns:
- a
UserAttribute
-
getName
Deprecated.Returns the case-sensitive attribute name.- Returns:
- the attribute name
-
isBuiltIn
public boolean isBuiltIn()Deprecated.Returns true for a built-in attribute or false for a custom attribute.- Returns:
- true if it is a built-in attribute
-
equals
Deprecated. -
hashCode
public int hashCode()Deprecated. -
toString
Deprecated.
-
LDUser
replaced byLDContext