]> git.saurik.com Git - apple/security.git/blob - keychain/ot/proto/generated_source/OTApplicantToSponsorRound2M1.m
Security-59306.11.20.tar.gz
[apple/security.git] / keychain / ot / proto / generated_source / OTApplicantToSponsorRound2M1.m
1 // This file was automatically generated by protocompiler
2 // DO NOT EDIT!
3 // Compiled from OTPairingMessage.proto
4
5 #import "OTApplicantToSponsorRound2M1.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 OTApplicantToSponsorRound2M1
15
16 - (BOOL)hasPeerID
17 {
18 return _peerID != nil;
19 }
20 @synthesize peerID = _peerID;
21 - (BOOL)hasPermanentInfo
22 {
23 return _permanentInfo != nil;
24 }
25 @synthesize permanentInfo = _permanentInfo;
26 - (BOOL)hasPermanentInfoSig
27 {
28 return _permanentInfoSig != nil;
29 }
30 @synthesize permanentInfoSig = _permanentInfoSig;
31 - (BOOL)hasStableInfo
32 {
33 return _stableInfo != nil;
34 }
35 @synthesize stableInfo = _stableInfo;
36 - (BOOL)hasStableInfoSig
37 {
38 return _stableInfoSig != nil;
39 }
40 @synthesize stableInfoSig = _stableInfoSig;
41
42 - (NSString *)description
43 {
44 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
45 }
46
47 - (NSDictionary *)dictionaryRepresentation
48 {
49 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
50 if (self->_peerID)
51 {
52 [dict setObject:self->_peerID forKey:@"peerID"];
53 }
54 if (self->_permanentInfo)
55 {
56 [dict setObject:self->_permanentInfo forKey:@"permanentInfo"];
57 }
58 if (self->_permanentInfoSig)
59 {
60 [dict setObject:self->_permanentInfoSig forKey:@"permanentInfoSig"];
61 }
62 if (self->_stableInfo)
63 {
64 [dict setObject:self->_stableInfo forKey:@"stableInfo"];
65 }
66 if (self->_stableInfoSig)
67 {
68 [dict setObject:self->_stableInfoSig forKey:@"StableInfoSig"];
69 }
70 return dict;
71 }
72
73 BOOL OTApplicantToSponsorRound2M1ReadFrom(__unsafe_unretained OTApplicantToSponsorRound2M1 *self, __unsafe_unretained PBDataReader *reader) {
74 while (PBReaderHasMoreData(reader)) {
75 uint32_t tag = 0;
76 uint8_t aType = 0;
77
78 PBReaderReadTag32AndType(reader, &tag, &aType);
79
80 if (PBReaderHasError(reader))
81 break;
82
83 if (aType == TYPE_END_GROUP) {
84 break;
85 }
86
87 switch (tag) {
88
89 case 1 /* peerID */:
90 {
91 NSString *new_peerID = PBReaderReadString(reader);
92 self->_peerID = new_peerID;
93 }
94 break;
95 case 2 /* permanentInfo */:
96 {
97 NSData *new_permanentInfo = PBReaderReadData(reader);
98 self->_permanentInfo = new_permanentInfo;
99 }
100 break;
101 case 3 /* permanentInfoSig */:
102 {
103 NSData *new_permanentInfoSig = PBReaderReadData(reader);
104 self->_permanentInfoSig = new_permanentInfoSig;
105 }
106 break;
107 case 4 /* stableInfo */:
108 {
109 NSData *new_stableInfo = PBReaderReadData(reader);
110 self->_stableInfo = new_stableInfo;
111 }
112 break;
113 case 5 /* stableInfoSig */:
114 {
115 NSData *new_stableInfoSig = PBReaderReadData(reader);
116 self->_stableInfoSig = new_stableInfoSig;
117 }
118 break;
119 default:
120 if (!PBReaderSkipValueWithTag(reader, tag, aType))
121 return NO;
122 break;
123 }
124 }
125 return !PBReaderHasError(reader);
126 }
127
128 - (BOOL)readFrom:(PBDataReader *)reader
129 {
130 return OTApplicantToSponsorRound2M1ReadFrom(self, reader);
131 }
132 - (void)writeTo:(PBDataWriter *)writer
133 {
134 /* peerID */
135 {
136 if (self->_peerID)
137 {
138 PBDataWriterWriteStringField(writer, self->_peerID, 1);
139 }
140 }
141 /* permanentInfo */
142 {
143 if (self->_permanentInfo)
144 {
145 PBDataWriterWriteDataField(writer, self->_permanentInfo, 2);
146 }
147 }
148 /* permanentInfoSig */
149 {
150 if (self->_permanentInfoSig)
151 {
152 PBDataWriterWriteDataField(writer, self->_permanentInfoSig, 3);
153 }
154 }
155 /* stableInfo */
156 {
157 if (self->_stableInfo)
158 {
159 PBDataWriterWriteDataField(writer, self->_stableInfo, 4);
160 }
161 }
162 /* stableInfoSig */
163 {
164 if (self->_stableInfoSig)
165 {
166 PBDataWriterWriteDataField(writer, self->_stableInfoSig, 5);
167 }
168 }
169 }
170
171 - (void)copyTo:(OTApplicantToSponsorRound2M1 *)other
172 {
173 if (_peerID)
174 {
175 other.peerID = _peerID;
176 }
177 if (_permanentInfo)
178 {
179 other.permanentInfo = _permanentInfo;
180 }
181 if (_permanentInfoSig)
182 {
183 other.permanentInfoSig = _permanentInfoSig;
184 }
185 if (_stableInfo)
186 {
187 other.stableInfo = _stableInfo;
188 }
189 if (_stableInfoSig)
190 {
191 other.stableInfoSig = _stableInfoSig;
192 }
193 }
194
195 - (id)copyWithZone:(NSZone *)zone
196 {
197 OTApplicantToSponsorRound2M1 *copy = [[[self class] allocWithZone:zone] init];
198 copy->_peerID = [_peerID copyWithZone:zone];
199 copy->_permanentInfo = [_permanentInfo copyWithZone:zone];
200 copy->_permanentInfoSig = [_permanentInfoSig copyWithZone:zone];
201 copy->_stableInfo = [_stableInfo copyWithZone:zone];
202 copy->_stableInfoSig = [_stableInfoSig copyWithZone:zone];
203 return copy;
204 }
205
206 - (BOOL)isEqual:(id)object
207 {
208 OTApplicantToSponsorRound2M1 *other = (OTApplicantToSponsorRound2M1 *)object;
209 return [other isMemberOfClass:[self class]]
210 &&
211 ((!self->_peerID && !other->_peerID) || [self->_peerID isEqual:other->_peerID])
212 &&
213 ((!self->_permanentInfo && !other->_permanentInfo) || [self->_permanentInfo isEqual:other->_permanentInfo])
214 &&
215 ((!self->_permanentInfoSig && !other->_permanentInfoSig) || [self->_permanentInfoSig isEqual:other->_permanentInfoSig])
216 &&
217 ((!self->_stableInfo && !other->_stableInfo) || [self->_stableInfo isEqual:other->_stableInfo])
218 &&
219 ((!self->_stableInfoSig && !other->_stableInfoSig) || [self->_stableInfoSig isEqual:other->_stableInfoSig])
220 ;
221 }
222
223 - (NSUInteger)hash
224 {
225 return 0
226 ^
227 [self->_peerID hash]
228 ^
229 [self->_permanentInfo hash]
230 ^
231 [self->_permanentInfoSig hash]
232 ^
233 [self->_stableInfo hash]
234 ^
235 [self->_stableInfoSig hash]
236 ;
237 }
238
239 - (void)mergeFrom:(OTApplicantToSponsorRound2M1 *)other
240 {
241 if (other->_peerID)
242 {
243 [self setPeerID:other->_peerID];
244 }
245 if (other->_permanentInfo)
246 {
247 [self setPermanentInfo:other->_permanentInfo];
248 }
249 if (other->_permanentInfoSig)
250 {
251 [self setPermanentInfoSig:other->_permanentInfoSig];
252 }
253 if (other->_stableInfo)
254 {
255 [self setStableInfo:other->_stableInfo];
256 }
257 if (other->_stableInfoSig)
258 {
259 [self setStableInfoSig:other->_stableInfoSig];
260 }
261 }
262
263 @end
264