nullability revert

pull/16190/head
Muxi Yan 6 years ago
parent c097e21259
commit 915cd71b4a
  1. 32
      src/objective-c/GRPCClient/GRPCCall.h
  2. 9
      src/objective-c/ProtoRPC/ProtoRPC.h
  3. 27
      src/objective-c/ProtoRPC/ProtoService.h

@ -275,6 +275,9 @@ extern NSString *const kGRPCTrailersKey;
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnullability-completeness"
/** /**
* This interface is deprecated. Please use \a GRPCcall2. * This interface is deprecated. Please use \a GRPCcall2.
* *
@ -282,7 +285,7 @@ NS_ASSUME_NONNULL_END
*/ */
@interface GRPCCall : GRXWriter @interface GRPCCall : GRXWriter
- (nonnull instancetype)init NS_UNAVAILABLE; - (instancetype)init NS_UNAVAILABLE;
/** /**
* The container of the request headers of an RPC conforms to this protocol, which is a subset of * The container of the request headers of an RPC conforms to this protocol, which is a subset of
@ -308,7 +311,7 @@ NS_ASSUME_NONNULL_END
* *
* The property is initialized to an empty NSMutableDictionary. * The property is initialized to an empty NSMutableDictionary.
*/ */
@property(nonnull, atomic, readonly) NSMutableDictionary *requestHeaders; @property(atomic, readonly) NSMutableDictionary *requestHeaders;
/** /**
* This dictionary is populated with the HTTP headers received from the server. This happens before * This dictionary is populated with the HTTP headers received from the server. This happens before
@ -319,7 +322,7 @@ NS_ASSUME_NONNULL_END
* The value of this property is nil until all response headers are received, and will change before * The value of this property is nil until all response headers are received, and will change before
* any of -writeValue: or -writesFinishedWithError: are sent to the writeable. * any of -writeValue: or -writesFinishedWithError: are sent to the writeable.
*/ */
@property(nullable, atomic, readonly) NSDictionary *responseHeaders; @property(atomic, readonly) NSDictionary *responseHeaders;
/** /**
* Same as responseHeaders, but populated with the HTTP trailers received from the server before the * Same as responseHeaders, but populated with the HTTP trailers received from the server before the
@ -328,7 +331,7 @@ NS_ASSUME_NONNULL_END
* The value of this property is nil until all response trailers are received, and will change * The value of this property is nil until all response trailers are received, and will change
* before -writesFinishedWithError: is sent to the writeable. * before -writesFinishedWithError: is sent to the writeable.
*/ */
@property(nullable, atomic, readonly) NSDictionary *responseTrailers; @property(atomic, readonly) NSDictionary *responseTrailers;
/** /**
* The request writer has to write NSData objects into the provided Writeable. The server will * The request writer has to write NSData objects into the provided Writeable. The server will
@ -341,9 +344,9 @@ NS_ASSUME_NONNULL_END
* host parameter should not contain the scheme (http:// or https://), only the name or IP addr * host parameter should not contain the scheme (http:// or https://), only the name or IP addr
* and the port number, for example @"localhost:5050". * and the port number, for example @"localhost:5050".
*/ */
- (nullable instancetype)initWithHost:(nonnull NSString *)host - (instancetype)initWithHost:(NSString *)host
path:(nonnull NSString *)path path:(NSString *)path
requestsWriter:(nonnull GRXWriter *)requestWriter; requestsWriter:(GRXWriter *)requestWriter;
/** /**
* Finishes the request side of this call, notifies the server that the RPC should be cancelled, and * Finishes the request side of this call, notifies the server that the RPC should be cancelled, and
@ -354,12 +357,10 @@ NS_ASSUME_NONNULL_END
/** /**
* The following methods are deprecated. * The following methods are deprecated.
*/ */
+ (void)setCallSafety:(GRPCCallSafety)callSafety + (void)setCallSafety:(GRPCCallSafety)callSafety host:(NSString *)host path:(NSString *)path;
host:(nonnull NSString *)host @property(atomic, copy, readwrite) NSString *serverName;
path:(nonnull NSString *)path;
@property(nullable, atomic, copy, readwrite) NSString *serverName;
@property NSTimeInterval timeout; @property NSTimeInterval timeout;
- (void)setResponseDispatchQueue:(nonnull dispatch_queue_t)queue; - (void)setResponseDispatchQueue:(dispatch_queue_t)queue;
@end @end
@ -370,11 +371,11 @@ DEPRECATED_MSG_ATTRIBUTE("Use NSDictionary or NSMutableDictionary instead.")
@protocol GRPCRequestHeaders<NSObject> @protocol GRPCRequestHeaders<NSObject>
@property(nonatomic, readonly) NSUInteger count; @property(nonatomic, readonly) NSUInteger count;
- (nullable id)objectForKeyedSubscript:(nonnull id)key; - (id)objectForKeyedSubscript:(id)key;
- (void)setObject:(nonnull id)obj forKeyedSubscript:(nonnull id)key; - (void)setObject:(id)obj forKeyedSubscript:(id)key;
- (void)removeAllObjects; - (void)removeAllObjects;
- (void)removeObjectForKey:(nonnull id)key; - (void)removeObjectForKey:(id)key;
@end @end
#pragma clang diagnostic push #pragma clang diagnostic push
@ -383,3 +384,4 @@ DEPRECATED_MSG_ATTRIBUTE("Use NSDictionary or NSMutableDictionary instead.")
@interface NSMutableDictionary (GRPCRequestHeaders)<GRPCRequestHeaders> @interface NSMutableDictionary (GRPCRequestHeaders)<GRPCRequestHeaders>
@end @end
#pragma clang diagnostic pop #pragma clang diagnostic pop
#pragma clang diagnostic pop

