@@ -153,10 +153,11 @@ /** * @brief Creates a new OFArray with the specified object. * * @param object An object * @return A new autoreleased OFArray + * @throw OFInvalidArgumentException The provided object was `nil` */ + (instancetype)arrayWithObject: (ObjectType)object; /** * @brief Creates a new OFArray with the specified objects, terminated by `nil`. @@ -188,10 +189,11 @@ /** * @brief Initializes an OFArray with the specified object. * * @param object An object * @return An initialized OFArray + * @throw OFInvalidArgumentException The provided object was `nil` */ - (instancetype)initWithObject: (ObjectType)object; /** * @brief Initializes an OFArray with the specified objects. @@ -279,10 +281,11 @@ /** * @brief Copies the objects at the specified range to the specified buffer. * * @param buffer The buffer to copy the objects to * @param range The range to copy + * @throw OFOutOfRangeException The provided range is out of bounds */ - (void)getObjects: (ObjectType __unsafe_unretained _Nonnull *_Nonnull)buffer inRange: (OFRange)range; /** @@ -327,27 +330,30 @@ /** * @brief Returns the objects in the specified range as a new OFArray. * * @param range The range for the subarray * @return The subarray as a new autoreleased OFArray + * @throw OFOutOfRangeException The provided range is out of bounds */ - (OFArray OF_GENERIC(ObjectType) *)objectsInRange: (OFRange)range; /** * @brief Creates a string by joining all objects of the array. * * @param separator The string with which the objects should be joined * @return A string containing all objects joined by the separator + * @throw OFInvalidArgumentException The provided separator is `nil` */ - (OFString *)componentsJoinedByString: (OFString *)separator; /** * @brief Creates a string by joining all objects of the array. * * @param separator The string with which the objects should be joined * @param options Options according to which the objects should be joined * @return A string containing all objects joined by the separator + * @throw OFInvalidArgumentException The provided separator is `nil` */ - (OFString *)componentsJoinedByString: (OFString *)separator options: (OFArrayJoinOptions)options; /** @@ -355,10 +361,12 @@ * and joining the strings returned by calling the selector. * * @param separator The string with which the objects should be joined * @param selector The selector to perform on the objects * @return A string containing all objects joined by the separator + * @throw OFInvalidArgumentException The provided separator is `nil` or calling + * the provided selector returned `nil` */ - (OFString *)componentsJoinedByString: (OFString *)separator usingSelector: (SEL)selector; /** @@ -367,10 +375,12 @@ * * @param separator The string with which the objects should be joined * @param selector The selector to perform on the objects * @param options Options according to which the objects should be joined * @return A string containing all objects joined by the separator + * @throw OFInvalidArgumentException The provided separator is `nil` or calling + * the provided selector returned `nil` */ - (OFString *)componentsJoinedByString: (OFString *)separator usingSelector: (SEL)selector options: (OFArrayJoinOptions)options; @@ -422,18 +432,20 @@ /** * @brief Creates a new array with the specified object added. * * @param object The object to add * @return A new array with the specified object added + * @throw OFInvalidArgumentException The specified object was `nil` */ - (OFArray OF_GENERIC(ObjectType) *)arrayByAddingObject: (ObjectType)object; /** * @brief Creates a new array with the objects from the specified array added. * * @param array The array with objects to add * @return A new array with the objects from the specified array added + * @throw OFInvalidArgumentException The specified array was `nil` */ - (OFArray OF_GENERIC(ObjectType) *)arrayByAddingObjectsFromArray: (OFArray OF_GENERIC(ObjectType) *)array; #ifdef OF_HAVE_BLOCKS