Package org.kendar.sync.lib.protocol
Enum MessageType
- All Implemented Interfaces:
Serializable,Comparable<MessageType>,java.lang.constant.Constable
Defines the types of messages that can be exchanged in the sync protocol.
Each message type is represented by a 2-character code.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageTypeGets the message type from its code.getCode()Gets the 2-character code for this message type.static MessageTypeReturns the enum constant of this type with the specified name.static MessageType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
CONNECT
-
CONNECT_RESPONSE
-
FILE_LIST
-
FILE_LIST_RESPONSE
-
FILE_DESCRIPTOR
-
FILE_DESCRIPTOR_ACK
-
FILE_DATA
-
FILE_END
-
FILE_END_ACK
-
SYNC_END
-
SYNC_END_ACK
-
ERROR
-
START_RESTORE
-
START_RESTORE_ACK
-
FILE_DATA_ACK
-
FILE_SYNC
-
FILE_SYNC_ACK
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
fromCode
Gets the message type from its code.- Parameters:
code- The 2-character code- Returns:
- The corresponding message type, or null if not found
-
getCode
Gets the 2-character code for this message type.- Returns:
- The message type code
-