@ -142,11 +142,10 @@ __attribute__((deprecated("Please use GRPCProtoCall."))) @interface ProtoRPC
* addr and the port number, for example @"localhost:5050". * addr and the port number, for example @"localhost:5050".
*/ */
- -
(nullable instancetype)initWithHost : (nonnull NSString *)host method (instancetype)initWithHost : (NSString *)host method
: (nonnull GRPCProtoMethod *)method requestsWriter : (GRPCProtoMethod *)method requestsWriter : (GRXWriter *)requestsWriter responseClass
: (nonnull GRXWriter *)requestsWriter responseClass : (Class)responseClass responsesWriteable
: (nonnull Class)responseClass responsesWriteable : (id<GRXWriteable>)responsesWriteable NS_DESIGNATED_INITIALIZER;
: (nonnull id<GRXWriteable>)responsesWriteable NS_DESIGNATED_INITIALIZER;
- (void)start; - (void)start;
@end @end

@ -27,38 +27,41 @@
@class GRPCStreamingProtoCall; @class GRPCStreamingProtoCall;
@protocol GRPCProtoResponseCallbacks; @protocol GRPCProtoResponseCallbacks;
NS_ASSUME_NONNULL_BEGIN #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnullability-completeness"
__attribute__((deprecated("Please use GRPCProtoService."))) @interface ProtoService __attribute__((deprecated("Please use GRPCProtoService."))) @interface ProtoService
: NSObject : NSObject
- -
(nullable instancetype)initWithHost : (NSString *)host packageName (nullable instancetype)initWithHost : (nonnull NSString *)host packageName
: (NSString *)packageName serviceName : (NSString *)serviceName callOptions : (nonnull NSString *)packageName serviceName : (nonnull NSString *)serviceName callOptions
: (nullable GRPCCallOptions *)callOptions NS_DESIGNATED_INITIALIZER; : (nullable GRPCCallOptions *)callOptions NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithHost:(NSString *)host - (instancetype)initWithHost:(NSString *)host
packageName:(NSString *)packageName packageName:(NSString *)packageName
serviceName:(NSString *)serviceName; serviceName:(NSString *)serviceName;
- (nullable GRPCProtoCall *)RPCToMethod:(NSString *)method - (GRPCProtoCall *)RPCToMethod:(NSString *)method
requestsWriter:(GRXWriter *)requestsWriter requestsWriter:(GRXWriter *)requestsWriter
responseClass:(Class)responseClass responseClass:(Class)responseClass
responsesWriteable:(id<GRXWriteable>)responsesWriteable; responsesWriteable:(id<GRXWriteable>)responsesWriteable;
- (nullable GRPCUnaryProtoCall *)RPCToMethod:(NSString *)method - (nullable GRPCUnaryProtoCall *)RPCToMethod:(nonnull NSString *)method
message:(id)message message:(nonnull id)message
responseHandler:(id<GRPCProtoResponseCallbacks>)handler responseHandler:(nonnull id<GRPCProtoResponseCallbacks>)handler
callOptions:(nullable GRPCCallOptions *)callOptions callOptions:(nullable GRPCCallOptions *)callOptions
responseClass:(Class)responseClass; responseClass:(nonnull Class)responseClass;
- (nullable GRPCStreamingProtoCall *)RPCToMethod:(NSString *)method - (nullable GRPCStreamingProtoCall *)RPCToMethod:(nonnull NSString *)method
responseHandler:(id<GRPCProtoResponseCallbacks>)handler responseHandler:(nonnull id<GRPCProtoResponseCallbacks>)handler
callOptions:(nullable GRPCCallOptions *)callOptions callOptions:(nullable GRPCCallOptions *)callOptions
responseClass:(Class)responseClass; responseClass:(nonnull Class)responseClass;
@end @end
#pragma clang diagnostic pop
/** /**
* This subclass is empty now. Eventually we'll remove ProtoService class * This subclass is empty now. Eventually we'll remove ProtoService class
* to avoid potential naming conflict * to avoid potential naming conflict
@ -69,5 +72,3 @@ __attribute__((deprecated("Please use GRPCProtoService."))) @interface ProtoServ
#pragma clang diagnostic pop #pragma clang diagnostic pop
@end @end
NS_ASSUME_NONNULL_END

Loading…
Cancel
Save