Class FBUser

java.lang.Object
co.featbit.commons.model.FBUser
All Implemented Interfaces:
Serializable

public final class FBUser extends Object implements 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:
  • Method Details

    • getUserName

      public String getUserName()
      returns user's name if presence
      Returns:
      a string or null
    • getKey

      public String getKey()
      returns user's unique key.
      Returns:
      a string
    • getCustom

      public Map<String,String> getCustom()
      Returns a map of all custom attributes set for this user
      Returns:
      a map, note that this map is readonly
    • getProperty

      public String getProperty(String attribute)
      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

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object