Enum MasterProcessCommand

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<MasterProcessCommand>

    public enum MasterProcessCommand
    extends java.lang.Enum<MasterProcessCommand>
    Commands which are sent from plugin to the forked jvm. Support and methods related to the commands.
    Since:
    2.19
    • Field Detail

      • id

        private final int id
      • dataType

        private final java.lang.Class<?> dataType
    • Constructor Detail

      • MasterProcessCommand

        private MasterProcessCommand​(int id,
                                     java.lang.Class<?> dataType)
    • Method Detail

      • values

        public static MasterProcessCommand[] 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 (MasterProcessCommand c : MasterProcessCommand.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MasterProcessCommand 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 name
        java.lang.NullPointerException - if the argument is null
      • getId

        public int getId()
      • getDataType

        public java.lang.Class<?> getDataType()
      • hasDataType

        public boolean hasDataType()
      • encode

        public byte[] encode​(java.lang.String data)
      • encode

        public byte[] encode()
      • decode

        public static Command decode​(java.io.DataInputStream is)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • toDataTypeAsString

        java.lang.String toDataTypeAsString​(byte... data)
      • fromDataType

        byte[] fromDataType​(java.lang.String data)
      • setCommandAndDataLength

        static void setCommandAndDataLength​(int command,
                                            int dataLength,
                                            byte... encoded)