Enum MessageType
- java.lang.Object
-
- java.lang.Enum<MessageType>
-
- frc.robot.util.hyperdrive.pathvisualizer.MessageType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<MessageType>
public enum MessageType extends java.lang.Enum<MessageType>
Describes a message that the robot receives from PathVisualizer
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MessageType
fromString(java.lang.String code)
Returns a MessageType based on the contents of the code.java.lang.String
getCode()
Gets the string code that represents the MessageType.int
getIndex()
Gets the index of the MessageType.static MessageType
valueOf(java.lang.String name)
Returns 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 Detail
-
UNKNOWN
public static final MessageType UNKNOWN
-
POSITION
public static final MessageType POSITION
-
PATH
public static final MessageType PATH
-
DIRECTORY_REQUEST
public static final MessageType DIRECTORY_REQUEST
-
LOAD
public static final MessageType LOAD
-
SAVE
public static final MessageType SAVE
-
-
Method Detail
-
values
public static MessageType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (MessageType c : MessageType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MessageType valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getIndex
public int getIndex()
Gets the index of the MessageType.- Returns:
- Index of the MessageType. -1 is unknown.
-
getCode
public java.lang.String getCode()
Gets the string code that represents the MessageType.- Returns:
- String code to use. Should be sent as the subject of all messages to and from robot.
-
fromString
public static MessageType fromString(java.lang.String code)
Returns a MessageType based on the contents of the code.- Parameters:
code
- A MessageType code.- Returns:
- A MessageType corresponding to the value of the code.
-
-