SelectAccountMessage
Package: velox.api.layer1.messages
Type: Class
Inheritance: java.lang.Object รขโ โ SelectAccountMessage
Descriptionโ
This message requests account selection. Should be sent via Layer1ApiAdminListener.onUserMessage(Object)
Fieldsโ
accountsInfoโ
public final AccountInfo[] accountsInfo
Array of accounts to select from
Constructorsโ
SelectAccountMessageโ
public SelectAccountMessage(AccountInfo[] accountsInfo)
Constructs new account selection request
Parameters:
accountsInfo- Accounts to select from
Methodsโ
setโ
public void set(int selectedIndex)
Sets selected account index after selection is performed. Should be called once. This unblocks all pending get() calls and prevents blocking further ones.
Parameters:
selectedIndex- Index inaccountsInfoarray
getโ
public int get() throws InterruptedException
Waits till selection is done and returns index of account that was selected. Can be called from multiple places.
Returns: Index of selected account in array passed to SelectAccountMessage(AccountInfo[]) and available as accountsInfo
Throws:
InterruptedException- If the current thread is interrupted while waiting