@@ -12,11 +12,15 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ +#import "macros.h" + @class OFString; + +OF_ASSUME_NONNULL_BEGIN /*! * @protocol OFKeyValueCoding OFKeyValueCoding.h ObjFW/OFKeyValueCoding.h * * @brief A protocol for Key Value Coding. @@ -29,11 +33,11 @@ * @brief Return the value for the specified key * * @param key The key of the value to return * @return The value for the specified key */ -- (id)valueForKey: (OFString*)key; +- (nullable id)valueForKey: (OFString*)key; /*! * @brief This is called by @ref valueForKey: if the specified key does not * exist. * @@ -40,19 +44,19 @@ * By default, this throws an @ref OFUndefinedKeyException. * * @param key The undefined key of the value to return * @return The value for the specified undefined key */ -- (id)valueForUndefinedKey: (OFString*)key; +- (nullable id)valueForUndefinedKey: (OFString*)key; /*! * @brief Set the value for the specified key * * @param value The value for the specified key * @param key The key of the value to set */ -- (void)setValue: (id)value +- (void)setValue: (nullable id)value forKey: (OFString*)key; /*! * @brief This is called by @ref setValue:forKey: if the specified key does not * exist. @@ -60,8 +64,10 @@ * By default, this throws an @ref OFUndefinedKeyException. * * @param value The value for the specified undefined key * @param key The undefined key of the value to set */ -- (void)setValue: (id)value +- (void)setValue: (nullable id)value forUndefinedKey: (OFString*)key; @end + +OF_ASSUME_NONNULL_END