Enum MessageType

java.lang.Object
java.lang.Enum<MessageType>
org.kendar.sync.lib.protocol.MessageType
All Implemented Interfaces:
Serializable, Comparable<MessageType>, java.lang.constant.Constable

public enum MessageType extends Enum<MessageType>
Defines the types of messages that can be exchanged in the sync protocol. Each message type is represented by a 2-character code.
  • Enum Constant Details

    • CONNECT

      public static final MessageType CONNECT
    • CONNECT_RESPONSE

      public static final MessageType CONNECT_RESPONSE
    • FILE_LIST

      public static final MessageType FILE_LIST
    • FILE_LIST_RESPONSE

      public static final MessageType FILE_LIST_RESPONSE
    • FILE_DESCRIPTOR

      public static final MessageType FILE_DESCRIPTOR
    • FILE_DESCRIPTOR_ACK

      public static final MessageType FILE_DESCRIPTOR_ACK
    • FILE_DATA

      public static final MessageType FILE_DATA
    • FILE_DATA_ACK

      public static final MessageType FILE_DATA_ACK
    • FILE_END

      public static final MessageType FILE_END
    • FILE_END_ACK

      public static final MessageType FILE_END_ACK
    • SYNC_END

      public static final MessageType SYNC_END
    • SYNC_END_ACK

      public static final MessageType SYNC_END_ACK
    • ERROR

      public static final MessageType ERROR
    • START_RESTORE

      public static final MessageType START_RESTORE
    • START_RESTORE_ACK

      public static final MessageType START_RESTORE_ACK
    • KEEP_ALIVE

      public static final MessageType KEEP_ALIVE
    • FILE_SYNC

      public static final MessageType FILE_SYNC
    • FILE_SYNC_ACK

      public static final MessageType FILE_SYNC_ACK
  • Method Details

    • values

      public static MessageType[] 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

      public static MessageType valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • fromCode

      public static MessageType fromCode(String code)
      Gets the message type from its code.
      Parameters:
      code - The 2-character code
      Returns:
      The corresponding message type, or null if not found
    • getCode

      public String getCode()
      Gets the 2-character code for this message type.
      Returns:
      The message type code
    • getClazz

      public Class<?> getClazz()
    • createInstance

      public Message createInstance()