Class DefaultClientUser
java.lang.Object
com.iohao.net.extension.client.user.DefaultClientUser
- All Implemented Interfaces:
AttrOptionDynamic, ClientUser
Default client-side user model.
Developers can extend business data through dynamic attributes,
such as currency, battle power, HP, and more.
ClientUser can also be extended via inheritance.
- Author:
- 渔民小镇
- date:
- 2023-07-09
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected final ClientUserChannelCommunication channel used for reading and writing.protected final ClientUserInputCommandsprotected List<InputCommandRegion> protected Stringprotected booleanTrue after login succeeds.protected StringNickname.protected final AttrOptionsprotected long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCommunication channel used for reading and writing.getJwt()Nickname.Gets the dynamic member attributes (options)longbooleanisActive()是否活跃booleanTrue after login succeeds.voidsetActive(boolean active) voidsetInputCommandRegions(List<InputCommandRegion> inputCommandRegions) voidvoidsetLoginSuccess(boolean loginSuccess) True after login succeeds.voidsetNickname(String nickname) Nickname.voidsetUserId(long userId) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AttrOptionDynamic
ifNull, ifPresent, option, option, optionValue
-
Field Details
-
options
-
clientUserChannel
Communication channel used for reading and writing. -
clientUserInputCommands
-
inputCommandRegions
-
loginSuccess
protected boolean loginSuccessTrue after login succeeds. -
userId
protected long userId -
nickname
Nickname. -
jwt
-
active
protected boolean active
-
-
Constructor Details
-
DefaultClientUser
public DefaultClientUser()
-
-
Method Details
-
callbackInputCommandRegion
public void callbackInputCommandRegion()- Specified by:
callbackInputCommandRegionin interfaceClientUser
-
setInputCommandRegions
- Specified by:
setInputCommandRegionsin interfaceClientUser
-
setLoginSuccess
public void setLoginSuccess(boolean loginSuccess) True after login succeeds. -
setUserId
public void setUserId(long userId) - Specified by:
setUserIdin interfaceClientUser
-
setNickname
Nickname.- Specified by:
setNicknamein interfaceClientUser
-
setJwt
- Specified by:
setJwtin interfaceClientUser
-
setActive
public void setActive(boolean active) -
getOptions
Description copied from interface:AttrOptionDynamicGets the dynamic member attributes (options)- Specified by:
getOptionsin interfaceAttrOptionDynamic- Returns:
- The dynamic member attributes
-
getClientUserChannel
Communication channel used for reading and writing.- Specified by:
getClientUserChannelin interfaceClientUser
-
getClientUserInputCommands
- Specified by:
getClientUserInputCommandsin interfaceClientUser
-
getInputCommandRegions
-
isLoginSuccess
public boolean isLoginSuccess()True after login succeeds. -
getUserId
public long getUserId()- Specified by:
getUserIdin interfaceClientUser
-
getNickname
-
getJwt
- Specified by:
getJwtin interfaceClientUser
-
isActive
public boolean isActive()Description copied from interface:ClientUser是否活跃- Specified by:
isActivein interfaceClientUser- Returns:
- true 表示用户活跃
-