1 // This file was automatically generated by protocompiler
3 // Compiled from OTPairingMessage.proto
5 #import "OTSponsorToApplicantRound2M2.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 OTSponsorToApplicantRound2M2
18 return _voucher != nil;
20 @synthesize voucher = _voucher;
21 - (BOOL)hasVoucherSignature
23 return _voucherSignature != nil;
25 @synthesize voucherSignature = _voucherSignature;
27 - (NSString *)description
29 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
32 - (NSDictionary *)dictionaryRepresentation
34 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
37 [dict setObject:self->_voucher forKey:@"voucher"];
39 if (self->_voucherSignature)
41 [dict setObject:self->_voucherSignature forKey:@"voucherSignature"];
46 BOOL OTSponsorToApplicantRound2M2ReadFrom(__unsafe_unretained OTSponsorToApplicantRound2M2 *self, __unsafe_unretained PBDataReader *reader) {
47 while (PBReaderHasMoreData(reader)) {
51 PBReaderReadTag32AndType(reader, &tag, &aType);
53 if (PBReaderHasError(reader))
56 if (aType == TYPE_END_GROUP) {
64 NSData *new_voucher = PBReaderReadData(reader);
65 self->_voucher = new_voucher;
68 case 2 /* voucherSignature */:
70 NSData *new_voucherSignature = PBReaderReadData(reader);
71 self->_voucherSignature = new_voucherSignature;
75 if (!PBReaderSkipValueWithTag(reader, tag, aType))
80 return !PBReaderHasError(reader);
83 - (BOOL)readFrom:(PBDataReader *)reader
85 return OTSponsorToApplicantRound2M2ReadFrom(self, reader);
87 - (void)writeTo:(PBDataWriter *)writer
93 PBDataWriterWriteDataField(writer, self->_voucher, 1);
96 /* voucherSignature */
98 if (self->_voucherSignature)
100 PBDataWriterWriteDataField(writer, self->_voucherSignature, 2);
105 - (void)copyTo:(OTSponsorToApplicantRound2M2 *)other
109 other.voucher = _voucher;
111 if (_voucherSignature)
113 other.voucherSignature = _voucherSignature;
117 - (id)copyWithZone:(NSZone *)zone
119 OTSponsorToApplicantRound2M2 *copy = [[[self class] allocWithZone:zone] init];
120 copy->_voucher = [_voucher copyWithZone:zone];
121 copy->_voucherSignature = [_voucherSignature copyWithZone:zone];
125 - (BOOL)isEqual:(id)object
127 OTSponsorToApplicantRound2M2 *other = (OTSponsorToApplicantRound2M2 *)object;
128 return [other isMemberOfClass:[self class]]
130 ((!self->_voucher && !other->_voucher) || [self->_voucher isEqual:other->_voucher])
132 ((!self->_voucherSignature && !other->_voucherSignature) || [self->_voucherSignature isEqual:other->_voucherSignature])
140 [self->_voucher hash]
142 [self->_voucherSignature hash]
146 - (void)mergeFrom:(OTSponsorToApplicantRound2M2 *)other
150 [self setVoucher:other->_voucher];
152 if (other->_voucherSignature)
154 [self setVoucherSignature:other->_voucherSignature];