RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
org.wpilib.tunable.Tunable< T > Class Template Referenceabstract
Inheritance diagram for org.wpilib.tunable.Tunable< T >:
org.wpilib.tunable.TunableBase

Classes

class  TunableStruct
class  TunableStructArray
class  TunableProtobuf
interface  CustomTunable

Public Member Functions

abstract void set (T value)
abstract T get ()
T mutate ()
void accept (T value)
abstract Class< T > getTypeClass ()
Public Member Functions inherited from org.wpilib.tunable.TunableBase
boolean isRobust ()
String getProperties ()
TunableConfig getConfig ()
boolean hasChanged ()
boolean supportsChangeNotification ()
void resetChanged ()

Static Public Member Functions

static< T > Tunable< T > createNull (Class< T > cls)
static< T > Tunable< T > createNullConfig (Class< T > cls, TunableConfig config)
static< T > Tunable< T > create (T initialValue)
static< T > Tunable< T > create (T initialValue, Struct< T > struct)
static< T > Tunable< T > create (T initialValue, Protobuf< T, ?> proto)
static< T > Tunable< T > create (Supplier< T > getter, Consumer< T > setter, Class< T > cls)
static< T > Tunable< T > createConfig (T initialValue, TunableConfig config)
static< T > Tunable< T > createConfig (T initialValue, Struct< T > struct, TunableConfig config)
static< T > Tunable< T > createConfig (T initialValue, Protobuf< T, ?> proto, TunableConfig config)
static< T > Tunable< T > createConfig (Supplier< T > getter, Consumer< T > setter, Class< T > cls, TunableConfig config)

Protected Member Functions

 Tunable (TunableConfig config)
 Tunable (TunableConfig config, boolean supportsChangeNotification)
Protected Member Functions inherited from org.wpilib.tunable.TunableBase
 TunableBase (TunableConfig config)
 TunableBase (TunableConfig config, boolean supportsChangeNotification)
void markChanged ()

Additional Inherited Members

Protected Attributes inherited from org.wpilib.tunable.TunableBase
boolean m_changed

Detailed Description

A tunable value.

Parameters
<T>value class

Definition at line 20 of file Tunable.java.

Constructor & Destructor Documentation

◆ Tunable() [1/2]

org.wpilib.tunable.Tunable< T >.Tunable ( TunableConfig config)
protected

Constructs a tunable.

Parameters
configtunable config

Definition at line 604 of file Tunable.java.

◆ Tunable() [2/2]

org.wpilib.tunable.Tunable< T >.Tunable ( TunableConfig config,
boolean supportsChangeNotification )
protected

Constructs a tunable.

Parameters
configtunable config
supportsChangeNotificationwhether the tunable notifies backends when it changes

Definition at line 614 of file Tunable.java.

Member Function Documentation

◆ accept()

void org.wpilib.tunable.Tunable< T >.accept ( T value)

Definition at line 653 of file Tunable.java.

◆ create() [1/4]

static< T > Tunable< T > org.wpilib.tunable.Tunable< T >.create ( Supplier< T > getter,
Consumer< T > setter,
Class< T > cls )
static

Creates a tunable object with the given getter and setter.

The getter and setter must not throw.

Parameters
<T>data type
gettergetter for the tunable value
settersetter for the tunable value
clsclass of the tunable type
Returns
Tunable

Definition at line 473 of file Tunable.java.

◆ create() [2/4]

static< T > Tunable< T > org.wpilib.tunable.Tunable< T >.create ( T initialValue)
static

Creates a tunable object with the given initial value.

Parameters
<T>data type
initialValuethe initial value
Returns
Tunable

Definition at line 432 of file Tunable.java.

◆ create() [3/4]

static< T > Tunable< T > org.wpilib.tunable.Tunable< T >.create ( T initialValue,
Protobuf< T, ?> proto )
static

Creates a tunable object with a specific Protobuf serializer.

