RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
TunableOption.java
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5package org.wpilib.tunable;
6
7import java.util.Objects;
8
10public sealed interface TunableOption {
16 record Robust(boolean value) implements TunableOption {}
17
25 record Property(String key, String value) implements TunableOption {}
26
32 record TypeString(String typeString) implements TunableOption {}
33
42 record Mutable(boolean isMutable) implements TunableOption {}
43
51 record OnTune(Runnable callback) implements TunableOption {}
52
64 public Polling {
65 Objects.requireNonNull(polling, "polling");
66 }
67 }
68
71
74
79
84
87
90
99 static TunableOption property(String key, String value) {
100 return new Property(key, value);
101 }
102
110 return new TypeString(typeString);
111 }
112
121 static TunableOption onTune(Runnable callback) {
122 return new OnTune(callback);
123 }
124
134}
static TunableOption typeString(String typeString)
record Robust(boolean value) implements TunableOption
record Polling(TunableConfig.Polling polling) implements TunableOption
static TunableOption polling(TunableConfig.Polling polling)
record OnTune(Runnable callback) implements TunableOption
record TypeString(String typeString) implements TunableOption
static TunableOption onTune(Runnable callback)
record Property(String key, String value) implements TunableOption
static TunableOption property(String key, String value)
record Mutable(boolean isMutable) implements TunableOption