Class FBUser.Builder

java.lang.Object
co.featbit.commons.model.FBUser.Builder
Enclosing class:
FBUser

public static class FBUser.Builder extends Object
A builder that helps construct FBUser objects. Builder calls can be chained, supporting the following pattern:

     FBUser user = new FBUser.Builder("key")
               .userName("name")
               .custom("property", "value")
               .build()
 
  • Constructor Details

    • Builder

      public Builder(String key)
      Creates a builder with the specified key
      Parameters:
      key - key
  • Method Details

    • key

      public FBUser.Builder key(String s)
      Changes the user's key.
      Parameters:
      s - key
      Returns:
      the builder
    • userName

      public FBUser.Builder userName(String s)
      set the user's userName.
      Parameters:
      s - username
      Returns:
      the builder
    • custom

      public FBUser.Builder custom(String key, String value)
      Adds a String-valued custom attribute. When set to one of the built-in user attribute keys the key/value pair will be ignored.
      Parameters:
      key - custom attribute name
      value - custom attribute value
      Returns:
      the builder
    • build

      public FBUser build()
      Builds the configured FBUser object. Returns the FBUser configured by this builder