Class FPUser


  • public class FPUser
    extends Object
    A collection of attributes that can affect toggle evaluation, usually corresponding to a user of your application.
    • Constructor Detail

      • FPUser

        public FPUser()
        Creates a new FPUser
      • FPUser

        @Deprecated
        public FPUser​(String key)
        Deprecated.
        Creates a new FPUser
        Parameters:
        key - user unique id for percentage rollout
    • Method Detail

      • stableRollout

        public FPUser stableRollout​(String key)
        Set user unique id for percentage rollout
        Parameters:
        key - user unique id for percentage rollout
      • with

        public FPUser with​(String name,
                           String value)
        Add an attribute to the user
        Parameters:
        name - attribute name
        value - attribute value
        Returns:
        the FPUser
      • containAttr

        public boolean containAttr​(String name)
        Check attribute exists
        Parameters:
        name - attribute name
        Returns:
      • getKey

        public String getKey()
        Get FPUser unique identifier
        Returns:
        key
      • getAttrs

        public Map<String,​String> getAttrs()
        Get FPUser all attribute
        Returns:
        attribute set
      • setAttrs

        public void setAttrs​(Map<String,​String> attrs)
        Add multiple attribute to the user
        Parameters:
        attrs - attribute set
      • getAttr

        public String getAttr​(String name)
        Get the specified attribute value
        Parameters:
        name - attribute name
        Returns:
        attribute value