1 // This file was automatically generated by protocompiler
3 // Compiled from KCInitialMessageData.proto
5 #import "KCInitialMessageData.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 KCInitialMessageData
16 - (BOOL)hasPrepareMessage
18 return _prepareMessage != nil;
20 @synthesize prepareMessage = _prepareMessage;
22 - (NSString *)description
24 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
27 - (NSDictionary *)dictionaryRepresentation
29 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
30 if (self->_prepareMessage)
32 [dict setObject:self->_prepareMessage forKey:@"prepareMessage"];
37 BOOL KCInitialMessageDataReadFrom(__unsafe_unretained KCInitialMessageData *self, __unsafe_unretained PBDataReader *reader) {
38 while (PBReaderHasMoreData(reader)) {
42 PBReaderReadTag32AndType(reader, &tag, &aType);
44 if (PBReaderHasError(reader))
47 if (aType == TYPE_END_GROUP) {
53 case 1 /* prepareMessage */:
55 NSData *new_prepareMessage = PBReaderReadData(reader);
56 self->_prepareMessage = new_prepareMessage;
60 if (!PBReaderSkipValueWithTag(reader, tag, aType))
65 return !PBReaderHasError(reader);
68 - (BOOL)readFrom:(PBDataReader *)reader
70 return KCInitialMessageDataReadFrom(self, reader);
72 - (void)writeTo:(PBDataWriter *)writer
76 if (self->_prepareMessage)
78 PBDataWriterWriteDataField(writer, self->_prepareMessage, 1);
83 - (void)copyTo:(KCInitialMessageData *)other
87 other.prepareMessage = _prepareMessage;
91 - (id)copyWithZone:(NSZone *)zone
93 KCInitialMessageData *copy = [[[self class] allocWithZone:zone] init];
94 copy->_prepareMessage = [_prepareMessage copyWithZone:zone];
98 - (BOOL)isEqual:(id)object
100 KCInitialMessageData *other = (KCInitialMessageData *)object;
101 return [other isMemberOfClass:[self class]]
103 ((!self->_prepareMessage && !other->_prepareMessage) || [self->_prepareMessage isEqual:other->_prepareMessage])
111 [self->_prepareMessage hash]
115 - (void)mergeFrom:(KCInitialMessageData *)other
117 if (other->_prepareMessage)
119 [self setPrepareMessage:other->_prepareMessage];