@@ -1,7 +1,7 @@ /* - * Copyright (c) 2008-2021 Jonathan Schleifer + * Copyright (c) 2008-2022 Jonathan Schleifer * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in @@ -25,11 +25,11 @@ * Coding). */ @interface OFUndefinedKeyException: OFException { id _object; - OFString *_key; + OFString *_Nullable _key; id _Nullable _value; } /** * @brief The object on which the key is undefined. @@ -37,19 +37,17 @@ @property (readonly, nonatomic) id object; /** * @brief The key which is undefined. */ -@property (readonly, nonatomic) OFString *key; +@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *key; /** * @brief The value for the undefined key */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) id value; -+ (instancetype)exception OF_UNAVAILABLE; - /** * @brief Creates a new, autoreleased undefined key exception. * * @param object The object on which the key is undefined * @param key The key which is undefined @@ -66,14 +64,14 @@ * @param value The value for the undefined key * * @return A new, autoreleased undefined key exception */ + (instancetype)exceptionWithObject: (id)object - key: (OFString *)key + key: (nullable OFString *)key value: (nullable id)value; -- (instancetype)init OF_UNAVAILABLE; ++ (instancetype)exception OF_UNAVAILABLE; /** * @brief Initializes an already allocated undefined key exception. * * @param object The object on which the key is undefined @@ -91,10 +89,12 @@ * @param value The value for the undefined key * * @return An initialized undefined key exception */ - (instancetype)initWithObject: (id)object - key: (OFString *)key + key: (nullable OFString *)key value: (nullable id)value OF_DESIGNATED_INITIALIZER; + +- (instancetype)init OF_UNAVAILABLE; @end OF_ASSUME_NONNULL_END