/ KeychainCircle / generated_source / KCInitialMessageData.m
KCInitialMessageData.m
  1  // This file was automatically generated by protocompiler
  2  // DO NOT EDIT!
  3  // Compiled from KCInitialMessageData.proto
  4  
  5  #import "KCInitialMessageData.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 KCInitialMessageData
 15  
 16  - (BOOL)hasPrepareMessage
 17  {
 18      return _prepareMessage != nil;
 19  }
 20  @synthesize prepareMessage = _prepareMessage;
 21  
 22  - (NSString *)description
 23  {
 24      return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
 25  }
 26  
 27  - (NSDictionary *)dictionaryRepresentation
 28  {
 29      NSMutableDictionary *dict = [NSMutableDictionary dictionary];
 30      if (self->_prepareMessage)
 31      {
 32          [dict setObject:self->_prepareMessage forKey:@"prepareMessage"];
 33      }
 34      return dict;
 35  }
 36  
 37  BOOL KCInitialMessageDataReadFrom(__unsafe_unretained KCInitialMessageData *self, __unsafe_unretained PBDataReader *reader) {
 38      while (PBReaderHasMoreData(reader)) {
 39          uint32_t tag = 0;
 40          uint8_t aType = 0;
 41  
 42          PBReaderReadTag32AndType(reader, &tag, &aType);
 43  
 44          if (PBReaderHasError(reader))
 45              break;
 46  
 47          if (aType == TYPE_END_GROUP) {
 48              break;
 49          }
 50  
 51          switch (tag) {
 52  
 53              case 1 /* prepareMessage */:
 54              {
 55                  NSData *new_prepareMessage = PBReaderReadData(reader);
 56                  self->_prepareMessage = new_prepareMessage;
 57              }
 58              break;
 59              default:
 60                  if (!PBReaderSkipValueWithTag(reader, tag, aType))
 61                      return NO;
 62                  break;
 63          }
 64      }
 65      return !PBReaderHasError(reader);
 66  }
 67  
 68  - (BOOL)readFrom:(PBDataReader *)reader
 69  {
 70      return KCInitialMessageDataReadFrom(self, reader);
 71  }
 72  - (void)writeTo:(PBDataWriter *)writer
 73  {
 74      /* prepareMessage */
 75      {
 76          if (self->_prepareMessage)
 77          {
 78              PBDataWriterWriteDataField(writer, self->_prepareMessage, 1);
 79          }
 80      }
 81  }
 82  
 83  - (void)copyTo:(KCInitialMessageData *)other
 84  {
 85      if (_prepareMessage)
 86      {
 87          other.prepareMessage = _prepareMessage;
 88      }
 89  }
 90  
 91  - (id)copyWithZone:(NSZone *)zone
 92  {
 93      KCInitialMessageData *copy = [[[self class] allocWithZone:zone] init];
 94      copy->_prepareMessage = [_prepareMessage copyWithZone:zone];
 95      return copy;
 96  }
 97  
 98  - (BOOL)isEqual:(id)object
 99  {
100      KCInitialMessageData *other = (KCInitialMessageData *)object;
101      return [other isMemberOfClass:[self class]]
102      &&
103      ((!self->_prepareMessage && !other->_prepareMessage) || [self->_prepareMessage isEqual:other->_prepareMessage])
104      ;
105  }
106  
107  - (NSUInteger)hash
108  {
109      return 0
110      ^
111      [self->_prepareMessage hash]
112      ;
113  }
114  
115  - (void)mergeFrom:(KCInitialMessageData *)other
116  {
117      if (other->_prepareMessage)
118      {
119          [self setPrepareMessage:other->_prepareMessage];
120      }
121  }
122  
123  @end
124