mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Add removeAll to preferences (#987)
This removes all keys except for .type.
This commit is contained in:
committed by
Peter Johnson
parent
2e0709f05b
commit
f90e429bf9
@@ -173,6 +173,17 @@ public class Preferences {
|
||||
m_table.delete(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all preferences.
|
||||
*/
|
||||
public void removeAll() {
|
||||
for (String key : m_table.getKeys()) {
|
||||
if (!".type".equals(key)) {
|
||||
remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the string at the given key. If this table does not have a value for that position,
|
||||
* then the given backup value will be returned.
|
||||
|
||||
Reference in New Issue
Block a user