1 // This file was automatically generated by protocompiler
3 // Compiled from MockAKSRefKey.proto
5 #import "MockAKSRefKey.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 MockAKSRefKey
20 @synthesize key = _key;
21 - (BOOL)hasOptionalParams
23 return _optionalParams != nil;
25 @synthesize optionalParams = _optionalParams;
27 - (NSString *)description
29 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
32 - (NSDictionary *)dictionaryRepresentation
34 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
37 [dict setObject:self->_key forKey:@"key"];
39 if (self->_optionalParams)
41 [dict setObject:self->_optionalParams forKey:@"optional_params"];
46 BOOL MockAKSRefKeyReadFrom(__unsafe_unretained MockAKSRefKey *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_key = PBReaderReadData(reader);
68 case 2 /* optionalParams */:
70 NSData *new_optionalParams = PBReaderReadData(reader);
71 self->_optionalParams = new_optionalParams;
75 if (!PBReaderSkipValueWithTag(reader, tag, aType))
80 return !PBReaderHasError(reader);
83 - (BOOL)readFrom:(PBDataReader *)reader
85 return MockAKSRefKeyReadFrom(self, reader);
87 - (void)writeTo:(PBDataWriter *)writer
93 PBDataWriterWriteDataField(writer, self->_key, 1);
98 if (self->_optionalParams)
100 PBDataWriterWriteDataField(writer, self->_optionalParams, 2);
105 - (void)copyTo:(MockAKSRefKey *)other
113 other.optionalParams = _optionalParams;
117 - (id)copyWithZone:(NSZone *)zone
119 MockAKSRefKey *copy = [[[self class] allocWithZone:zone] init];
120 copy->_key = [_key copyWithZone:zone];
121 copy->_optionalParams = [_optionalParams copyWithZone:zone];
125 - (BOOL)isEqual:(id)object
127 MockAKSRefKey *other = (MockAKSRefKey *)object;
128 return [other isMemberOfClass:[self class]]
130 ((!self->_key && !other->_key) || [self->_key isEqual:other->_key])
132 ((!self->_optionalParams && !other->_optionalParams) || [self->_optionalParams isEqual:other->_optionalParams])
142 [self->_optionalParams hash]
146 - (void)mergeFrom:(MockAKSRefKey *)other
150 [self setKey:other->_key];
152 if (other->_optionalParams)
154 [self setOptionalParams:other->_optionalParams];