Parameters
<T>data type
initialValuethe initial value
protoprotobuf serializer
Returns
Tunable

Definition at line 457 of file Tunable.java.

◆ create() [4/4]

static< T > Tunable< T > org.wpilib.tunable.Tunable< T >.create ( T initialValue,
Struct< T > struct )
static

Creates a tunable object with a specific Struct serializer.

Parameters
<T>data type
initialValuethe initial value
structstruct serializer
Returns
Tunable

Definition at line 444 of file Tunable.java.

◆ createConfig() [1/4]

static< T > Tunable< T > org.wpilib.tunable.Tunable< T >.createConfig ( Supplier< T > getter,
Consumer< T > setter,
Class< T > cls,
TunableConfig config )
static

Creates a tunable object with the given getter and setter and config.

The getter and setter must not throw.

Parameters
<T>data type
gettergetter for the tunable value
settersetter for the tunable value
clsclass of the tunable type
configtunable config
Returns
Tunable

Definition at line 557 of file Tunable.java.

◆ createConfig() [2/4]

static< T > Tunable< T > org.wpilib.tunable.Tunable< T >.createConfig ( T initialValue,
Protobuf< T, ?> proto,
TunableConfig config )
static

Creates a tunable object with a specific Protobuf serializer.

Parameters
<T>data type
initialValuethe initial value (may be null)
protoprotobuf serializer
configtunable config
Returns
Tunable

Definition at line 540 of file Tunable.java.

◆ createConfig() [3/4]

static< T > Tunable< T > org.wpilib.tunable.Tunable< T >.createConfig ( T initialValue,
Struct< T > struct,
TunableConfig config )
static

Creates a tunable object with a specific Struct serializer.

Parameters
<T>data type
initialValuethe initial value (may be null)
structstruct serializer
configtunable config
Returns
Tunable

Definition at line 526 of file Tunable.java.

◆ createConfig() [4/4]

static< T > Tunable< T > org.wpilib.tunable.Tunable< T >.createConfig ( T initialValue,
TunableConfig config )
static

Creates a tunable object with the given config and initial value.

Parameters
<T>data type
initialValuethe initial value
configtunable config
Returns
Tunable

Definition at line 485 of file Tunable.java.

◆ createNull()

static< T > Tunable< T > org.wpilib.tunable.Tunable< T >.createNull ( Class< T > cls)
static

Creates a tunable object with a null initial value.

Parameters
<T>data type
clsclass of the tunable type
Returns
Tunable

Definition at line 409 of file Tunable.java.

◆ createNullConfig()

static< T > Tunable< T > org.wpilib.tunable.Tunable< T >.createNullConfig ( Class< T > cls,
TunableConfig config )
static

Creates a tunable object with the given config and a null initial value.

Parameters
<T>data type
clsclass of the tunable type
configtunable config
Returns
Tunable

Definition at line 421 of file Tunable.java.

◆ get()

abstract T org.wpilib.tunable.Tunable< T >.get ( )
abstract

Gets the value.

Implementations must not throw.

Returns
value

◆ getTypeClass()

abstract Class< T > org.wpilib.tunable.Tunable< T >.getTypeClass ( )
abstract

Gets the class of the tunable type. This is used for determining which type handler to use.

Returns
class of the tunable type

◆ mutate()

T org.wpilib.tunable.Tunable< T >.mutate ( )

Gets the value for in-place mutation and marks this tunable changed.

This is useful for mutable structured/protobuf values where modifying the object returned by get() would otherwise bypass set(Object) and not notify backends. For immutable values, prefer set(Object). For variable-length arrays, use set(Object) with a new array to change the length.

Returns
mutable value

Definition at line 647 of file Tunable.java.

◆ set()

abstract void org.wpilib.tunable.Tunable< T >.set ( T value)
abstract

Sets the value.

Implementations must not throw.

Parameters
valuevalue

The documentation for this class was generated from the following file: