tcMenuJavaAPI
Static Public Member Functions | List of all members
com.thecoderscorner.menu.remote.commands.CommandFactory Class Reference

Static Public Member Functions

static MenuJoinCommand newJoinCommand (String name)
 
static MenuJoinCommand newJoinCommand (String name, UUID uuid, int serialNo)
 
static MenuHeartbeatCommand newHeartbeatCommand (int frequency, HeartbeatMode mode)
 
static MenuAcknowledgementCommand newAcknowledgementCommand (CorrelationId correlationId, AckStatus status)
 
static MenuPairingCommand newPairingCommand (String name, UUID uuid)
 
static MenuDialogCommand newDialogCommand (DialogMode mode, String header, String msg, MenuButtonType b1, MenuButtonType b2, CorrelationId correlationId)
 
static MenuBootstrapCommand newBootstrapCommand (MenuBootstrapCommand.BootType type)
 
static MenuAnalogBootCommand newAnalogBootCommand (int parentId, AnalogMenuItem item, int currentVal)
 
static MenuRuntimeListBootCommand newRuntimeListBootCommand (int parentId, RuntimeListMenuItem item, List< String > val)
 
static MenuSubBootCommand newMenuSubBootCommand (int parentId, SubMenuItem item)
 
static MenuEnumBootCommand newMenuEnumBootCommand (int parentId, EnumMenuItem item, int currentVal)
 
static MenuBooleanBootCommand newMenuBooleanBootCommand (int parentId, BooleanMenuItem item, boolean currentVal)
 
static MenuFloatBootCommand newMenuFloatBootCommand (int parentId, FloatMenuItem item, Float currentVal)
 
static MenuActionBootCommand newMenuActionBootCommand (int parentId, ActionMenuItem item)
 
static MenuTextBootCommand newMenuTextBootCommand (int parentId, EditableTextMenuItem item, String currentVal)
 
static MenuLargeNumBootCommand newLargeNumberBootItem (int parentId, EditableLargeNumberMenuItem item, BigDecimal currentVal)
 
static MenuChangeCommand newDeltaChangeCommand (CorrelationId correlation, MenuItem item, int value)
 
static MenuChangeCommand newAbsoluteMenuChangeCommand (CorrelationId correlation, MenuItem item, Object value)
 
static MenuChangeCommand newListResponseChangeCommand (CorrelationId correlation, MenuItem item, ListResponse value)
 
static MenuChangeCommand newListResponseChangeCommand (CorrelationId correlation, int itemId, ListResponse value)
 
static MenuChangeCommand newDeltaChangeCommand (CorrelationId correlation, int itemId, int value)
 
static MenuChangeCommand newAbsoluteMenuChangeCommand (CorrelationId correlation, int itemId, Object value)
 
static MenuChangeCommand newAbsoluteListChangeCommand (CorrelationId correlation, int itemId, List< String > values)
 

Detailed Description

These static helper methods are the preferred way to create command message that can be sent and received from a remote connection. Each protocol can convert sent and received messages into this form.

Member Function Documentation

◆ newAbsoluteListChangeCommand()

static MenuChangeCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newAbsoluteListChangeCommand ( CorrelationId  correlation,
int  itemId,
List< String >  values 
)
static

Creates a new absolute change command given the menu item ID and the absolute change in value.

Parameters
correlationa correlation ID that will be returned in the subsequent acknowledgement.
itemIdthe item ID for which to send
valuesthe new value
Returns
a new change message

◆ newAbsoluteMenuChangeCommand() [1/2]

static MenuChangeCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newAbsoluteMenuChangeCommand ( CorrelationId  correlation,
int  itemId,
Object  value 
)
static

Creates a new absolute change command given the menu item ID and the absolute change in value.

Parameters
correlationa correlation ID that will be returned in the subsequent acknowledgement.
itemIdthe item ID for which to send
valuethe new value
Returns
a new change message

◆ newAbsoluteMenuChangeCommand() [2/2]

static MenuChangeCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newAbsoluteMenuChangeCommand ( CorrelationId  correlation,
MenuItem  item,
Object  value 
)
static

Creates a new absolute change command given the menu item and the absolute change in value.

Parameters
correlationa correlation ID that will be returned in the subsequent acknowledgement.
itemthe item for which to send
valuethe new value
Returns
a new change message

◆ newAcknowledgementCommand()

static MenuAcknowledgementCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newAcknowledgementCommand ( CorrelationId  correlationId,
AckStatus  status 
)
static

create an acknowledgement message for a given correlation and status

Parameters
correlationIdthe correlation
statusthe status
Returns
the message

◆ newAnalogBootCommand()

static MenuAnalogBootCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newAnalogBootCommand ( int  parentId,
AnalogMenuItem  item,
int  currentVal 
)
static

create a new analog bootstrap command.

Parameters
parentIdthe parent onto which the item will be placed.
itemthe item itself.
currentValthe current value
Returns
a new analog boot command

◆ newBootstrapCommand()

static MenuBootstrapCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newBootstrapCommand ( MenuBootstrapCommand.BootType  type)
static

Create a new bootstrap message either to indicate the bootstrap start or end

Parameters
typeone of the enum values allowed
Returns
bootstrap message

◆ newDeltaChangeCommand() [1/2]

static MenuChangeCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newDeltaChangeCommand ( CorrelationId  correlation,
int  itemId,
int  value 
)
static

Creates a new delta change command given the menu item ID and the delta change in value.

Parameters
correlationa correlation ID that will be returned in the subsequent acknowledgement.
itemIdthe item ID for which to send
valuethe change in value as a delta of the current value
Returns
a new change message

◆ newDeltaChangeCommand() [2/2]

static MenuChangeCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newDeltaChangeCommand ( CorrelationId  correlation,
MenuItem  item,
int  value 
)
static

Creates a new delta change command given the menu item and the delta change in value.

Parameters
correlationa correlation ID that will be returned in the subsequent acknowledgement.
itemthe item for which to send
valuethe change in value as a delta of the current value
Returns
a new change message

◆ newHeartbeatCommand()

static MenuHeartbeatCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newHeartbeatCommand ( int  frequency,
HeartbeatMode  mode 
)
static

Create a new heartbeat message with the frequency specified

Parameters
frequencythe frequency
Returns
heartbeat command

◆ newJoinCommand() [1/2]

static MenuJoinCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newJoinCommand ( String  name)
static

Create a new join command that has a random UUID

Parameters
namethe name that the remote will show for the connection
Returns
join command.

◆ newJoinCommand() [2/2]

static MenuJoinCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newJoinCommand ( String  name,
UUID  uuid,
int  serialNo 
)
static

Create a new join command that has a fixed UUID that you provide.

Parameters
namethe name that the remote will show for the connection
uuidthe UUID that will the remote will see for this.
Returns
join command

◆ newLargeNumberBootItem()

static MenuLargeNumBootCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newLargeNumberBootItem ( int  parentId,
EditableLargeNumberMenuItem  item,
BigDecimal  currentVal 
)
static

create a new large number bootstrap command.

Parameters
parentIdthe parent onto which the item will be placed.
itemthe item itself.
currentValthe current value
Returns
a new number boot command

◆ newListResponseChangeCommand() [1/2]

static MenuChangeCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newListResponseChangeCommand ( CorrelationId  correlation,
int  itemId,
ListResponse  value 
)
static

Creates a new change command that represents a list item either being selected or invoked

Parameters
correlationa correlation ID that will be returned in the subsequent acknowledgement.
itemIdthe item for which to send
valuethe new value, must be a ListResponse
Returns
a new change message

◆ newListResponseChangeCommand() [2/2]

static MenuChangeCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newListResponseChangeCommand ( CorrelationId  correlation,
MenuItem  item,
ListResponse  value 
)
static

Creates a new change command that represents a list item either being selected or invoked

Parameters
correlationa correlation ID that will be returned in the subsequent acknowledgement.
itemthe item for which to send
valuethe new value, must be a ListResponse
Returns
a new change message

◆ newMenuActionBootCommand()

static MenuActionBootCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newMenuActionBootCommand ( int  parentId,
ActionMenuItem  item 
)
static

create a new action bootstrap command.

Parameters
parentIdthe parent onto which the item will be placed.
itemthe item itself.
Returns
a new action boot command

◆ newMenuBooleanBootCommand()

static MenuBooleanBootCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newMenuBooleanBootCommand ( int  parentId,
BooleanMenuItem  item,
boolean  currentVal 
)
static

create a new boolean bootstrap command.

Parameters
parentIdthe parent onto which the item will be placed.
itemthe item itself.
currentValthe current value
Returns
a new boolean boot command

◆ newMenuEnumBootCommand()

static MenuEnumBootCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newMenuEnumBootCommand ( int  parentId,
EnumMenuItem  item,
int  currentVal 
)
static

create a new enum bootstrap command.

Parameters
parentIdthe parent onto which the item will be placed.
itemthe item itself.
currentValthe current value
Returns
a new enum boot command

◆ newMenuFloatBootCommand()

static MenuFloatBootCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newMenuFloatBootCommand ( int  parentId,
FloatMenuItem  item,
Float  currentVal 
)
static

create a new float bootstrap command.

Parameters
parentIdthe parent onto which the item will be placed.
itemthe item itself.
currentValthe current value
Returns
a new float boot command

◆ newMenuSubBootCommand()

static MenuSubBootCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newMenuSubBootCommand ( int  parentId,
SubMenuItem  item 
)
static

create a new submenu bootstrap command.

Parameters
parentIdthe parent onto which the item will be placed.
itemthe item itself.
Returns
a new submenu boot command

◆ newMenuTextBootCommand()

static MenuTextBootCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newMenuTextBootCommand ( int  parentId,
EditableTextMenuItem  item,
String  currentVal 
)
static

create a new text bootstrap command.

Parameters
parentIdthe parent onto which the item will be placed.
itemthe item itself.
currentValthe current value
Returns
a new text boot command

◆ newRuntimeListBootCommand()

static MenuRuntimeListBootCommand com.thecoderscorner.menu.remote.commands.CommandFactory.newRuntimeListBootCommand ( int  parentId,
RuntimeListMenuItem  item,
List< String >  val 
)
static

Create a new runtime list boot command

Parameters
parentIdthe parent onto which this will be placed
itemthe item itself.
valthe current value
Returns
a new runtime list boot command

The documentation for this class was generated from the following file: