Package co.featbit.commons.model
Class FBUser
java.lang.Object
co.featbit.commons.model.FBUser
- All Implemented Interfaces:
Serializable
A collection of attributes that can affect flag evaluation, usually corresponding to a user of your application.
The mandatory properties are the key and name. The key must uniquely identify each user in an environment;
this could be a username or email address for authenticated users, or an ID for anonymous users.
The name is used to search your user quickly in feature flag center.
The custom properties are optional, you may also define custom properties with arbitrary names and values.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder that helps construct FBUser objects. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns a map of all custom attributes set for this usergetKey()returns user's unique key.getProperty(String attribute) Gets the value of a user attribute, if present.returns user's name if presenceinthashCode()toString()
-
Method Details
-
getUserName
returns user's name if presence- Returns:
- a string or null
-
getKey
returns user's unique key.- Returns:
- a string
-
getCustom
Returns a map of all custom attributes set for this user- Returns:
- a map, note that this map is readonly
-
getProperty
Gets the value of a user attribute, if present. This can be either a built-in attribute or a custom one- Parameters:
attribute- – the attribute to get- Returns:
- the attribute value or null
-
toString
-
equals
-
hashCode
public int hashCode()
-