Class CommandFactory
java.lang.Object
com.thecoderscorner.menu.remote.commands.CommandFactory
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MenuChangeCommandnewAbsoluteListChangeCommand(CorrelationId correlation, int itemId, List<String> values) Creates a new absolute change command given the menu item ID and the absolute change in value.static MenuChangeCommandnewAbsoluteMenuChangeCommand(CorrelationId correlation, int itemId, Object value) Creates a new absolute change command given the menu item ID and the absolute change in value.static MenuChangeCommandnewAbsoluteMenuChangeCommand(CorrelationId correlation, MenuItem item, Object value) Creates a new absolute change command given the menu item and the absolute change in value.static MenuAcknowledgementCommandnewAcknowledgementCommand(CorrelationId correlationId, AckStatus status) create an acknowledgement message for a given correlation and statusstatic MenuAnalogBootCommandnewAnalogBootCommand(int parentId, AnalogMenuItem item, int currentVal) create a new analog bootstrap command.static MenuBootstrapCommandCreate a new bootstrap message either to indicate the bootstrap start or endstatic MenuChangeCommandnewDeltaChangeCommand(CorrelationId correlation, int itemId, int value) Creates a new delta change command given the menu item ID and the delta change in value.static MenuChangeCommandnewDeltaChangeCommand(CorrelationId correlation, MenuItem item, int value) Creates a new delta change command given the menu item and the delta change in value.static MenuDialogCommandnewDialogCommand(DialogMode mode, String header, String msg, MenuButtonType b1, MenuButtonType b2, CorrelationId correlationId) static MenuHeartbeatCommandnewHeartbeatCommand(int frequency, MenuHeartbeatCommand.HeartbeatMode mode) Create a new heartbeat message with the frequency specifiedstatic MenuJoinCommandnewJoinCommand(String name) Create a new join command that has a random UUIDstatic MenuJoinCommandnewJoinCommand(String name, UUID uuid) Create a new join command that has a fixed UUID that you provide.static MenuLargeNumBootCommandnewLargeNumberBootItem(int parentId, EditableLargeNumberMenuItem item, BigDecimal currentVal) create a new large number bootstrap command.static MenuChangeCommandnewListResponseChangeCommand(CorrelationId correlation, int itemId, ListResponse value) Creates a new change command that represents a list item either being selected or invokedstatic MenuChangeCommandnewListResponseChangeCommand(CorrelationId correlation, MenuItem item, ListResponse value) Creates a new change command that represents a list item either being selected or invokedstatic MenuActionBootCommandnewMenuActionBootCommand(int parentId, ActionMenuItem item) create a new action bootstrap command.static MenuBooleanBootCommandnewMenuBooleanBootCommand(int parentId, BooleanMenuItem item, boolean currentVal) create a new boolean bootstrap command.static MenuEnumBootCommandnewMenuEnumBootCommand(int parentId, EnumMenuItem item, int currentVal) create a new enum bootstrap command.static MenuFloatBootCommandnewMenuFloatBootCommand(int parentId, FloatMenuItem item, Float currentVal) create a new float bootstrap command.static MenuSubBootCommandnewMenuSubBootCommand(int parentId, SubMenuItem item) create a new submenu bootstrap command.static MenuTextBootCommandnewMenuTextBootCommand(int parentId, EditableTextMenuItem item, String currentVal) create a new text bootstrap command.static MenuPairingCommandnewPairingCommand(String name, UUID uuid) static MenuRuntimeListBootCommandnewRuntimeListBootCommand(int parentId, RuntimeListMenuItem item, List<String> val) Create a new runtime list boot command
-
Constructor Details
-
CommandFactory
public CommandFactory()
-
-
Method Details
-
newJoinCommand
Create a new join command that has a random UUID- Parameters:
name- the name that the remote will show for the connection- Returns:
- join command.
-
newJoinCommand
Create a new join command that has a fixed UUID that you provide.- Parameters:
name- the name that the remote will show for the connectionuuid- the UUID that will the remote will see for this.- Returns:
- join command
-
newPairingCommand
-