From 13024a7c608b03627f8e35cdf7056e71cb29a4b3 Mon Sep 17 00:00:00 2001 From: Carl Hauser Date: Mon, 16 Dec 2024 14:48:26 -0800 Subject: [PATCH] respond to review comments --- .../include/networktables/GenericEntry.h | 22 ++++++++--------- .../include/networktables/NetworkTable.h | 16 ++++++------- .../include/networktables/NetworkTableEntry.h | 24 +++++++++---------- .../frc/smartdashboard/SmartDashboard.h | 16 ++++++------- .../smartdashboard/SmartDashboard.java | 18 +++++++------- 5 files changed, 48 insertions(+), 48 deletions(-) diff --git a/ntcore/src/main/native/include/networktables/GenericEntry.h b/ntcore/src/main/native/include/networktables/GenericEntry.h index 8310db3069f..449daab2f52 100644 --- a/ntcore/src/main/native/include/networktables/GenericEntry.h +++ b/ntcore/src/main/native/include/networktables/GenericEntry.h @@ -387,7 +387,7 @@ class GenericPublisher : public Publisher { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultBoolean(bool defaultValue) { return nt::SetDefaultBoolean(m_pubHandle, defaultValue); @@ -397,7 +397,7 @@ class GenericPublisher : public Publisher { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultInteger(int64_t defaultValue) { return nt::SetDefaultInteger(m_pubHandle, defaultValue); @@ -407,7 +407,7 @@ class GenericPublisher : public Publisher { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultFloat(float defaultValue) { return nt::SetDefaultFloat(m_pubHandle, defaultValue); @@ -417,7 +417,7 @@ class GenericPublisher : public Publisher { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultDouble(double defaultValue) { return nt::SetDefaultDouble(m_pubHandle, defaultValue); @@ -427,7 +427,7 @@ class GenericPublisher : public Publisher { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultString(std::string_view defaultValue) { return nt::SetDefaultString(m_pubHandle, defaultValue); @@ -437,7 +437,7 @@ class GenericPublisher : public Publisher { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultRaw(std::span defaultValue) { return nt::SetDefaultRaw(m_pubHandle, defaultValue); @@ -447,7 +447,7 @@ class GenericPublisher : public Publisher { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultBooleanArray(std::span defaultValue) { return nt::SetDefaultBooleanArray(m_pubHandle, defaultValue); @@ -457,7 +457,7 @@ class GenericPublisher : public Publisher { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultIntegerArray(std::span defaultValue) { return nt::SetDefaultIntegerArray(m_pubHandle, defaultValue); @@ -467,7 +467,7 @@ class GenericPublisher : public Publisher { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultFloatArray(std::span defaultValue) { return nt::SetDefaultFloatArray(m_pubHandle, defaultValue); @@ -477,7 +477,7 @@ class GenericPublisher : public Publisher { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultDoubleArray(std::span defaultValue) { return nt::SetDefaultDoubleArray(m_pubHandle, defaultValue); @@ -487,7 +487,7 @@ class GenericPublisher : public Publisher { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultStringArray(std::span defaultValue) { return nt::SetDefaultStringArray(m_pubHandle, defaultValue); diff --git a/ntcore/src/main/native/include/networktables/NetworkTable.h b/ntcore/src/main/native/include/networktables/NetworkTable.h index 500fdacbdaf..b887337267b 100644 --- a/ntcore/src/main/native/include/networktables/NetworkTable.h +++ b/ntcore/src/main/native/include/networktables/NetworkTable.h @@ -365,7 +365,7 @@ class NetworkTable final { * * @param key the key * @param defaultValue the default value to set if key doesn't exist. - * @returns False if the table key exists + * @returns True if the table key did not already exist, otherwise False */ bool SetDefaultNumber(std::string_view key, double defaultValue); @@ -393,7 +393,7 @@ class NetworkTable final { * * @param key the key * @param defaultValue the default value to set if key doesn't exist. - * @returns False if the table key exists + * @returns True if the table key did not already exist, otherwise False */ bool SetDefaultString(std::string_view key, std::string_view defaultValue); @@ -423,7 +423,7 @@ class NetworkTable final { * * @param key the key * @param defaultValue the default value to set if key doesn't exist. - * @returns False if the table key exists + * @returns True if the table key did not already exist, otherwise False */ bool SetDefaultBoolean(std::string_view key, bool defaultValue); @@ -456,7 +456,7 @@ class NetworkTable final { * * @param key the key * @param defaultValue the default value to set if key doesn't exist. - * @return False if the table key exists + * @return True if the table key did not already exist, otherwise False */ bool SetDefaultBooleanArray(std::string_view key, std::span defaultValue); @@ -494,7 +494,7 @@ class NetworkTable final { * * @param key the key * @param defaultValue the default value to set if key doesn't exist. - * @returns False if the table key exists + * @returns True if the table key did not already exist, otherwise False */ bool SetDefaultNumberArray(std::string_view key, std::span defaultValue); @@ -528,7 +528,7 @@ class NetworkTable final { * * @param key the key * @param defaultValue the default value to set if key doesn't exist. - * @returns False if the table key exists + * @returns True if the table key did not already exist, otherwise False */ bool SetDefaultStringArray(std::string_view key, std::span defaultValue); @@ -562,7 +562,7 @@ class NetworkTable final { * * @param key the key * @param defaultValue the default value to set if key doesn't exist. - * @return False if the table key exists + * @return True if the table key did not already exist, otherwise False */ bool SetDefaultRaw(std::string_view key, std::span defaultValue); @@ -596,7 +596,7 @@ class NetworkTable final { * * @param key the key * @param defaultValue the default value to set if key doesn't exist. - * @return False if the table key exists + * @return True if the table key did not already exist, otherwise False */ bool SetDefaultValue(std::string_view key, const Value& defaultValue); diff --git a/ntcore/src/main/native/include/networktables/NetworkTableEntry.h b/ntcore/src/main/native/include/networktables/NetworkTableEntry.h index 18f8b90ef84..789d4361bcc 100644 --- a/ntcore/src/main/native/include/networktables/NetworkTableEntry.h +++ b/ntcore/src/main/native/include/networktables/NetworkTableEntry.h @@ -260,7 +260,7 @@ class NetworkTableEntry final { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultValue(const Value& defaultValue) { return SetDefaultEntryValue(m_handle, defaultValue); @@ -270,7 +270,7 @@ class NetworkTableEntry final { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultBoolean(bool defaultValue) { return nt::SetDefaultBoolean(m_handle, defaultValue); @@ -280,7 +280,7 @@ class NetworkTableEntry final { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultInteger(int64_t defaultValue) { return nt::SetDefaultInteger(m_handle, defaultValue); @@ -290,7 +290,7 @@ class NetworkTableEntry final { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultFloat(float defaultValue) { return nt::SetDefaultFloat(m_handle, defaultValue); @@ -300,7 +300,7 @@ class NetworkTableEntry final { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultDouble(double defaultValue) { return nt::SetDefaultDouble(m_handle, defaultValue); @@ -310,7 +310,7 @@ class NetworkTableEntry final { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultString(std::string_view defaultValue) { return nt::SetDefaultString(m_handle, defaultValue); @@ -320,7 +320,7 @@ class NetworkTableEntry final { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultRaw(std::span defaultValue) { return nt::SetDefaultRaw(m_handle, defaultValue); @@ -330,7 +330,7 @@ class NetworkTableEntry final { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultBooleanArray(std::span defaultValue) { return nt::SetDefaultBooleanArray(m_handle, defaultValue); @@ -340,7 +340,7 @@ class NetworkTableEntry final { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultIntegerArray(std::span defaultValue) { return nt::SetDefaultIntegerArray(m_handle, defaultValue); @@ -350,7 +350,7 @@ class NetworkTableEntry final { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultFloatArray(std::span defaultValue) { return nt::SetDefaultFloatArray(m_handle, defaultValue); @@ -360,7 +360,7 @@ class NetworkTableEntry final { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultDoubleArray(std::span defaultValue) { return nt::SetDefaultDoubleArray(m_handle, defaultValue); @@ -370,7 +370,7 @@ class NetworkTableEntry final { * Sets the entry's value if it does not exist. * * @param defaultValue the default value to set - * @return False if the entry exists + * @return True if the entry did not already have a value, otherwise False */ bool SetDefaultStringArray(std::span defaultValue) { return nt::SetDefaultStringArray(m_handle, defaultValue); diff --git a/wpilibc/src/main/native/include/frc/smartdashboard/SmartDashboard.h b/wpilibc/src/main/native/include/frc/smartdashboard/SmartDashboard.h index 41147972e69..267ece42cda 100644 --- a/wpilibc/src/main/native/include/frc/smartdashboard/SmartDashboard.h +++ b/wpilibc/src/main/native/include/frc/smartdashboard/SmartDashboard.h @@ -125,7 +125,7 @@ class SmartDashboard { * Gets the current value in the table, setting it if it does not exist. * @param key the key * @param defaultValue the default value to set if key doesn't exist. - * @returns False if the table key exists + * @returns True if the table key did not already exist, otherwise False */ static bool SetDefaultBoolean(std::string_view key, bool defaultValue); @@ -157,7 +157,7 @@ class SmartDashboard { * * @param key The key. * @param defaultValue The default value to set if key doesn't exist. - * @returns False if the table key exists + * @returns True if the table key did not already exist, otherwise False */ static bool SetDefaultNumber(std::string_view key, double defaultValue); @@ -189,7 +189,7 @@ class SmartDashboard { * * @param key the key * @param defaultValue the default value to set if key doesn't exist. - * @returns False if the table key exists + * @returns True if the table key did not already exist, otherwise False */ static bool SetDefaultString(std::string_view key, std::string_view defaultValue); @@ -224,7 +224,7 @@ class SmartDashboard { * * @param key the key * @param defaultValue the default value to set if key doesn't exist. - * @returns False if the table key exists + * @returns True if the table key did not already exist, otherwise False */ static bool SetDefaultBooleanArray(std::string_view key, std::span defaultValue); @@ -265,7 +265,7 @@ class SmartDashboard { * * @param key The key. * @param defaultValue The default value to set if key doesn't exist. - * @returns False if the table key exists + * @returns True if the table key did not already exist, otherwise False */ static bool SetDefaultNumberArray(std::string_view key, std::span defaultValue); @@ -302,7 +302,7 @@ class SmartDashboard { * * @param key The key. * @param defaultValue The default value to set if key doesn't exist. - * @returns False if the table key exists + * @returns True if the table key did not already exist, otherwise False */ static bool SetDefaultStringArray(std::string_view key, std::span defaultValue); @@ -338,7 +338,7 @@ class SmartDashboard { * * @param key The key. * @param defaultValue The default value to set if key doesn't exist. - * @returns False if the table key exists + * @returns True if the table key did not already exist, otherwise False */ static bool SetDefaultRaw(std::string_view key, std::span defaultValue); @@ -378,7 +378,7 @@ class SmartDashboard { * * @param key the key * @param defaultValue The default value to set if key doesn't exist. - * @returns False if the table key exists + * @returns True if the table key did not already exist, otherwise False */ static bool SetDefaultValue(std::string_view key, const nt::Value& defaultValue); diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.java index 519193b62c7..81fbaa6c197 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.java @@ -200,7 +200,7 @@ public static boolean putBoolean(String key, boolean value) { * * @param key the key * @param defaultValue the value to set if key does not exist - * @return True: success; False the key already existed + * @return True if the key did not already exist, otherwise False */ public static boolean setDefaultBoolean(String key, boolean defaultValue) { return getEntry(key).setDefaultBoolean(defaultValue); @@ -235,7 +235,7 @@ public static boolean putNumber(String key, double value) { * * @param key the key * @param defaultValue the value to set if key does not exist - * @return True: success; False the key already existed + * @return True if the key did not already exist, otherwise False */ public static boolean setDefaultNumber(String key, double defaultValue) { return getEntry(key).setDefaultDouble(defaultValue); @@ -270,7 +270,7 @@ public static boolean putString(String key, String value) { * * @param key the key * @param defaultValue the value to set if key does not exist - * @return True: success; False the key already existed + * @return True if the key did not already exist, otherwise False */ public static boolean setDefaultString(String key, String defaultValue) { return getEntry(key).setDefaultString(defaultValue); @@ -316,7 +316,7 @@ public static boolean putBooleanArray(String key, Boolean[] value) { * * @param key the key * @param defaultValue the value to set if key does not exist - * @return True: success; False the key already existed + * @return True if the key did not already exist, otherwise False */ public static boolean setDefaultBooleanArray(String key, boolean[] defaultValue) { return getEntry(key).setDefaultBooleanArray(defaultValue); @@ -327,7 +327,7 @@ public static boolean setDefaultBooleanArray(String key, boolean[] defaultValue) * * @param key the key * @param defaultValue the value to set if key does not exist - * @return True: success; False the key already existed + * @return True if the key did not already exist, otherwise False */ public static boolean setDefaultBooleanArray(String key, Boolean[] defaultValue) { return getEntry(key).setDefaultBooleanArray(defaultValue); @@ -386,7 +386,7 @@ public static boolean putNumberArray(String key, Double[] value) { * * @param key the key * @param defaultValue the value to set if key does not exist - * @return True: success; False the key already existed + * @return True if the key did not already exist, otherwise False */ public static boolean setDefaultNumberArray(String key, double[] defaultValue) { return getEntry(key).setDefaultDoubleArray(defaultValue); @@ -397,7 +397,7 @@ public static boolean setDefaultNumberArray(String key, double[] defaultValue) { * * @param key the key * @param defaultValue the value to set if key does not exist - * @return True: success; False the key already existed + * @return True if the key did not already exist, otherwise False */ public static boolean setDefaultNumberArray(String key, Double[] defaultValue) { return getEntry(key).setDefaultNumberArray(defaultValue); @@ -445,7 +445,7 @@ public static boolean putStringArray(String key, String[] value) { * * @param key the key * @param defaultValue the value to set if key does not exist - * @return True: success; False the key already existed + * @return True if the key did not already exist, otherwise False */ public static boolean setDefaultStringArray(String key, String[] defaultValue) { return getEntry(key).setDefaultStringArray(defaultValue); @@ -480,7 +480,7 @@ public static boolean putRaw(String key, byte[] value) { * * @param key the key * @param defaultValue the value to set if key does not exist - * @return True: success; False the key already existed + * @return True if the key did not already exist, otherwise False */ public static boolean setDefaultRaw(String key, byte[] defaultValue) { return getEntry(key).setDefaultRaw(defaultValue);