[ObjC] Remove -[GPBFieldDescriptor optional]

As announced: https://protobuf.dev/news/2025-09-19/#objc-remove-apis

Removing the deprecated api as part of the ObjC Major Version bump
coming in 2026Q1.

PiperOrigin-RevId: 815768697
This commit is contained in:
Thomas Van Lenten 2025-10-06 09:50:17 -07:00 committed by Copybara-Service
parent 9a9d8d2f47
commit 3414dc151e
2 changed files with 0 additions and 10 deletions

View file

@ -172,9 +172,6 @@ __attribute__((objc_subclassing_restricted))
@property(nonatomic, readonly) GPBGenericValue defaultValue;
/** Whether this field is required. Only valid for proto2 fields. */
@property(nonatomic, readonly, getter=isRequired) BOOL required;
/** Whether this field is optional. */
@property(nonatomic, readonly, getter=isOptional) BOOL optional DEPRECATED_MSG_ATTRIBUTE(
"Check if fieldType is GPBFieldTypeSingle and that it is NOT required.");
/** Type of field (single, repeated, map). */
@property(nonatomic, readonly) GPBFieldType fieldType;
/** Type of the key if the field is a map. The value's type is -dataType. */

View file

@ -630,13 +630,6 @@ uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self) {
return (description_->flags & GPBFieldRequired) != 0;
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-implementations"
- (BOOL)isOptional {
return self.fieldType == GPBFieldTypeSingle && !self.isRequired;
}
#pragma clang diagnostic pop
- (GPBFieldType)fieldType {
GPBFieldFlags flags = description_->flags;
if ((flags & GPBFieldRepeated) != 0) {