keycloak-service
公開メンバ関数 | 非公開変数類 | 静的非公開変数類 | 全メンバ一覧
org.keycloak.forms.account.freemarker.model.AccountBean クラス
org.keycloak.forms.account.freemarker.model.AccountBean 連携図
Collaboration graph

公開メンバ関数

 AccountBean (UserModel user, MultivaluedMap< String, String > profileFormData)
 
String getFirstName ()
 
String getLastName ()
 
String getUsername ()
 
String getEmail ()
 
Map< String, String > getAttributes ()
 

非公開変数類

final UserModel user
 
final MultivaluedMap< String, String > profileFormData
 
final Map< String, String > attributes = new HashMap<>()
 

静的非公開変数類

static final Logger logger = Logger.getLogger(AccountBean.class)
 

詳解

著者
Stian Thorgersen

構築子と解体子

◆ AccountBean()

org.keycloak.forms.account.freemarker.model.AccountBean.AccountBean ( UserModel  user,
MultivaluedMap< String, String >  profileFormData 
)
inline
42  {
43  this.user = user;
45 
46  for (Map.Entry<String, List<String>> attr : user.getAttributes().entrySet()) {
47  List<String> attrValue = attr.getValue();
48  if (attrValue.size() > 0) {
49  attributes.put(attr.getKey(), attrValue.get(0));
50  }
51 
52  if (attrValue.size() > 1) {
53  logger.warnf("There are more values for attribute '%s' of user '%s' . Will display just first value", attr.getKey(), user.getUsername());
54  }
55  }
56 
57  if (profileFormData != null) {
58  for (String key : profileFormData.keySet()) {
59  if (key.startsWith(Constants.USER_ATTRIBUTES_PREFIX)) {
60  String attribute = key.substring(Constants.USER_ATTRIBUTES_PREFIX.length());
61  attributes.put(attribute, profileFormData.getFirst(key));
62  }
63  }
64  }
65  }
final MultivaluedMap< String, String > profileFormData
Definition: AccountBean.java:37
final Map< String, String > attributes
Definition: AccountBean.java:40
static final Logger logger
Definition: AccountBean.java:34
final UserModel user
Definition: AccountBean.java:36

関数詳解

◆ getAttributes()

Map<String, String> org.keycloak.forms.account.freemarker.model.AccountBean.getAttributes ( )
inline
87  {
88  return attributes;
89  }
final Map< String, String > attributes
Definition: AccountBean.java:40

◆ getEmail()

String org.keycloak.forms.account.freemarker.model.AccountBean.getEmail ( )
inline
83  {
84  return profileFormData != null ? profileFormData.getFirst("email") :user.getEmail();
85  }
final MultivaluedMap< String, String > profileFormData
Definition: AccountBean.java:37
final UserModel user
Definition: AccountBean.java:36

◆ getFirstName()

String org.keycloak.forms.account.freemarker.model.AccountBean.getFirstName ( )
inline
67  {
68  return profileFormData != null ? profileFormData.getFirst("firstName") : user.getFirstName();
69  }
final MultivaluedMap< String, String > profileFormData
Definition: AccountBean.java:37
final UserModel user
Definition: AccountBean.java:36

◆ getLastName()

String org.keycloak.forms.account.freemarker.model.AccountBean.getLastName ( )
inline
71  {
72  return profileFormData != null ? profileFormData.getFirst("lastName") :user.getLastName();
73  }
final MultivaluedMap< String, String > profileFormData
Definition: AccountBean.java:37
final UserModel user
Definition: AccountBean.java:36

◆ getUsername()

String org.keycloak.forms.account.freemarker.model.AccountBean.getUsername ( )
inline
75  {
76  if (profileFormData != null && profileFormData.containsKey("username")) {
77  return profileFormData.getFirst("username");
78  } else {
79  return user.getUsername();
80  }
81  }
final MultivaluedMap< String, String > profileFormData
Definition: AccountBean.java:37
final UserModel user
Definition: AccountBean.java:36

メンバ詳解

◆ attributes

final Map<String, String> org.keycloak.forms.account.freemarker.model.AccountBean.attributes = new HashMap<>()
private

◆ logger

final Logger org.keycloak.forms.account.freemarker.model.AccountBean.logger = Logger.getLogger(AccountBean.class)
staticprivate

◆ profileFormData

final MultivaluedMap<String, String> org.keycloak.forms.account.freemarker.model.AccountBean.profileFormData
private

◆ user

final UserModel org.keycloak.forms.account.freemarker.model.AccountBean.user
private

このクラス詳解は次のファイルから抽出されました: