1 // This file was automatically generated by protocompiler
3 // Compiled from OTPairingMessage.proto
5 #import "OTApplicantToSponsorRound2M1.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 OTApplicantToSponsorRound2M1
18 return _peerID != nil;
20 @synthesize peerID = _peerID;
21 - (BOOL)hasPermanentInfo
23 return _permanentInfo != nil;
25 @synthesize permanentInfo = _permanentInfo;
26 - (BOOL)hasPermanentInfoSig
28 return _permanentInfoSig != nil;
30 @synthesize permanentInfoSig = _permanentInfoSig;
33 return _stableInfo != nil;
35 @synthesize stableInfo = _stableInfo;
36 - (BOOL)hasStableInfoSig
38 return _stableInfoSig != nil;
40 @synthesize stableInfoSig = _stableInfoSig;
42 - (NSString *)description
44 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
47 - (NSDictionary *)dictionaryRepresentation
49 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
52 [dict setObject:self->_peerID forKey:@"peerID"];
54 if (self->_permanentInfo)
56 [dict setObject:self->_permanentInfo forKey:@"permanentInfo"];
58 if (self->_permanentInfoSig)
60 [dict setObject:self->_permanentInfoSig forKey:@"permanentInfoSig"];
62 if (self->_stableInfo)
64 [dict setObject:self->_stableInfo forKey:@"stableInfo"];
66 if (self->_stableInfoSig)
68 [dict setObject:self->_stableInfoSig forKey:@"StableInfoSig"];
73 BOOL OTApplicantToSponsorRound2M1ReadFrom(__unsafe_unretained OTApplicantToSponsorRound2M1 *self, __unsafe_unretained PBDataReader *reader) {
74 while (PBReaderHasMoreData(reader)) {
78 PBReaderReadTag32AndType(reader, &tag, &aType);
80 if (PBReaderHasError(reader))
83 if (aType == TYPE_END_GROUP) {
91 NSString *new_peerID = PBReaderReadString(reader);
92 self->_peerID = new_peerID;
95 case 2 /* permanentInfo */:
97 NSData *new_permanentInfo = PBReaderReadData(reader);
98 self->_permanentInfo = new_permanentInfo;
101 case 3 /* permanentInfoSig */:
103 NSData *new_permanentInfoSig = PBReaderReadData(reader);
104 self->_permanentInfoSig = new_permanentInfoSig;
107 case 4 /* stableInfo */:
109 NSData *new_stableInfo = PBReaderReadData(reader);
110 self->_stableInfo = new_stableInfo;
113 case 5 /* stableInfoSig */:
115 NSData *new_stableInfoSig = PBReaderReadData(reader);
116 self->_stableInfoSig = new_stableInfoSig;
120 if (!PBReaderSkipValueWithTag(reader, tag, aType))
125 return !PBReaderHasError(reader);
128 - (BOOL)readFrom:(PBDataReader *)reader
130 return OTApplicantToSponsorRound2M1ReadFrom(self, reader);
132 - (void)writeTo:(PBDataWriter *)writer
138 PBDataWriterWriteStringField(writer, self->_peerID, 1);
143 if (self->_permanentInfo)
145 PBDataWriterWriteDataField(writer, self->_permanentInfo, 2);
148 /* permanentInfoSig */
150 if (self->_permanentInfoSig)
152 PBDataWriterWriteDataField(writer, self->_permanentInfoSig, 3);
157 if (self->_stableInfo)
159 PBDataWriterWriteDataField(writer, self->_stableInfo, 4);
164 if (self->_stableInfoSig)
166 PBDataWriterWriteDataField(writer, self->_stableInfoSig, 5);
171 - (void)copyTo:(OTApplicantToSponsorRound2M1 *)other
175 other.peerID = _peerID;
179 other.permanentInfo = _permanentInfo;
181 if (_permanentInfoSig)
183 other.permanentInfoSig = _permanentInfoSig;
187 other.stableInfo = _stableInfo;
191 other.stableInfoSig = _stableInfoSig;
195 - (id)copyWithZone:(NSZone *)zone
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];
206 - (BOOL)isEqual:(id)object
208 OTApplicantToSponsorRound2M1 *other = (OTApplicantToSponsorRound2M1 *)object;
209 return [other isMemberOfClass:[self class]]
211 ((!self->_peerID && !other->_peerID) || [self->_peerID isEqual:other->_peerID])
213 ((!self->_permanentInfo && !other->_permanentInfo) || [self->_permanentInfo isEqual:other->_permanentInfo])
215 ((!self->_permanentInfoSig && !other->_permanentInfoSig) || [self->_permanentInfoSig isEqual:other->_permanentInfoSig])
217 ((!self->_stableInfo && !other->_stableInfo) || [self->_stableInfo isEqual:other->_stableInfo])
219 ((!self->_stableInfoSig && !other->_stableInfoSig) || [self->_stableInfoSig isEqual:other->_stableInfoSig])
229 [self->_permanentInfo hash]
231 [self->_permanentInfoSig hash]
233 [self->_stableInfo hash]
235 [self->_stableInfoSig hash]
239 - (void)mergeFrom:(OTApplicantToSponsorRound2M1 *)other
243 [self setPeerID:other->_peerID];
245 if (other->_permanentInfo)
247 [self setPermanentInfo:other->_permanentInfo];
249 if (other->_permanentInfoSig)
251 [self setPermanentInfoSig:other->_permanentInfoSig];
253 if (other->_stableInfo)
255 [self setStableInfo:other->_stableInfo];
257 if (other->_stableInfoSig)
259 [self setStableInfoSig:other->_stableInfoSig];