]> git.saurik.com Git - apple/security.git/blob - keychain/analytics/C2Metric/SECC2MPServerInfo.m
Security-59754.80.3.tar.gz
[apple/security.git] / keychain / analytics / C2Metric / SECC2MPServerInfo.m
1 // This file was automatically generated by protocompiler
2 // DO NOT EDIT!
3 // Compiled from C2Metric.proto
4
5 #import "SECC2MPServerInfo.h"
6 #import <ProtocolBuffer/PBConstants.h>
7 #import <ProtocolBuffer/PBHashUtil.h>
8 #import <ProtocolBuffer/PBDataReader.h>
9
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.
12 #endif
13
14 @implementation SECC2MPServerInfo
15
16 - (BOOL)hasServiceName
17 {
18 return _serviceName != nil;
19 }
20 @synthesize serviceName = _serviceName;
21 - (BOOL)hasPartition
22 {
23 return _partition != nil;
24 }
25 @synthesize partition = _partition;
26 - (BOOL)hasServiceBuild
27 {
28 return _serviceBuild != nil;
29 }
30 @synthesize serviceBuild = _serviceBuild;
31 - (BOOL)hasServiceInstance
32 {
33 return _serviceInstance != nil;
34 }
35 @synthesize serviceInstance = _serviceInstance;
36
37 - (NSString *)description
38 {
39 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
40 }
41
42 - (NSDictionary *)dictionaryRepresentation
43 {
44 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
45 if (self->_serviceName)
46 {
47 [dict setObject:self->_serviceName forKey:@"service_name"];
48 }
49 if (self->_partition)
50 {
51 [dict setObject:self->_partition forKey:@"partition"];
52 }
53 if (self->_serviceBuild)
54 {
55 [dict setObject:self->_serviceBuild forKey:@"service_build"];
56 }
57 if (self->_serviceInstance)
58 {
59 [dict setObject:self->_serviceInstance forKey:@"service_instance"];
60 }
61 return dict;
62 }
63
64 BOOL SECC2MPServerInfoReadFrom(__unsafe_unretained SECC2MPServerInfo *self, __unsafe_unretained PBDataReader *reader) {
65 while (PBReaderHasMoreData(reader)) {
66 uint32_t tag = 0;
67 uint8_t aType = 0;
68
69 PBReaderReadTag32AndType(reader, &tag, &aType);
70
71 if (PBReaderHasError(reader))
72 break;
73
74 if (aType == TYPE_END_GROUP) {
75 break;
76 }
77
78 switch (tag) {
79
80 case 102 /* serviceName */:
81 {
82 NSString *new_serviceName = PBReaderReadString(reader);
83 self->_serviceName = new_serviceName;
84 }
85 break;
86 case 103 /* partition */:
87 {
88 NSString *new_partition = PBReaderReadString(reader);
89 self->_partition = new_partition;
90 }
91 break;
92 case 104 /* serviceBuild */:
93 {
94 NSString *new_serviceBuild = PBReaderReadString(reader);
95 self->_serviceBuild = new_serviceBuild;
96 }
97 break;
98 case 105 /* serviceInstance */:
99 {
100 NSString *new_serviceInstance = PBReaderReadString(reader);
101 self->_serviceInstance = new_serviceInstance;
102 }
103 break;
104 default:
105 if (!PBReaderSkipValueWithTag(reader, tag, aType))
106 return NO;
107 break;
108 }
109 }
110 return !PBReaderHasError(reader);
111 }
112
113 - (BOOL)readFrom:(PBDataReader *)reader
114 {
115 return SECC2MPServerInfoReadFrom(self, reader);
116 }
117 - (void)writeTo:(PBDataWriter *)writer
118 {
119 /* serviceName */
120 {
121 if (self->_serviceName)
122 {
123 PBDataWriterWriteStringField(writer, self->_serviceName, 102);
124 }
125 }
126 /* partition */
127 {
128 if (self->_partition)
129 {
130 PBDataWriterWriteStringField(writer, self->_partition, 103);
131 }
132 }
133 /* serviceBuild */
134 {
135 if (self->_serviceBuild)
136 {
137 PBDataWriterWriteStringField(writer, self->_serviceBuild, 104);
138 }
139 }
140 /* serviceInstance */
141 {
142 if (self->_serviceInstance)
143 {
144 PBDataWriterWriteStringField(writer, self->_serviceInstance, 105);
145 }
146 }
147 }
148
149 - (void)copyTo:(SECC2MPServerInfo *)other
150 {
151 if (_serviceName)
152 {
153 other.serviceName = _serviceName;
154 }
155 if (_partition)
156 {
157 other.partition = _partition;
158 }
159 if (_serviceBuild)
160 {
161 other.serviceBuild = _serviceBuild;
162 }
163 if (_serviceInstance)
164 {
165 other.serviceInstance = _serviceInstance;
166 }
167 }
168
169 - (id)copyWithZone:(NSZone *)zone
170 {
171 SECC2MPServerInfo *copy = [[[self class] allocWithZone:zone] init];
172 copy->_serviceName = [_serviceName copyWithZone:zone];
173 copy->_partition = [_partition copyWithZone:zone];
174 copy->_serviceBuild = [_serviceBuild copyWithZone:zone];
175 copy->_serviceInstance = [_serviceInstance copyWithZone:zone];
176 return copy;
177 }
178
179 - (BOOL)isEqual:(id)object
180 {
181 SECC2MPServerInfo *other = (SECC2MPServerInfo *)object;
182 return [other isMemberOfClass:[self class]]
183 &&
184 ((!self->_serviceName && !other->_serviceName) || [self->_serviceName isEqual:other->_serviceName])
185 &&
186 ((!self->_partition && !other->_partition) || [self->_partition isEqual:other->_partition])
187 &&
188 ((!self->_serviceBuild && !other->_serviceBuild) || [self->_serviceBuild isEqual:other->_serviceBuild])
189 &&
190 ((!self->_serviceInstance && !other->_serviceInstance) || [self->_serviceInstance isEqual:other->_serviceInstance])
191 ;
192 }
193
194 - (NSUInteger)hash
195 {
196 return 0
197 ^
198 [self->_serviceName hash]
199 ^
200 [self->_partition hash]
201 ^
202 [self->_serviceBuild hash]
203 ^
204 [self->_serviceInstance hash]
205 ;
206 }
207
208 - (void)mergeFrom:(SECC2MPServerInfo *)other
209 {
210 if (other->_serviceName)
211 {
212 [self setServiceName:other->_serviceName];
213 }
214 if (other->_partition)
215 {
216 [self setPartition:other->_partition];
217 }
218 if (other->_serviceBuild)
219 {
220 [self setServiceBuild:other->_serviceBuild];
221 }
222 if (other->_serviceInstance)
223 {
224 [self setServiceInstance:other->_serviceInstance];
225 }
226 }
227
228 @end
229