1 // This file was automatically generated by protocompiler
3 // Compiled from C2Metric.proto
5 #import "SECC2MPCloudKitOperationGroupInfo.h"
6 #import <ProtocolBuffer/PBConstants.h>
7 #import <ProtocolBuffer/PBHashUtil.h>
8 #import <ProtocolBuffer/PBDataReader.h>
10 #if !__has_feature(objc_arc)
11 # error This generated file depends on ARC but it is not enabled; turn on ARC, or use 'objc_use_arc' option to generate non-ARC code.
14 @implementation SECC2MPCloudKitOperationGroupInfo
16 - (BOOL)hasOperationGroupId
18 return _operationGroupId != nil;
20 @synthesize operationGroupId = _operationGroupId;
21 - (BOOL)hasOperationGroupName
23 return _operationGroupName != nil;
25 @synthesize operationGroupName = _operationGroupName;
26 @synthesize operationGroupTriggered = _operationGroupTriggered;
27 - (void)setOperationGroupTriggered:(BOOL)v
29 _has.operationGroupTriggered = YES;
30 _operationGroupTriggered = v;
32 - (void)setHasOperationGroupTriggered:(BOOL)f
34 _has.operationGroupTriggered = f;
36 - (BOOL)hasOperationGroupTriggered
38 return _has.operationGroupTriggered;
41 - (NSString *)description
43 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
46 - (NSDictionary *)dictionaryRepresentation
48 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
49 if (self->_operationGroupId)
51 [dict setObject:self->_operationGroupId forKey:@"operation_group_id"];
53 if (self->_operationGroupName)
55 [dict setObject:self->_operationGroupName forKey:@"operation_group_name"];
57 if (self->_has.operationGroupTriggered)
59 [dict setObject:[NSNumber numberWithBool:self->_operationGroupTriggered] forKey:@"operation_group_triggered"];
64 BOOL SECC2MPCloudKitOperationGroupInfoReadFrom(__unsafe_unretained SECC2MPCloudKitOperationGroupInfo *self, __unsafe_unretained PBDataReader *reader) {
65 while (PBReaderHasMoreData(reader)) {
69 PBReaderReadTag32AndType(reader, &tag, &aType);
71 if (PBReaderHasError(reader))
74 if (aType == TYPE_END_GROUP) {
80 case 1 /* operationGroupId */:
82 NSString *new_operationGroupId = PBReaderReadString(reader);
83 self->_operationGroupId = new_operationGroupId;
86 case 2 /* operationGroupName */:
88 NSString *new_operationGroupName = PBReaderReadString(reader);
89 self->_operationGroupName = new_operationGroupName;
92 case 101 /* operationGroupTriggered */:
94 self->_has.operationGroupTriggered = YES;
95 self->_operationGroupTriggered = PBReaderReadBOOL(reader);
99 if (!PBReaderSkipValueWithTag(reader, tag, aType))
104 return !PBReaderHasError(reader);
107 - (BOOL)readFrom:(PBDataReader *)reader
109 return SECC2MPCloudKitOperationGroupInfoReadFrom(self, reader);
111 - (void)writeTo:(PBDataWriter *)writer
113 /* operationGroupId */
115 if (self->_operationGroupId)
117 PBDataWriterWriteStringField(writer, self->_operationGroupId, 1);
120 /* operationGroupName */
122 if (self->_operationGroupName)
124 PBDataWriterWriteStringField(writer, self->_operationGroupName, 2);
127 /* operationGroupTriggered */
129 if (self->_has.operationGroupTriggered)
131 PBDataWriterWriteBOOLField(writer, self->_operationGroupTriggered, 101);
136 - (void)copyTo:(SECC2MPCloudKitOperationGroupInfo *)other
138 if (_operationGroupId)
140 other.operationGroupId = _operationGroupId;
142 if (_operationGroupName)
144 other.operationGroupName = _operationGroupName;
146 if (self->_has.operationGroupTriggered)
148 other->_operationGroupTriggered = _operationGroupTriggered;
149 other->_has.operationGroupTriggered = YES;
153 - (id)copyWithZone:(NSZone *)zone
155 SECC2MPCloudKitOperationGroupInfo *copy = [[[self class] allocWithZone:zone] init];
156 copy->_operationGroupId = [_operationGroupId copyWithZone:zone];
157 copy->_operationGroupName = [_operationGroupName copyWithZone:zone];
158 if (self->_has.operationGroupTriggered)
160 copy->_operationGroupTriggered = _operationGroupTriggered;
161 copy->_has.operationGroupTriggered = YES;
166 - (BOOL)isEqual:(id)object
168 SECC2MPCloudKitOperationGroupInfo *other = (SECC2MPCloudKitOperationGroupInfo *)object;
169 return [other isMemberOfClass:[self class]]
171 ((!self->_operationGroupId && !other->_operationGroupId) || [self->_operationGroupId isEqual:other->_operationGroupId])
173 ((!self->_operationGroupName && !other->_operationGroupName) || [self->_operationGroupName isEqual:other->_operationGroupName])
175 ((self->_has.operationGroupTriggered && other->_has.operationGroupTriggered && ((self->_operationGroupTriggered && other->_operationGroupTriggered) || (!self->_operationGroupTriggered && !other->_operationGroupTriggered))) || (!self->_has.operationGroupTriggered && !other->_has.operationGroupTriggered))
183 [self->_operationGroupId hash]
185 [self->_operationGroupName hash]
187 (self->_has.operationGroupTriggered ? PBHashInt((NSUInteger)self->_operationGroupTriggered) : 0)
191 - (void)mergeFrom:(SECC2MPCloudKitOperationGroupInfo *)other
193 if (other->_operationGroupId)
195 [self setOperationGroupId:other->_operationGroupId];
197 if (other->_operationGroupName)
199 [self setOperationGroupName:other->_operationGroupName];
201 if (other->_has.operationGroupTriggered)
203 self->_operationGroupTriggered = other->_operationGroupTriggered;
204 self->_has.operationGroupTriggered = YES;