Package com.mouseviator.fsuipc.helpers

# Class LVarHelper.LVarControlRequest

java.lang.Object
com.mouseviator.fsuipc.datarequest.DataRequest
com.mouseviator.fsuipc.helpers.LVarHelper.LVarControlRequest

All Implemented Interfaces:
  `IDataRequest<java.lang.String>`, `IWriteOnlyRequest<java.lang.String>`

Enclosing class:
  LVarHelper

    public static class LVarHelper.LVarControlRequest
    extends DataRequest
    implements IWriteOnlyRequest<java.lang.String>

This class implements Lvar control offset. It is a WRITE type request, writing a string at offset 0x0D70. This string than identifies what should FSUIPC do - read Lvar, write Lvar or create Lvar. By default the control request will tell FSUIPC to read the given Lvar. The Lvar name can be set via constructor or via the `setValue(java.lang.String)` method. The command - what to do, is being set by constructor or by `setCommand(com.mouseviator.fsuipc.helpers.LVarHelper.LVarControlRequestCommand)` method.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface com.mouseviator.fsuipc.datarequest.IDataRequest

  `IDataRequest.RequestType`

- ## Field Summary

  ### Fields inherited from class com.mouseviator.fsuipc.datarequest.DataRequest

  `BUFFER_LENGTH_BYTE, BUFFER_LENGTH_DOUBLE, BUFFER_LENGTH_FLOAT, BUFFER_LENGTH_INT, BUFFER_LENGTH_LONG, BUFFER_LENGTH_SHORT, dataBuffer, MAX_OFFSET_VALUE, MIN_OFFSET_VALUE, offset, type`

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `LVarControlRequest​(LVarHelper.LVarControlRequestCommand command, java.lang.String lvar)` | Constructs new Lvar control request to read/write to/create given Lvar.
  `LVarControlRequest​(LVarHelper.LVarControlRequestCommand command, java.lang.String lvar, java.nio.charset.Charset charset)` | Constructs new Lvar control request to read/write to/create given Lvar.
  `LVarControlRequest​(java.lang.String lvar)` | Constructs new Lvar control request to read given Lvar.
  `LVarControlRequest​(java.lang.String lvar, java.nio.charset.Charset charset)` | Constructs new Lvar control request to read given Lvar.

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `java.nio.charset.Charset` | `getCharset()` | Returns the charset that is used to convert string containing Lvar name and command to the byte array for FSUIPC.
  `LVarHelper.LVarControlRequestCommand` | `getCommand()` | Returns the command this control request is set to perform.
  `void` | `setCharset​(java.nio.charset.Charset charset)` | Sets the charset to use when converting string value that should contain Lvar name and command to the byte array for FSUIPC.
  `void` | `setCommand​(LVarHelper.LVarControlRequestCommand command)` | This method will set the command - what should FSUIPC do with the Lvar this control request is referencing.
  `void` | `setValue​(java.lang.String value)` | Will set the value - the name of the lvar to be read/write to/created by this control request.

  ### Methods inherited from class com.mouseviator.fsuipc.datarequest.DataRequest

  `convertStringToByteArray, copyByteArray, getDataBuffer, getDouble, getFloat, getInt, getLong, getOffset, getShort, getSize, getType, getZeroTerminatedString, putDouble, putDouble, putFloat, putFloat, putInt, putInt, putLong, putLong, putShort, putShort, setOffset, setType`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface com.mouseviator.fsuipc.datarequest.IDataRequest

  `getDataBuffer, getOffset, getSize, getType, setOffset, setType`

  ### Methods inherited from interface com.mouseviator.fsuipc.datarequest.IWriteOnlyRequest

  `getValue`

- ## Constructor Details

  - ### LVarControlRequest

    public LVarControlRequest​(java.lang.String lvar)
    Constructs new Lvar control request to read given Lvar.
    Parameters:
      `lvar` - Lvar to read.

  - ### LVarControlRequest

    public LVarControlRequest​(java.lang.String lvar, java.nio.charset.Charset charset)
    Constructs new Lvar control request to read given Lvar.
    Parameters:
      `lvar` - Lvar to read.
      `charset` - Charset to use when encoding Lvar name and command to the byte array fro FSUIPC.

  - ### LVarControlRequest

    public LVarControlRequest​(LVarHelper.LVarControlRequestCommand command, java.lang.String lvar)
    Constructs new Lvar control request to read/write to/create given Lvar.
    Parameters:
      `command` - A command - whether to read/write to or create given Lvar.
      `lvar` - An Lvar to read/write to/create.

  - ### LVarControlRequest

    public LVarControlRequest​(LVarHelper.LVarControlRequestCommand command, java.lang.String lvar, java.nio.charset.Charset charset)
    Constructs new Lvar control request to read/write to/create given Lvar.
    Parameters:
      `command` - A command - whether to read/write to or create given Lvar.
      `lvar` - An Lvar to read/write to/create.
      `charset` - Charset to use when encoding Lvar name and command to the byte array for FSUIPC.

- ## Method Details

  - ### setValue

    public void setValue​(java.lang.String value)
    Will set the value - the name of the lvar to be read/write to/created by this control request. Note that command is `LVarHelper.LVarControlRequestCommand.READ` by default, unless other command was set by the `LVarHelper.LVarControlRequest` constructor or `setCommand(com.mouseviator.fsuipc.helpers.LVarHelper.LVarControlRequestCommand)`.
    Specified by:
      `setValue` in interface `IDataRequest<java.lang.String>`
    Parameters:
      `value` - An Lvar name this control command is referencing.

  - ### getCommand

    public LVarHelper.LVarControlRequestCommand getCommand()
    Returns the command this control request is set to perform. This is, what should FSUIPC do with the Lvar this control request is referencing to.
    Returns:
      The command.

  - ### setCommand

    public void setCommand​(LVarHelper.LVarControlRequestCommand command)
    This method will set the command - what should FSUIPC do with the Lvar this control request is referencing.
    Parameters:
      `command` - The command.

  - ### getCharset

    public java.nio.charset.Charset getCharset()
    Returns the charset that is used to convert string containing Lvar name and command to the byte array for FSUIPC.
    Returns:
      The charset used.

  - ### setCharset

    public void setCharset​(java.nio.charset.Charset charset)
    Sets the charset to use when converting string value that should contain Lvar name and command to the byte array for FSUIPC. Call this before `setValue(java.lang.String)`, otherwise the change will have no effect.
    Parameters:
      `charset` - The charset to use.